oracle 11g 新特性 磁碟組檢查

paulyibinyi發表於2010-07-23

    oracle 11g開始,asm提供了命令對磁碟組進行檢查,可以檢查磁碟組內的以下內容:

alter diskgroup diskgroupname check;

1.Verify the consistency of the disk

2.Cross-check all the file extent maps and allocation tables for consistency

3.Check whether the alias metadata directory and file directory are linked correctly

4.Check that ASM metadata directories do not have unreachable allocated blocks

以下實驗為:asm磁碟頭丟失,用check檢查後,可以有日誌看到磁碟頭資訊不能正確讀取

[grid@rac2 raw]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 2 09:24:05 2007

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select name,path from v$asm_disk;

TESTDG_0000
/dev/raw/raw1

破壞/dev/raw/raw1磁碟頭資訊

[grid@rac1 ~]$ dd if=/dev/zero f=/dev/raw/raw1 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.017539 seconds, 234 kB/s
[grid@rac1 ~]$

[grid@rac1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 23 10:48:16 2010

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup testdg check;
Diskgroup altered.

這時檢視asm日誌,提示不能讀取/dev/raw/raw1對應的disk name TESTDG_0000 資訊

Fri Jul 23 10:45:05 2010
SQL> alter diskgroup testdg check
ERROR: Could not read the header of disk TESTDG_0000 (0).
NOTE: starting check of diskgroup TESTDG
kfdp_checkDsk(): 18
SUCCESS: check of diskgroup TESTDG found no errors
SUCCESS: alter diskgroup testdg check
(END)

修復磁碟頭資訊後,可以正確讀取

[grid@rac1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 23 10:48:16 2010

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup testdg check;

Diskgroup altered.

Fri Jul 23 10:48:29 2010
SQL> alter diskgroup testdg check
NOTE: starting check of diskgroup TESTDG
kfdp_checkDsk(): 19
SUCCESS: check of diskgroup TESTDG found no errors
SUCCESS: alter diskgroup testdg check

 

 

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

相關文章