AIX平台下磁盘的PVID对ASM磁盘的破坏

    这篇文章将通过两篇MOS文章来讨论AIX平台下为磁盘分配PVID对ASM磁盘的破坏。

文章一:
   这篇文章说明的是对一个存在的ASM磁盘分配PVID将破坏ASM的磁盘头,导致ASM磁盘组无法正常MOUNT。

Assigning a Physical Volume ID (PVID) To An Existing ASM Disk Corrupts the ASM Disk Header (文档 ID 353761.1)
修改时间:2013-4-19类型:ALERT

In this Document

Description
Occurrence
Symptoms
Workaround
History
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.3 [Release 10.1 to 11.2]
IBM AIX on POWER Systems (64-bit)
***Checked for relevance on 30-Apr-2010***

AIX5L Based Systems (64-bit)

DESCRIPTION

Assigning a Physical Volume ID (PVID) to an existing ASM disk will destroy the ASM disk header rendering the
ASM disk unusable.

Various documents including the 10gR1 and 10gR2 installation instructions for AIX platforms suggest to assign
a PVID to disks to be used for ASM using the following command:
  

  # /usr/sbin/chdev -l hdiskn -a pv=yes

These documents furthermore suggest that this command is to be run on ALL nodes of a RAC cluster. This
does not present a problem as long as the disks have not yet been used by ASM. If however the disk are 
already in use and above command is issued against an ASM disk the file header will be destroyed. 
This is likely to happen if a new node is added to an existing RAC cluster as the documentation seems
to imply this has to be done on all nodes.

To check if a device has an associated PVID , use lspv:
EXAMPLE:

# lspv

hdisk0 0003286f04bc73ee rootvg active
hdisk1 0003286f867d77e1 rootvg active
hdisk2 0003286fb3470dae vg01 active
hdisk3 0003286fb3474190 vg01 active
hdisk4 0003286fb34747d1 vg01 active
hdisk5 0003286fb3474dff vg01 active
hdisk6 0003286fb3475428 vg01 active
hdisk7 0003286fb347607d vg01 active
hdisk8 0003286fb34766f3 vg01 active
hdisk9 0003286fb3476d70 vg01 active
hdisk10 0003286fb34773d5 vg01 active
hdisk11 0003286fb34780b8 vg01 active
hdisk12 0003286fb347872f vg01 active
hdisk13 0003286fb347940c vg01 active
hdisk14 0003286fb3479a7b vg01 active

The second column is the PVID.

OCCURRENCE

This is more likely to happen in a RAC environment, specifically if a new node is added to an existing
cluster.

SYMPTOMS

If the 'chdev' command is run while ASM instances have the disk mounted nothing will be noticed immediately 
as the disk header is only read when the disk is mounted. If however the diskgroup is unmounted and re-mounted
(e.g. ASM instance restart) the disk is no longer recognized as an ASM disk and the diskgroup mount will fail
with 
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

WORKAROUND

Do not assign a PVID to ASM disks, contrary to the documentation PVIDs are not required for ASM disks 
as ASM uses the ASM disk header to discover it's disks. 
This has been addressed in (Documentation)  Bug 3636335 which states:

       "This is a doc. bug and we are going to clearly document not to put PVIDs on
        disks given to ASM. The idea here is that ASM is the one which manages the
        disk and not any OS / vendor volume managers etc., PVIDs are needed for volume
        groups to work. For ASM to work, PVIDs are not needed. ASM has its own headers
        to identify the disk which is what is getting written here. "

As long as there is still an ASM instance which has the disk(group) mounted the 
contents may be backed up via RMAN as soon as possible.

Also the action plan from the Document 750016.1 can be applied. Also recommend to raise an SR with Oracle Support.

HISTORY

 Checked for relevance on 18-APR-2013

REFERENCES

BUG:3636335 - PVID IN DISK HEADER IS OVERWRITTEN AFTER ADDING A NEW DISK TO ASM DISKGROUP
NOTE:750016.1 - Corrective Action for ASM Diskgroup with Disks Having PVIDs on AIX

文章二:
    这篇文章解释了两方面的问题,其一,如果在创建ASM磁盘组之前所属的ASM磁盘就有了PVID,磁盘组创建成功将磁盘头的PVID信息覆盖掉,但由于磁盘的PVID信息会存在磁盘头和ODM库中,服务器一旦重启,AIX会尝试用ODM库中的PVID重新覆盖磁盘头,从而破坏ASM磁盘头。其二,如果出现了上述情况,在没有重启操作系统之前如何清除磁盘的PVID。

Corrective Action for ASM Diskgroup with Disks Having PVIDs on AIX (文档 ID 750016.1)
修改时间:2013-4-7类型:HOWTO

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

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. 

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. 

总结:
    不管是手动还是AIX自动为磁盘分配PVID都将破坏ASM磁盘头,导致ASM磁盘组无法加载。为了避免出现这种情况,我们应该遵守以下的规则:
1).确保在创建ASM磁盘组之前,清除所有节点所有ASM需要使用的磁盘的PVID。
2).磁盘组一旦创建成功,应该避免对ASM磁盘手动分配PVID。
3).磁盘组一旦创建成功,应该手动执行ASMCMD工具下的md_backup命令对磁盘组元数据进行备份。
4).在规划的时候,建议每次磁盘组由两个以上的ASM磁盘组成。

--end--      

时间: 2024-08-03 10:08:19

AIX平台下磁盘的PVID对ASM磁盘的破坏的相关文章

Oracle数据库实例在AIX 平台下使用大页内存(Large Page Memory)

        不管是AIX平台还是在Linux平台使用大页内存(Large Page Memory)都是依赖于操作系统的特性.Linux平台和AIX平台默认的页面大小都是4K,Linux平台的HugePage特性通常每个页面可以调整为2M:AIX平台的Large Page Memory使得单个页面最大可以调整为16M:下面详细讨论在AIX平台下,Oracle数据库实例使用64K和16M两种规格的内存页面,主要讨论的是16M的内存页面. 1.使用64K内存页面在oracle用户的PROFILE文

ASM 无法发现候选磁盘组----丢失的ASM磁盘组 ASM的磁盘组无法挂载

近日遇到一个问题,ASM的磁盘组无法挂载,之前是正常的,由于一些其他的操作,数据库启动失败,当问题排除时候,发现在数据库整体启动时,挂载磁盘组的环节出现问题. 环境介绍 ######################################### 硬件:Vmware ESX虚拟机 OS: Red hat linux 5 Oracle version: 11.2.0.2 ASM disk是通过 asmlib挂载的 这个磁盘组只有一个虚拟出的硬盘,是 /dev/sdb1. ##########

ASM 磁盘和目录的管理

ASM磁盘是ASM体系结构的重要组成部分,ASM磁盘由ASM实例来定位.管理,本文主要讲述ASM磁盘组.故障组等等. 一.相关概念 1.ASM 磁盘组 ASM存储管理除了ASM实例之外,最大的组成部分就是ASM磁盘组.一个ASM磁盘组由过多个ASM磁盘组成 一个磁盘组内可以存放多个数据文件,一个数据文件仅仅只能位于一个磁盘组内,不能跨磁盘组 多个数据库可以共享相同的或多个磁盘组 磁盘组的冗余类型可以分为三类:标准冗余,高度冗余,外部冗余 对于已创建的磁盘组,不能够更改其冗余级别,如要更改,需要删

ASM 磁盘 目录 管理

--======================== -- ASM 磁盘.目录的管理 --========================       ASM磁盘是ASM体系结构的重要组成部分,ASM磁盘由ASM实例来定位.管理,本文主要讲述ASM磁盘组.故障组等等.     有关ASM实例及ASM数据库的创建请参考:创建ASM实例及ASM数据库   一.相关概念     1.ASM 磁盘组         ASM存储管理除了ASM实例之外,最大的组成部分就是ASM磁盘组.一个ASM磁盘组由过多

Oracle内核系列-揭秘ASM磁盘头信息

专家简介     马育义 [DBA+社群]广州群副   拥有5年DBA运维经验,精通Oracle数据库管理,深入理解Oracle 体系结构,擅长使用RAC.Dataguard.Goldengate等技术解决Oracle数据库运维故障.精通Oracle数据库安装配置.性能诊断.故障处理.备份解决方案的设计与实施.Oracle OCP认证讲师,在Oracle OCP和OCM的培训方面也有较为丰富的经验,曾多次负责广东移动.深圳航空的DBA培训工作.    1ASM元数据   1.1基础概念    1

揭秘ASM磁盘头信息

第一章  Oracle内核系列3-揭秘ASM磁盘头信息 DBAplus社群 | 2015-12-17 07:00 1ASM元数据 1.1基础概念 1.1.1 ASM File 从10g开始,数据文件的存储除了使用裸设备和文件系统外,还可以存放在ASM中.简单的理解,存放在ASM中的数据文件,日志文件,控制文件,归档日志等等,就是ASM FILE.仅有以下的文件类型可以存放在ASM Diskgroup中: Control File Datafile Temporary data file Onli

不同WINDOWS平台下磁盘逻辑扇区的直接读写

不同WINDOWS平台下磁盘逻辑扇区的直接读写 关键字:VWIN32.中断.DeviceIoControl 一.概述 在DOS操作系统下,通过BIOS的INT13.DOS的INT25(绝对读).INT26(绝对写)等功能调用实现对磁盘逻辑扇区或物理扇区的读写是很方便的,C语言中还有对应上述功能调用的函数:biosdisk.absread和abswrite等.但在WINDOWS操作系统下编写WIN32应用程序时却再也不能直接使用上述的中断调用或函数了.那么,在WINDOWS操作系统下能不能实现磁盘

Vmware server 下为Oracle RAC 添加共享磁盘

    在VMware下的Oracle RAC 环境中,对于共享存储不够或者需要增加新的共享磁盘来配置ocr或votingdisk的多路镜像,我们可以通过vmware下的命令行来增加共享存储,然后将这些新磁盘逐一追加到虚拟机即可.下面给出具体描述.   1.添加虚拟磁盘 #下面我们为虚拟机增加2块共享磁盘 #一块为添加ocr镜像,一块用于补充asm磁盘不够用的情形 C:\Users\robinson.cheng>cd C:\Program Files (x86)\VMware\VMware Se

ASM 翻译系列第三十四弹:ASM磁盘组重要属性介绍

ASM Disk Group Attributes 磁盘组的属性是ASM 11.1版本引入的,是磁盘组层面而非ASM实例层面的.磁盘组的属性有一些只能在创建磁盘组时指定,有一些只能在创建之后指定,还有一些可以在任何时候指定. 本篇内容是对本系列文章-[ASM Attributes Directory]的展开. ACCESS_CONTROL.ENABLED ACCESS_CONTROL.ENABLED属性指定了一个磁盘组的ASM File Access Control是否启用,参数的值可以设置为t