asm(aix) 小记

一、asm(aix) 环境下disk操作注意事项
对于asm for aix环境,我们知道,通常是不建议保留pvid的,一般来说在创建asm磁盘组之前都将pvid clear,
可以使用如下命令:

chdev -l hdisk4 -a pv=clear

如果是rac环境,那么所有节点都需要执行。如果说你不知道,那么使用了pvid,创建了asm磁盘组,那么就不能随便动了,
搞不好会导致asm disk header损坏的。

为什么说可能会损坏磁盘头呢?因为系统重启以后,由于ODM的缘故,系统会自动
去写pvid,进而导致asm disk header损坏。

oracle metalink提供了2个方式处理这种情况:

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

二. 迁移ocr和votedisk

1. 添加PVID

chdev -l hdisk14 -a pv=yes
chdev -l hdisk15 -a pv=yes

2. 修改hdisk属性

chdev -l hdisk14 -a reserve_policy=no_reserve
chdev -l hdisk15 -a reserve_policy=no_reserve

3. 修改权限

chown root:oinstall /dev/rhdisk14
chmod 0640 /dev/rhdisk14

chown oracle:oinstall /dev/rhdisk15
chmod 0644 /dev/rhdisk15


对于hdisk的操作属性更改和权限操作在两个节点都需要执行.

4. 添加OCR 镜像

使用root进行操作:

# ./ocrconfig -replace ocrmirror /dev/rhdisk14

5. 检查ocr情况

# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    2096812
         Used space (kbytes)      :       3804
         Available space (kbytes) :    2093008
         ID                       :  265093485
         Device/File Name         : /dev/rcrslv
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/rhdisk14
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded


6. 添加votedisk

# ./crsctl add css votedisk /dev/rhdisk15 -force
Now formatting voting disk: /dev/rhdisk15
successful addition of votedisk /dev/rhdisk15.

# ./crsctl query css votedisk
 0.     0    /dev/rvotelv
 1.     0    /dev/rhdisk15

located 2 votedisk(s).
#

7. 删除lv中的ocr

# ./ocrconfig -replace ocr

# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    2096812
         Used space (kbytes)      :       3804
         Available space (kbytes) :    2093008
         ID                       :  265093485
         Device/File Name         : /dev/rhdisk14
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

可以发现,lv上的ocr已经被删除。

8. 删除lv中的votedisk

# ./crsctl delete css votedisk /dev/rvotelv -force
successful deletion of votedisk /dev/rvotelv.

# ./crsctl query css votedisk
 0.     0    /dev/rhdisk15

located 1 votedisk(s).
#

9. 更新另外节点的/etc/oracle/ocr.loc

原内容:
ocrconfig_loc=/dev/rcrslv
local_only=FALSE
#

修改为如下:
ocrconfig_loc=/dev/rhdisk14
local_only=FALSE

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注