1. 程式人生 > >ORA-15025 搭建DG環境,restore controlfile報錯,提示oracle無法使用ASM存儲

ORA-15025 搭建DG環境,restore controlfile報錯,提示oracle無法使用ASM存儲

red over 二階 ora- clas 11.2.0.3 occurred and add

環境說明:

#主庫RAC環境

#備庫RAC環境,操作系統AIX 6.1 數據庫版本11.2.0.3

報錯說明:

#主庫備份控制文件,傳輸至備庫,備庫restore 報錯

本篇文檔,分為兩大階段:第一階段:出現報錯,查詢相關日誌

第二階段:處理報錯,嘗試操作解決問題

第一階段:出現報錯,查詢日誌階段:

#如下操作:

RMAN> restore standby controlfile from ‘/tmp/con.ctl‘;

Starting restore at 03-JUL-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 instance=rac11g770a 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 07/03/2018 19:36:27
RMAN-10038: database session for channel ORA_DISK_1 terminated unexpectedly


#查詢Alert日誌:
NOTE: MARK has subscribed
ORA-15025: could not open disk "/dev/rhdisk6"
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 13: Permission denied

第二階段,解決問題:

#報錯解決過程,經歷了三個階段:ABC,AB都是錯誤的,如果需要快速解決問題,直接看C 最後階段,修改組完事

A:修改進程屬主屬組

chown oracle.asmadmin $ORACLE_HOME/bin/oracle

#查詢如下:發現Oracle進程是oralce .oinstall 屬組,查詢OCR磁盤組所在操作系統層面的ASM磁盤
-bash-4.2# cd /picclife/app/oracle/product/11.2.0/dbhome_1/bin
-bash-4.2# ls -l oracle
-rwsr-s--x 1 oracle oinstall 300820923 Jul 03 15:42 oracle

#ASM磁盤操作系統: 屬組是ASMADMIN ,Oracle沒有這個組,Oracle用戶沒有權限使用ASM磁盤
-bash-4.2# ls -l /dev/rhdisk2
crw-rw---- 1 grid asmadmin 13, 3 Jul 03 19:26 /dev/rhdisk2

#直接修改Oracle進程,屬組為asmadmin
-bash-4.2# chown oracle:asmadmin oracle
-bash-4.2# ls -l oracle
-rwsr-s--x 1 oracle asmadmin 300820923 Jul 03 15:42 oracle

#使用SQLPLUS 報錯--- 提示組ID不對
ORA-27140: attach to post/wait facility failed
ORA-27300: OS system dependent operation:invalid_egid failed with status: 1
ORA-27301: OS failure message: Not owner
ORA-27302: failure occurred at: skgpwinit6
ORA-27303: additional information: startup egid = 501 (oinstall), current egid = 503 (asmadmin)

#修改Oracle進程權限,還原操作
-bash-4.2# chmod 6755 oracle
-bash-4.2# ls -l oracle
-rwsr-sr-x 1 oracle asmadmin 300820923 Jul 03 15:42 oracle

-bash-4.2# ls -l oracle
-rwsrwsr-x 1 oracle asmadmin 300820923 Jul 03 15:42 oracle
-bash-4.2# chown oracle.oinstall oracle
#修改進程的屬主屬組,不太安全,直接對Oracle用戶進行添加屬組:

B:對Oracle用戶添加asmadmin組

chgroup users=oracle asmadmin

--通過此命令修改後,出現大坑

-bash-4.2# chgroup users=oracle asmadmin
-bash-4.2# id oracle
uid=501(oracle) gid=501(oinstall) groups=503(asmadmin),502(dba),504(asmdba)

#重啟庫,使用restore 可以發現,解決了ORACLE 用戶,可以使用ASM存儲的目的

RMAN> restore standby controlfile from ‘/tmp/con.ctl‘;

rac11g770a:/picclife/app/grid$ id oracle
uid=501(oracle) gid=501(oinstall) groups=503(asmadmin),502(dba),504(asmdba)
rac11g770a:/picclife/app/grid$ id grid
uid=502(grid) gid=501(oinstall) groups=502(dba),504(asmdba),505(asmoper)

#重啟庫後,發現集群狀態不太對

GRID: asmcmd --連接 發現ASMCMD 無法使用,sqlplus / as sysasm --沒有權限!!!!!!!!!!

[grid@rac1 ~]$ . oraenv

ORACLE_SID = [+ASM1] ?

The Oracle base remains unchanged with value /u01/app/oracle

[grid@rac1 ~]$ asmcmd
Connected to an idle instance.
ASMCMD> ls
ASMCMD-8102: no connection to ASM; command requires ASM to run

#查詢集群狀態:
-bash-4.2# while true ; do /picclife/app/11.2.0/grid/bin/crsctl stat res -t -init ; sleep 1; done

ora.asm
1 ONLINE OFFLINE
ora.cluster_interconnect.haip
1 ONLINE ONLINE rac11g770a
ora.crf
1 ONLINE ONLINE rac11g770a
ora.crsd
1 ONLINE OFFLINE
ora.cssd
1 ONLINE ONLINE rac11g770a
ora.cssdmonitor
1 ONLINE ONLINE rac11g770a
ora.ctssd
1 ONLINE ONLINE rac11g770a OBSERVER
ora.diskmon
1 OFFLINE OFFLINE
ora.drivers.acfs
1 ONLINE ONLINE rac11g770a
ora.evmd
1 ONLINE INTERMEDIATE rac11g770a ---非常不正常, ASM CRSD服務均未啟動!!!!

#對集群進行啟動、停止,嘗試,查詢集群各種日誌,均為得到明顯的ORA報錯


C:對用戶屬組進行修改:使用命令Usermod

###中午睡了一覺,狀態OK後,查詢用戶,發現一個驚奇的特點:差點以為眼花了!!!

Grid: 操作系統用戶,屬組asmadmin 組消失了!!!!!!!

-bash-4.2# id grid
uid=502(grid) gid=501(oinstall) groups=502(dba),504(asmdba),505(asmoper)

-bash-4.2# id oracle
uid=501(oracle) gid=501(oinstall) groups=502(dba),503(asmadmin),504(asmdba)

#對Grid用戶的屬組進行添加

-bash-4.2# usermod -G asmadmin grid --對於此命令 -G 需要所有的組都添加
-bash-4.2# id grid
uid=502(grid) gid=501(oinstall) groups=503(asmadmin)
-bash-4.2# id oracle
uid=501(oracle) gid=501(oinstall) groups=502(dba),504(asmdba)


-bash-4.2# usermod -G dba,asmdba,asmoper,asmadmin grid
-bash-4.2# usermod -G dba,asmdba,asmoper,asmadmin oracle

#對集群進行重啟:
rac11g770a:/picclife/app/11.2.0/grid/bin$ ./crsctl stop has -f
#rac11g770a:/picclife/app/11.2.0/grid/bin$ ./crsctl stop crs -f
rac11g770a:/picclife/app/11.2.0/grid/bin$ crsctl start has
rac11g770a:/picclife/app/11.2.0/grid/bin$ crsctl start crs
rac11g770a:/picclife/app/11.2.0/grid/bin$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

#查詢用戶
-bash-4.2# id oracle
uid=501(oracle) gid=501(oinstall) groups=503(asmadmin),502(dba),504(asmdba),505(asmoper)
-bash-4.2# id grid
uid=502(grid) gid=501(oinstall) groups=503(asmadmin),502(dba),504(asmdba),505(asmoper)

OK!!!!!

ORA-15025 搭建DG環境,restore controlfile報錯,提示oracle無法使用ASM存儲