oracle 11g新特性-asm磁盘组检查

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:470

oracle 11g新特性-磁盘组检查

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

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】