ORACLE RAC集群 RMAN自动备份controlfile失败之ORA-00245&ORA-27037

本文介绍了一次Oracle RAC集群中控制文件自动备份失败的问题排查过程。故障原因在于控制文件自动备份配置指向了一个仅存在于一个节点上的本地目录。通过在缺失备份目录的节点上创建相应目录并调整权限,最终解决了备份失败的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    近期oracle数据库巡检中,广州汕头一RAC集群有告警日志显示RMAN自动备份控制文件失败,原因是控制文件自动备份打开并且备份目录在本地,涉及的备份目录只在节点2上有,而在节点1上没有,导致控制文件自动备份失败!
    操作系统:RHEL6.7
    数据库版本:11.2.0.4
    告警日志信息:
    节点1:
Fri Jan 06 20:04:06 2017
Control file backup creation failed:
  failure to open backup target file /u01/app/oracle/product/11.2.0/dbs/snapcf_orcl2.f.
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_ckpt_35202.trc:
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
[oracle@rac01 trace]$ more  /u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_ckpt_35202.trc
Trace file /u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_ckpt_35202.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0
System name:    Linux
Node name:      rac01
Release:        4.1.12-37.4.1.el6uek.x86_64
Version:        #2 SMP Tue May 17 07:23:38 PDT 2016
Machine:        x86_64
Instance name: orcl1
Redo thread mounted by this instance: 1
Oracle process number: 21
Unix process pid: 35202, image: oracle@rac01 (CKPT)
*** 2016-09-21 22:04:41.855
*** SESSION ID:(153.1) 2016-09-21 22:04:41.855
*** CLIENT ID:() 2016-09-21 22:04:41.855
*** SERVICE NAME:(SYS$BACKGROUND) 2016-09-21 22:04:41.855
*** MODULE NAME:() 2016-09-21 22:04:41.855
*** ACTION NAME:() 2016-09-21 22:04:41.855
Redo thread 2 internally enabled
Control file enqueue hold time tracking dump at time: 5304

    节点2:
[oracle@rac02 trace]$ 
Fri Jan 06 20:04:06 2017
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl2/trace/orcl2_ora_63100.trc:
ORA-00245: control file backup failed; target is likely on a local file system
[oracle@rac02 trace]$ more  /u01/app/oracle/diag/rdbms/orcl/orcl2/trace/orcl2_ora_63100.trc
Trace file /u01/app/oracle/diag/rdbms/orcl/orcl2/trace/orcl2_ora_63100.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0
System name:    Linux
Node name:      rac02
Release:        4.1.12-37.4.1.el6uek.x86_64
Version:        #2 SMP Tue May 17 07:23:38 PDT 2016
Machine:        x86_64
Instance name: orcl2
Redo thread mounted by this instance: 2
Oracle process number: 67
Unix process pid: 63100, image: oracle@rac02 (TNS V1-V3)
*** 2017-01-06 20:04:06.406
*** SESSION ID:(288.7239) 2017-01-06 20:04:06.406
*** CLIENT ID:() 2017-01-06 20:04:06.406
*** SERVICE NAME:(SYS$USERS) 2017-01-06 20:04:06.406
*** MODULE NAME:(backup archivelog) 2017-01-06 20:04:06.406
*** ACTION NAME:(0000096 STARTED111) 2017-01-06 20:04:06.406
Starting control autobackup
ORA-00245: control file backup failed; target is likely on a local file system
Got error: 245
Autobackup failed with following error
ORA-00245: control file backup failed; target is likely on a local file system
    查看集群控制文件位置(集群控制文件应该在共享存储,如果不在共享存储可能备份控制文件会失败)
[oracle@rac02 trace]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 9 14:10:24 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select * from v$controlfile;
STATUS  NAME                                                                             IS_ BLOCK_SIZE FILE_SIZE_BLKS
-------     --------------------------------------------------------------------------------      --- ---------- --------------
          +DATA01/orcl/controlfile/current.260.923176917                         NO       16384           3384
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@rac02 trace]$
    在1节点尝试备份控制文件
[oracle@rac01 trace]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 9 14:14:57 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1450957652)
RMAN> backup current controlfile;
Starting backup at 2017-01-09 14:15:12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=462 instance=orcl1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2017-01-09 14:15:14
channel ORA_DISK_1: finished piece 1 at 2017-01-09 14:15:15
piece handle=/u01/app/oracle/product/11.2.0/dbs/i5rpjijh_1_1 tag=TAG20170109T141513 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-01-09 14:15:15
Starting Control File and SPFILE Autobackup at 2017-01-09 14:15:15
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of Control File and SPFILE Autobackup command on ORA_DISK_1 channel at 01/09/2017 14:15:16
ORA-19504: failed to create file "/u01/backup/data/c-1450957652-20170109-01"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1
    查看rman备份设置(看到的备份设置是备份集群控制文件到本地)
[oracle@rac02 trace]$ rman target /
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/backup/data/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
RMAN> 
    查看节点1的备份目录是否存在(果然,节点2存放的备份,备份目录一定存在,而节点1上没有创建备份目录):
[oracle@rac01 ~]$ cd /u01/backup/data
-bash: cd: /u01/backup/data: No such file or directory
[oracle@rac01 ~]$
    节点1上创建备份目录并赋予权限:
[root@rac01 u01]# mkdir -p backup/data
[root@rac01 u01]# ls -l
total 36
drwxr-xr-x. 6 root   oinstall  4096 Sep 21 20:00 app
drwxr-xr-x  3 root   root      4096 Jan  9 14:18 backup
drwxrwxr-x  7 oracle oinstall  4096 Sep 21 22:00 database
drwxrwxrwx  2 oracle oinstall  4096 Sep 22 02:52 dump
drwxrwxr-x  7 oracle oinstall  4096 Aug 27  2013 grid
drwxrwxr-x. 2 oracle oinstall 16384 Sep 21 18:53 lost+found
[root@rac01 u01]# chown -R oracle:oinstall backup
[root@rac01 u01]# chmod -R 777 backup
[root@rac01 u01]# ls -l
total 36
drwxr-xr-x. 6 root   oinstall  4096 Sep 21 20:00 app
drwxrwxrwx  3 oracle oinstall  4096 Jan  9 14:18 backup
drwxrwxr-x  7 oracle oinstall  4096 Sep 21 22:00 database
drwxrwxrwx  2 oracle oinstall  4096 Sep 22 02:52 dump
drwxrwxr-x  7 oracle oinstall  4096 Aug 27  2013 grid
drwxrwxr-x. 2 oracle oinstall 16384 Sep 21 18:53 lost+found
[root@rac01 u01]#
    在1节点重新尝试备份控制文件(成功了):
[oracle@rac01 trace]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 9 14:22:50 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1450957652)
RMAN>  backup current controlfile;
Starting backup at 2017-01-09 14:19:43
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2017-01-09 14:19:44
channel ORA_DISK_1: finished piece 1 at 2017-01-09 14:19:45
piece handle=/u01/app/oracle/product/11.2.0/dbs/i7rpjirv_1_1 tag=TAG20170109T141943 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-01-09 14:19:45
Starting Control File and SPFILE Autobackup at 2017-01-09 14:19:45
piece handle=/u01/backup/data/c-1450957652-20170109-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2017-01-09 14:19:46

RMAN> list backup of controlfile;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1501    Full    52.95M     DISK        00:00:01     2017-01-01 20:01:15
        BP Key: 1501   Status: AVAILABLE  Compressed: NO  Tag: TAG20170101T200114
        Piece Name: /u01/backup/data/c-1450957652-20170101-00
  Control File Included: Ckp SCN: 143516927    Ckp time: 2017-01-01 20:01:14


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1506    Full    52.95M     DISK        00:00:01     2017-01-02 20:01:11
        BP Key: 1506   Status: AVAILABLE  Compressed: NO  Tag: TAG20170102T200110
        Piece Name: /u01/backup/data/c-1450957652-20170102-00
  Control File Included: Ckp SCN: 144147774    Ckp time: 2017-01-02 20:01:10


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1555    Full    52.95M     DISK        00:00:00     2017-01-03 20:20:26
        BP Key: 1555   Status: AVAILABLE  Compressed: NO  Tag: TAG20170103T202026
        Piece Name: /u01/backup/data/c-1450957652-20170103-00
  Control File Included: Ckp SCN: 155236810    Ckp time: 2017-01-03 20:20:26


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1566    Full    52.95M     DISK        00:00:01     2017-01-05 20:03:16
        BP Key: 1566   Status: AVAILABLE  Compressed: NO  Tag: TAG20170105T200315
        Piece Name: /u01/backup/data/c-1450957652-20170105-00
  Control File Included: Ckp SCN: 157603651    Ckp time: 2017-01-05 20:03:15


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1586    Full    52.95M     DISK        00:00:01     2017-01-07 01:29:12
        BP Key: 1586   Status: AVAILABLE  Compressed: NO  Tag: TAG20170107T012911
        Piece Name: /u01/backup/data/c-1450957652-20170107-00
  Control File Included: Ckp SCN: 161699766    Ckp time: 2017-01-07 01:29:11


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1591    Full    52.95M     DISK        00:00:01     2017-01-07 20:01:11
        BP Key: 1591   Status: AVAILABLE  Compressed: NO  Tag: TAG20170107T200110
        Piece Name: /u01/backup/data/c-1450957652-20170107-01
  Control File Included: Ckp SCN: 162284897    Ckp time: 2017-01-07 20:01:10


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1596    Full    52.95M     DISK        00:00:01     2017-01-08 20:01:21
        BP Key: 1596   Status: AVAILABLE  Compressed: NO  Tag: TAG20170108T200120
        Piece Name: /u01/backup/data/c-1450957652-20170108-00
  Control File Included: Ckp SCN: 162881404    Ckp time: 2017-01-08 20:01:20


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1597    Full    52.92M     DISK        00:00:01     2017-01-09 10:52:12
        BP Key: 1597   Status: AVAILABLE  Compressed: NO  Tag: TAG20170109T105211
        Piece Name: /u01/app/oracle/product/11.2.0/dbs/i3rpj6mr_1_1
  Control File Included: Ckp SCN: 163348183    Ckp time: 2017-01-09 10:52:11


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1598    Full    52.95M     DISK        00:00:00     2017-01-09 10:52:13
        BP Key: 1598   Status: AVAILABLE  Compressed: NO  Tag: TAG20170109T105213
        Piece Name: /u01/backup/data/c-1450957652-20170109-00
  Control File Included: Ckp SCN: 163348190    Ckp time: 2017-01-09 10:52:13


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1599    Full    52.92M     DISK        00:00:01     2017-01-09 14:15:14
        BP Key: 1599   Status: AVAILABLE  Compressed: NO  Tag: TAG20170109T141513
        Piece Name: /u01/app/oracle/product/11.2.0/dbs/i5rpjijh_1_1
  Control File Included: Ckp SCN: 163446650    Ckp time: 2017-01-09 14:15:13


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1600    Full    52.92M     DISK        00:00:01     2017-01-09 14:19:44
        BP Key: 1600   Status: AVAILABLE  Compressed: NO  Tag: TAG20170109T141943
        Piece Name: /u01/app/oracle/product/11.2.0/dbs/i7rpjirv_1_1
  Control File Included: Ckp SCN: 163447041    Ckp time: 2017-01-09 14:19:43


BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
1601    Full    52.95M     DISK        00:00:00     2017-01-09 14:19:45
        BP Key: 1601   Status: AVAILABLE  Compressed: NO  Tag: TAG20170109T141945
        Piece Name: /u01/backup/data/c-1450957652-20170109-02
  Control File Included: Ckp SCN: 163447048    Ckp time: 2017-01-09 14:19:45
RMAN> quit

Recovery Manager complete.
[oracle@rac01 trace]$ 






<think>嗯,用户遇到了Oracle11gRAC环境中的ORA-01565错误,这个错误通常和spfile文件访问有关。从引用内容看,用户已经收集了一些相关案例,包括权限问题、ASM磁盘组挂载问题等。用户的核心诉求是定位文件识别问题并找到解决方案。用户提供的引用信息很有价值:[^1]和[^2]都提到spfile路径识别失败,[^3]则指出可能是二进制文件权限问题。特别注意到引用[3]提到"bin/oracle权限引起",这提示我需要检查GRID和RDBMS的安装权限。考虑到RAC环境的复杂性,需要从多个维度排查:首先确认ASM磁盘组状态,因为+DATA开头的路径属于ASM存储;其次检查集群资源注册情况,spfile位置应该与srvctl配置一致;最后是操作系统层面的权限检查,包括文件权限和SELinux等安全设置。用户没有提到具体操作步骤,所以我会给出完整的诊断流程。特别要注意的是RAC环境下需要同时检查所有节点,因为某个节点的配置错误就可能导致整个集群启动失败ORA-12547报错通常意味着进程通信中断,往往伴随权限问题。解决方案部分将按优先级排序:最简单的权限修复放在前面,复杂的存储恢复放在后面。引用[3]提供的chmod6751方案需要谨慎操作,必须确认两个属主是否正确。另外补充了环境变量和参数文件备份的建议,这是很多文档容易忽略的实用技巧。</think>以下是针对 Oracle 11g RAC 环境中 ORA-01565 错误的完整解决方案,结合错误本质和引用案例逐步排查: --- ### **错误原因分析** ORA-01565 表明数据库无法识别或访问 `spfile` 文件,通常由以下原因引起: 1. **文件路径错误**:`spfile` 路径在参数文件或 ASM 中配置不正确 2. **权限问题**:Oracle 用户无权访问 ASM 磁盘组或 OS 文件(如引用[2][3]所述) 3. **ASM 状态异常**:磁盘组未挂载或存储路径失效(引用[1][2]中的 `ORA-17503`) 4. **集群注册不一致**:RAC 资源未正确注册 `spfile` 位置 --- ### **逐步解决方案** #### **步骤 1:检查 ASM 磁盘组状态** ```sql -- 以 grid 用户登录 ASM 实例 sqlplus / as sysasm SELECT name, state FROM v$asm_diskgroup; ``` - **预期结果**:`+DATA` 状态应为 `MOUNTED` - **异常处理**: - 若状态为 `DISMOUNTED`,挂载磁盘组: ```sql ALTER DISKGROUP DATA MOUNT; ``` - 若报错 `ORA-15032`,检查 ASM 磁盘权限(参考引用[3]) #### **步骤 2:验证 spfile 物理存在** ```bash # 确认 ASM 中文件是否存在 asmcmd ls "+DATA/rac11g/spfilerac11g.ora" ``` - **若文件不存在**: -备份恢复 `spfile`,或使用 `pfile` 启动: ```bash sqlplus / as sysdba STARTUP PFILE='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/init<sid>.ora'; ``` #### **步骤 3:检查集群资源注册** ```bash # 以 root 用户执行 crsctl stat res -t -w "TYPE = ora.database.type" # 查看数据库资源配置 srvctl config database -d <db_name> # 检查 spfile 路径配置 ``` - **修正错误路径**(如引用[2]案例): ```bash srvctl modify database -d <db_name> -p '+DATA/rac11g/spfilerac11g.ora' ``` #### **步骤 4:修复权限问题(关键步骤)** 1. **检查文件权限**: ```bash ls -l $ORACLE_HOME/bin/oracle # 确认权限为 -rwsr-s--x (6751) ``` 2. **按引用[3]修复权限**: ```bash # 以 root 用户执行 chown grid:oinstall $ORACLE_HOME/bin/oracle chmod 6751 $ORACLE_HOME/bin/oracle ``` 3. **检查 ASM 文件权限**: ```bash asmcmd ls -l "+DATA/rac11g/spfilerac11g.ora" ``` - 确保权限为 `-rw-r-----` 且属主为 `oracle:dba` #### **步骤 5:重启集群服务** ```bash # 以 root 用户执行 crsctl stop cluster -all # 停止整个集群 crsctl start cluster -all # 重新启动集群 srvctl start instance -d <db_name> -i <instance_name> # 启动数据库实例 ``` --- ### **预防措施** 1. **定期验证配置**: ```bash srvctl config database -d <db_name> > /backup/db_config_$(date +%F).txt ``` 2. **备份关键文件**: ```bash asmcmd cp '+DATA/rac11g/spfilerac11g.ora' '/backup/spfile_$(date +%F).ora' ``` 3. **使用 RMAN 自动备份 spfile**: ```sql CONFIGURE CONTROLFILE AUTOBACKUP ON; ``` > **重要提示**:操作前备份 ASM 和数据库文件!若问题仍存在,检查 `alert_<sid>.log` 和 `crsd.log` 中的 ORA-12547 等关联错误(如引用[2][3])。 --- ### 相关问题 1. **如何诊断 Oracle RAC 中的 ORA-17503 存储访问错误?** 2. **Oracle 11g RAC 环境下如何安全迁移 spfile 到新 ASM 磁盘组?** 3. **集群资源管理器(CRS)注册信息不一致会导致哪些典型故障?** [^1]: ORA-01565 错误案例分析与 ASM 文件访问失败 [^2]: RAC 环境权限变更引发的启动故障 [^3]: 二进制文件权限修复解决 ORA-12547
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值