新部署的oracle 11.2.0.4 RAC,在恢复控制文件的时候出现ORA-19504、ORA-17502、ORA-15001、ORA-15040错误。
环境描述:
[grid@rac2 ~]$ opatch lspatches
28729245;ACFS Patch Set Update : 11.2.0.4.190115 (28729245)
28729262;Database Patch Set Update : 11.2.0.4.190115 (28729262)
28729234;OCW Patch Set Update : 11.2.0.4.190115 (28729234)
OPatch succeeded.
[grid@rac2 ~]$ exit
logout
[root@rac2 dev]# su - oracle
[oracle@rac2 ~]$ opatch lspatches
28729262;Database Patch Set Update : 11.2.0.4.190115 (28729262)
28729234;OCW Patch Set Update : 11.2.0.4.190115 (28729234)
OPatch succeeded.
新部署的Oracle 11.2.0.4 RAC,打了2019年1月的PSU。
恢复控制文件时报错:
RMAN> restore controlfile from '/home/oracle/rmanbak/ctl_ESHOPCRM_1063577282_3357.ctl';
Starting restore at 04-FEB-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2167 instance=eshopcrm2 device type=DISK
channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/04/2021 12:49:34
ORA-19870: error while restoring backup piece /home/oracle/rmanbak/ctl_ESHOPCRM_1063577282_3357.ctl
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-15040: diskgroup is incomplete
ORA-15040: diskgroup is incomplete
查看磁盘组状态:
[grid@rac1 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 1024000 1023864 0 1023864 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 30720 29794 10240 9777 0 Y VOTE/
DATA磁盘组状态是mount,查看磁盘权限
[grid@rac1 ~]$ ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Feb 4 12:58 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Feb 4 12:58 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Feb 4 12:58 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Feb 4 09:39 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8, 80 Feb 4 09:41 /dev/asm-diskf
查看oracle执行文件权限
[root@rac2 dev]# su - oracle
[oracle@rac2 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/bin/
[oracle@rac2 bin]$ ll sqlplus
-rwxr-x--x 1 oracle oinstall 9023 Feb 3 23:39 sqlplus
[oracle@rac2 bin]$ ll oracle
-rwsr-s--x 1 oracle oinstall 239945816 Feb 4 00:12 oracle
oracle执行文件权限是正确的:6751
但是oracle执行文件的属组是oinstall,磁盘的属组是asmadmin,没有磁盘的访问权限,解决方法就是更改oracle可执行文件的属组:
[oracle@rac2 ~]$ chown oracle:asmadmin $ORACLE_HOME/bin/oracle
[oracle@rac2 ~]$ chmod 6751 $ORACLE_HOME/bin/oracle
[oracle@rac2 ~]$ ssh rac1
Last login: Thu Feb 4 13:14:43 2021 from 172.16.11.153
[oracle@rac1 ~]$ chown oracle:asmadmin $ORACLE_HOME/bin/oracle
[oracle@rac1 ~]$ chmod 6751 $ORACLE_HOME/bin/oracle
再次恢复控制文件成功,至此,问题解决。
问题分析:
为什么打补丁之前没有出现这个问题,打补丁之后出现了?
在安装oracle soft之后:
$ORACLE_HOME/bin/oracle文件属性权限为oracle:oninstall 751(-rwxr-x–x)
在用安装ASM建库(DBCA)时:
此文件属性会自动被修改为oracle:asmadmin6751(-rwsr-s–x)
在PSU apply之后:
此文件属性又被自动被修改为oracle:oinstall751(-rwxr-x–x)