當前位置:
首頁 > 知識 > 案例:Oracle報錯ASM磁碟組不存在或沒有mount

案例:Oracle報錯ASM磁碟組不存在或沒有mount

環境:RHEL 6.5 + Oracle Standby RAC 11.2.0.4 我做Standby RAC實驗時,在恢復控制文件時,報錯無法在磁碟組創建文件,具體報錯內容如下:

[oracle@jystdrac1 standby]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 9 22:35:41 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: JYZHAO (not mounted)

RMAN> restore controlfile from "/public/hotback/jyzhao/standby/control_for_standby.ctl";

Starting restore at 09-AUG-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 instance=jyzhao1 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 08/09/2017 22:36:11
ORA-19870: error while restoring backup piece /public/hotback/jyzhao/standby/control_for_standby.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
ORA-15040: diskgroup is incomplete

RMAN> exit

馬上去查磁碟組是否正常mount,結果是正常的:

[root@jystdrac1 ~]# su - grid
[grid@jystdrac1 ~]$ asmcmd
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 15360 15261 0 15261 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 5120 5025 0 5025 0 N FRA/
MOUNTED NORMAL N 512 4096 1048576 3072 2146 1024 561 0 Y OCR/
ASMCMD>

去看資料庫的alert日誌:

Wed Aug 09 22:29:50 2017
NOTE: Loaded library: System
ORA-15025: could not open disk "/dev/asm-diske"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
ORA-15025: could not open disk "/dev/asm-diskf"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
ORA-15025: could not open disk "/dev/asm-diskg"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
Wed Aug 09 22:29:50 2017
SUCCESS: diskgroup DATA was dismounted
ERROR: diskgroup DATA was not mounted
ORA-15025: could not open disk "/dev/asm-diskh"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
SUCCESS: diskgroup FRA was dismounted
ERROR: diskgroup FRA was not mounted

居然說是無法打開asm磁碟,迅速去查asm磁碟情況:

[root@jystdrac1 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Aug 9 22:55 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Aug 9 22:55 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Aug 9 22:55 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Aug 9 22:55 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8, 80 Aug 9 22:11 /dev/asm-diskf
brw-rw---- 1 grid asmadmin 8, 96 Aug 9 22:11 /dev/asm-diskg
brw-rw---- 1 grid asmadmin 8, 112 Aug 9 22:55 /dev/asm-diskh

/dev/asm:
total 0
[root@jystdrac1 ~]# id grid
uid=700(grid) gid=800(oinstall) groups=800(oinstall),700(asmadmin),701(asmdba),702(asmoper)
[root@jystdrac1 ~]# id oracle
uid=800(oracle) gid=800(oinstall) groups=800(oinstall),701(asmdba),801(dba),802(oper)

發現磁碟組許可權沒有問題,grid和oracle用戶的組也都符合官方要求。

拿著alert日誌的關鍵報錯信息「ORA-15025 ORA-27041 Linux-x86_64 Error: 13: Permission denied」去查MOS:

找到一篇MOS匹配:Database Will Not Mount: ORA-15025, ORA-27041, "Permission denied", ORA-15081 (文檔 ID 1378747.1)

最終說是

CAUSE

However the problem is that the Database oracle executable is not assigned to the ASM OSASM group (instead is assigned to the "oinstall" group):

-rwsr-s--x 1 oracle oinstall 210973186 May 31 21:25 /appl/oracle/OracleHomes/11.2.0/bin/oracle

It needs to be:

-rwsr-s--x 1 oracle asmadmin 210973186 May 31 21:25 /appl/oracle/OracleHomes/11.2.0/bin/oracle

按照MOS的說法,去查oracle用戶的這個oracle二進位文件的屬組,果然發現是oinstall:

[root@jystdrac1 ~]# su - oracle
[oracle@jystdrac1 ~]$ cd $ORACLE_HOME/bin/
[oracle@jystdrac1 bin]$ ls -l oracle
-rwsr-s--x 1 oracle oinstall 239626641 Aug 6 00:42 oracle

將其改為MOS說的asmadmin,

As the

ON NODE1:
[root@jystdrac1 bin]# pwd
/opt/app/oracle/product/11.2.0/dbhome_1/bin
[root@jystdrac1 bin]# ls -l oracle
-rwsr-s--x 1 oracle oinstall 239626641 Aug 6 00:42 oracle
[grid@jystdrac1 bin]$ ./setasmgidwrap o=/opt/app/oracle/product/11.2.0/dbhome_1/bin/oracle
[root@jystdrac1 bin]# ls -l oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Aug 6 00:42 oracle

ON NODE2:
[root@jystdrac2 bin]# pwd
/opt/app/oracle/product/11.2.0/dbhome_1/bin
[root@jystdrac2 bin]# ls -l oracle
-rwsr-s--x 1 oracle oinstall 239626641 Aug 6 00:48 oracle
[root@jystdrac2 bin]# chown oracle:asmadmin oracle
[root@jystdrac2 bin]# ls -l oracle
-rwxr-x--x 1 oracle asmadmin 239626641 Aug 6 00:48 oracle
[root@jystdrac2 bin]# chmod 6751 oracle
[root@jystdrac2 bin]# ls -l oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Aug 6 00:48 oracle

如上,兩個節點都需要改正確,我這裡特意演示了兩種方法,在一節點使用MOS推薦的方法修改可以一次成功修改,且能保證不改錯,只是等的時間長。在二節點直接通過操作系統命令修改,速度快,需要確認最終改對。

最後重啟庫再試恢復控制文件:

[oracle@jystdrac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 9 23:16:38 2017

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup nomount pfile=$ORACLE_HOME/dbs/pfile_for_standby.txt
ORACLE instance started.

Total System Global Area 534462464 bytes
Fixed Size 2254952 bytes
Variable Size 436209560 bytes
Database Buffers 92274688 bytes
Redo Buffers 3723264 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[oracle@jystdrac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 9 23:18:28 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: JYZHAO (not mounted)

RMAN> restore controlfile from "/public/hotback/jyzhao/standby/control_for_standby.ctl";

Starting restore at 09-AUG-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 instance=jyzhao1 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
output file name=+DATA/mynas/controlfile/current.256.951607115
output file name=+FRA/mynas/controlfile/current.256.951607123
Finished restore at 09-AUG-17

RMAN>

喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 達人科技 的精彩文章:

關於SQL語句條件值寫中文查不到的問題
sharding-method 介紹
Android面試題目之五:演算法題——嵌套的信封
Redis從單機到集群,一步步教你環境部署以及使用

TAG:達人科技 |

您可能感興趣

安裝Mysql報錯:RSA private key file not found
kali 使用apt-get update報錯GPG error的解決辦法
npm總是報錯:unable to verify the first certificate
IE報錯「Internet Explorer 已停止工作」的解決方法
《第三次世界大戰》game security violation detected報錯解決方法
迷之尷尬,用戶反應Nike Adapt BB自動系帶鞋Android版App報錯
docker pull下載鏡像時的報錯及其解決方法
iphone6S刷機報錯56、iphone6無震動維修、iphone6打電話聽筒雜音大、iphone6無鈴聲
遠離報錯煩惱!深入全面掌握.NET Framework
Office 2007 Word Excel PPT 辦公軟體打開報錯的解決方法分享
python常見的報錯類型
微軟升級病毒庫導致Win7/8.1的Win Defender報錯
一個月前讓SNKRS頻頻「報錯」的Fear Of God又要發售新配了
office2007軟體打開時彈出報錯SETUP ERROR的解決方法
Win10更新再次坑慘老黃 Nvidia顯卡驅動報錯!
微軟正在修復Windows Server無法啟動的0xc0000001報錯故障
新手常見的python報錯及解決方案
徹底解決長列表頁setData超過1M時報錯和嚴重卡頓的問題
Win10安裝NVIDIA驅動報錯:可試試這兩個辦法
NVIDIA確認!賣2萬的TITAN V翻車了:科學運算報錯