如何正確地將PVID從ASM磁盤頭部除去

ASM磁盤元數據存放於磁盤頭部,主要包含以下重要內容:

    The disks that belong to a disk group
    The amount of space that is available in a disk group
    The filenames of the files in a disk group
    The location of disk group data file extents
    A redo log that records information about atomically changing metadata blocks
    Oracle ADVM volume information

PVID也存放於磁盤頭部,如果對ASMDISK生成PVID,將覆蓋元數據,啓動時候會報錯:

ORA-15063 "diskgroup \"%s\" lacks quorum of %s PST disks; %s found"
or
ORA-15063: ASM discovered an insufficient number of disks for diskgroup s%
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "%" is missing

 

ASM磁盤不需要PVID。如果你的ASMDISK已經有PVID了,怎麼將PVID安全地從磁盤頭部除去呢?看以下文章:

 

In this Document

  Goal
  Solution
  References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.2 [Release 10.1 to 11.2]
IBM AIX on POWER Systems (64-bit)
IBM AIX Based Systems (64-bit)


GOAL

You have created a diskgroup with disks having PVID and the diskgroup is in use. There is no diskgroup metadata corruption reported yet. You now know that ASM Disk should not have PVID as alerted in MetaLink Note 353761.1 

This note will give the steps to clear the PVID of these ASM Disks.

SOLUTION

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 ). 

PVID記錄於兩個位置1)磁盤頭部4K;2)ODM庫中

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. 
創建asmdisk的時候會將PV磁盤頭部的4K覆蓋,但ODM庫中依然保留着PVID信息,如果系統重啓,AIX很可能會將PVID重新寫入磁盤頭部,致使ASM元數據損壞,導致數據庫無法啓動。

可以通過以下兩種方法將已有ASMDISK的PVID去除:


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. 

發佈了50 篇原創文章 · 獲贊 2 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章