AIX PVID能不能用作ASM磁盘

好几次遇到这个问题,这次又遇到,就在这里总结一下,供大家参考。

在AIX系统中,给磁盘分配PVID以后,如果这些磁盘被用作Oracle ASM Diskgroup,那么当系统重启后可能导致ASM磁盘被破坏,数据丢失。导致这个问题的原因很简单:

When the PVID is set to a disk in a volume group, the PVID is stored in two locations. In Physical disk header ( within first 4K )and in AIX’s system object database, called ODM ( Object Data Manager ).

When the diskgroup is created, the disk header information of PVID is overwritten. However, with reboot the OS, from ODM, AIX might try to restore the PVID information onto the disk header,
there by destroying the ASM metadata.

解释过来就是:
磁盘组被创建的时候,磁盘中的PVID信息会被Oracle ASM作为磁盘头,也就是metadata重写掉。这对于Oracle ASM来说,是一贯的动作,对于所有加入磁盘组的磁盘都是同等对待的。问题出在重启以后,AIX的ODM会试图去检测并恢复磁盘头上的PVID信息。这样就导致磁盘头上重要的ASM metadata信息丢失,ASM中的数据丢失。

问题的解决方法在Oracle Notes750016.1中有详细描述。
Corrective Action for ASM Diskgroup with Disks Having PVIDs on AIX (Doc ID 750016.1)

If the ASM disk header Metadata has not been over written by PVID from ODM ( before a reboot ), then you can follow the following steps to update the ODM not to have PVID for the disks:

1] Do not reboot any node.

1.1] Drop one disk at a time from the diskgroup.

1.2] Clear the PVID of the dropped disk

# chdev -l hdisk5 -a pv=clear

Run this on ALL the nodes in case of RAC.

1.3] Check the disk does not have the PVID from ALL the nodes

# lspv

1.4] Add the disk back to the diskgroup

1.5] Do this for all the disks having PVID in the diskgroup, one by one. Take care that the rebalance is complete from the drop/add disk command before going for the next disk.

OR

2] This needs downtime:

2.1] Take ‘dd’ backup of the disk headers

# dd if=/dev/hdisk5 of=/tmp/d5.txt bs=1024 count=1024

2.2] Shutdown ASM instance ( on ALL the nodes in RAC setup ).

2.3] Clear the PVID

# chdev -l hdisk5 -a pv=clear

Run this on ALL the nodes in case of RAC.

2.4] Check the disk does not have the PVID from ALL the nodes

# lspv

2.5] Start the ASM Instance(s) and mount the diskgroup on ALL the nodes

WARNING:
Point-2 commands overrides the content of the disk header and so could be destructive if not correctly used. If you have any doubt, raise an SR with Oracle Support before any action.

This entry was posted in 数据库 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *