11.2單例項ASM啟動報錯ORA-15186

yangtingkun發表於2012-01-22

客戶安裝了一個Oracle 11.2.0.2 for Linux X64環境,使用了ASM方式,重啟後發現資料庫沒有啟動。

 

 

檢查作業系統程式,發現ASM已經啟動,CLUSTER環境也啟動完成,但是資料庫並未啟動,嘗試手工啟動資料庫,報錯找不到對應的SPFILE

登入ASM例項,查詢發現找不到任何的ASM磁碟組資訊:

[grid@rptdb trace]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Tue Dec 20 18:41:41 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> select * from v$asm_diskgroup;

no rows selected

查詢V$ASM_DISK可以看到磁碟資訊,但是磁碟頭的頭狀態是UNKNOWN

SQL> SELECT GROUP_NUMBER, DISK_NUMBER, MOUNT_STATUS, HEADER_STATUS, PATH FROM V$ASM_DISK;

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU PATH
------------ ----------- ------- ------------ ----------------------------------
           0           1 CLOSED  UNKNOWN      ORCL:FRAVOL
           0           0 CLOSED  UNKNOWN      ORCL:DATAVOL

顯然Oracle並沒有去載入磁碟組,利用當前ASMSPFILE生成PFILE後發現,只有最基本的引數:

*.asm_power_limit=1
*.diagnostic_dest='/u01/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'

ASM_DISKGROUPS引數都沒有,難怪查詢V$ASM_DISKGROUP找不到任何資料,新增下面的引數:

asm_diskgroups='DATA','FRA'
asm_diskstring='ORCL:*VOL'

重啟ASM例項,在載入磁碟組時報錯:

[grid@rptdb ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Tue Dec 20 18:25:03 2011

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> shutdown immediate
ORA-15100: invalid or missing diskgroup name

ASM instance shutdown
SQL> startup pfile=/home/grid/init+ASM.ora
ASM instance started

Total System Global Area  283930624 bytes
Fixed Size                  2225792 bytes
Variable Size             256539008 bytes
ASM Cache                  25165824 bytes
ORA-15032: not all alterations performed
ORA-15017: diskgroup "FRA" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "FRA"
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"

導致這個錯誤的原因有很多,比如許可權,多路徑設定,儲存設定等等,檢查告警日誌尋找進一步的資訊:

Tue Dec 20 18:25:47 2011
* instance_number obtained from CSS = 1, checking for the existence of node 0...
* node 0 does not exist. instance_number = 1
Starting ORACLE instance (normal)
****************** Huge Pages Information *****************
Huge Pages memory pool detected (total: 42000 free: 42000)
DFLT Huge Pages allocation successful (allocated: 0)
***********************************************************
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/grid/product/11.2.0/grid/dbs/arch
Autotune of undo retention is turned on.
IMODE=BR
ILAT =0
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Automatic Storage Management option.
Using parameter settings in client-side pfile /home/grid/init+ASM.ora on machine rptdb
System parameters with non-default values:
  large_pool_size          = 12M
  instance_type            = "asm"
  remote_login_passwordfile= "EXCLUSIVE"
  asm_diskstring           = "ORCL:*VOL"
  asm_diskgroups           = "DATA"
  asm_diskgroups           = "FRA"
  asm_power_limit          = 1
  diagnostic_dest          = "/u01/app/grid"
Tue Dec 20 18:25:48 2011
PMON started with pid=2, OS id=14718
Tue Dec 20 18:25:48 2011
PSP0 started with pid=3, OS id=14722
Tue Dec 20 18:25:49 2011
VKTM started with pid=4, OS id=14726 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Tue Dec 20 18:25:49 2011
GEN0 started with pid=5, OS id=14732
Tue Dec 20 18:25:49 2011
DIAG started with pid=6, OS id=14736
Tue Dec 20 18:25:49 2011
DIA0 started with pid=7, OS id=14740
Tue Dec 20 18:25:49 2011
MMAN started with pid=8, OS id=14744
Tue Dec 20 18:25:49 2011
DBW0 started with pid=9, OS id=14748
Tue Dec 20 18:25:49 2011
LGWR started with pid=10, OS id=14752
Tue Dec 20 18:25:49 2011
CKPT started with pid=11, OS id=14756
Tue Dec 20 18:25:49 2011
SMON started with pid=12, OS id=14760
Tue Dec 20 18:25:49 2011
RBAL started with pid=13, OS id=14764
Tue Dec 20 18:25:49 2011
GMON started with pid=14, OS id=14768
Tue Dec 20 18:25:49 2011
MMON started with pid=15, OS id=14772
Tue Dec 20 18:25:49 2011
MMNL started with pid=16, OS id=14776
ORACLE_BASE not set in environment. It is recommended
that ORACLE_BASE be set in the environment
Tue Dec 20 18:25:49 2011
SQL> ALTER DISKGROUP ALL MOUNT
NOTE: Diskgroups listed in ASM_DISKGROUPS are
         DATA
         FRA
NOTE: cache registered group DATA number=1 incarn=0x157c40a1
NOTE: cache began mount (first) of group DATA number=1 incarn=0x157c40a1
NOTE: cache registered group FRA number=2 incarn=0x158c40a2
NOTE: cache began mount (first) of group FRA number=2 incarn=0x158c40a2
NOTE: Loaded library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so
ORA-15186: ASMLIB error function = [asm_open(global)],  error = [1],  mesg = [Operation not permitted]
ORA-15025: could not open disk "ORCL:DATAVOL"
ORA-15186: ASMLIB error function = [asm_open(global)],  error = [1],  mesg = [Operation not permitted]
ORA-15025: could not open disk "ORCL:FRAVOL"
ERROR: no PST quorum in group: required 2, found 0
NOTE: cache dismounting (clean) group 1/0x157C40A1 (DATA)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0x157C40A1 (DATA)
NOTE: cache ending mount (fail) of group DATA number=1 incarn=0x157c40a1
NOTE: cache deleting context for group DATA 1/0x157c40a1
GMON dismounting group 1 at 2 for pid 17, osid 14779
ERROR: diskgroup DATA was not mounted
ERROR: no PST quorum in group: required 2, found 0
NOTE: cache dismounting (clean) group 2/0x158C40A2 (FRA)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 2/0x158C40A2 (FRA)
NOTE: cache ending mount (fail) of group FRA number=2 incarn=0x158c40a2
NOTE: cache deleting context for group FRA 2/0x158c40a2
GMON dismounting group 2 at 4 for pid 17, osid 14779
ERROR: diskgroup FRA was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "FRA" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "FRA"
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"
ERROR: ALTER DISKGROUP ALL MOUNT

這裡發現了ORA-15186ORA-15025錯誤。而ORA-15186錯誤發生在ASMLIB呼叫上,根據這個錯誤更容易定位到問題的原因。

MOS上,有專門的文章描述這個問題:Mount ASM Disk Group Fails : ORA-15186, ORA-15025, ORA-15063 [ID 1384504.1],根據問題描述,導致這個錯誤的原因是多路徑的配置存在問題:

[grid@rptdb ~]$ /etc/init.d/oracleasm listdisks
DATAVOL
FRAVOL
[grid@rptdb ~]$ cat /proc/partitions
major minor  #blocks  name

   8     0  285155328 sda
   8     1     104391 sda1
   8     2  285049327 sda2
   8    16 1073741824 sdb
   8    17  322119283 sdb1
   8    18  429497775 sdb2
   8    19  322119315 sdb3
   8    32 1073741824 sdc
   8    33  322119283 sdc1
   8    34  429497775 sdc2
   8    35  322119315 sdc3
   8    48 1073741824 sdd
   8    49  322119283 sdd1
   8    50  429497775 sdd2
   8    51  322119315 sdd3
   8    64 1073741824 sde
   8    65  322119283 sde1
   8    66  429497775 sde2
   8    67  322119315 sde3
 253     0  150896640 dm-0
 253     1  134119424 dm-1
 253     2 1073741824 dm-2
 253     3  322119283 dm-3
 253     4  429497775 dm-4
 253     5  322119315 dm-5
[grid@rptdb ~]$ ls -l /dev/oracleasm/disks
total 0
brw-rw---- 1 grid oinstall 8, 18 Dec 20 17:42 DATAVOL
brw-rw---- 1 grid oinstall 8, 19 Dec 20 17:42 FRAVOL

可以看到,DATAVOLFRAVOL沒有對應到多路徑裝置dm-n上,而是對應到了sdb2sdb3上。

修改/etc/sysconfig/oracleasm檔案,將ORACLEASM_SCANORDER引數和ORACLEASM_SCANEXCLUDE修改如下:

ORACLEASM_SCANORDER="mpath dm"
ORACLEASM_SCANEXCLUDE="sd"

修改後重啟伺服器,由於ASM中的SPFILE還是存在問題的,所以先關閉,然後重新啟動:

[grid@rptdb ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Tue Dec 20 19:05:33 2011

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

Connected.
SQL> shutdown abort
ASM instance shutdown
SQL> startup pfile=/home/grid/init+ASM.ora
ASM instance started

Total System Global Area  283930624 bytes
Fixed Size                  2225792 bytes
Variable Size             256539008 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

SQL> create spfile='+DATA' from pfile='/home/grid/init+ASM.ora';

File created.

磁碟組已經順利啟動,建立一個SPFILE檔案,確保下次ASM自動啟動可以載入磁碟組。切換到Oracle使用者開啟資料庫:

[root@rptdb ~]# su - oracle
[oracle@rptdb ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Dec 20 19:06:27 2011

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 6.4939E+10 bytes
Fixed Size                  2242560 bytes
Variable Size            3.0467E+10 bytes
Database Buffers         3.4360E+10 bytes
Redo Buffers              109195264 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

資料庫順利開啟,最後檢查一下ASM磁碟的設定:

[oracle@rptdb ~]$ ls -l /dev/oracleasm/disks
total 0
brw-rw---- 1 oracle oinstall 253, 4 Dec 20 19:00 DATAVOL
brw-rw---- 1 oracle oinstall 253, 5 Dec 20 19:00 FRAVOL
[oracle@rptdb ~]$ cat /proc/partitions
major minor  #blocks  name

   8     0  285155328 sda
   8     1     104391 sda1
   8     2  285049327 sda2
   8    16 1073741824 sdb
   8    17  322119283 sdb1
   8    18  429497775 sdb2
   8    19  322119315 sdb3
   8    32 1073741824 sdc
   8    33  322119283 sdc1
   8    34  429497775 sdc2
   8    35  322119315 sdc3
   8    48 1073741824 sdd
   8    49  322119283 sdd1
   8    50  429497775 sdd2
   8    51  322119315 sdd3
   8    64 1073741824 sde
   8    65  322119283 sde1
   8    66  429497775 sde2
   8    67  322119315 sde3
 253     0  150896640 dm-0
 253     1  134119424 dm-1
 253     2 1073741824 dm-2
 253     3  322119283 dm-3
 253     4  429497775 dm-4
 253     5  322119315 dm-5

調整oracleasm的配置後,多路徑的配置恢復正常。

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-715173/,如需轉載,請註明出處,否則將追究法律責任。

相關文章