ASM使用AIX raw disk的问题
同事在10G DOCS上看到,AIX下如果绕过VG,直接使用裸盘做ASM,当设备的PVID变化时,会引起磁盘组数据丢失
今天晚上做了测试
首先清除掉了hdiskpowerx上的pvid,发现再启动ASM的时候,mount dg出错了,
-清除pvid,lspv显示pvid为none
root@crmg_pri:/>chdev -l hdiskpower12 -a pv=clear
hdiskpower12 changed
root@crmg_pri:/>chdev -l hdiskpower13 -a pv=clear
hdiskpower13 changed
root@crmg_pri:/>chdev -l hdiskpower14 -a pv=clear
hdiskpower14 changed
root@crmg_pri:/>chdev -l hdiskpower15 -a pv=clear
hdiskpower15 changed
-mount diskgroup,报错磁盘不足,盘头信息已经不对了
@>alter diskgroup dg1 mount;
alter diskgroup dg1 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup “DG1″
-查看磁盘头状态,为PROVISIONED
@>select state,mode_status,mount_status,header_status from v$asm_disk;
STATE MODE_STATUS MOUNT_STATUS HEADER_STATUS
―――――- ――――- ――――- ――――――――
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED CANDIDATE
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED PROVISIONED
NORMAL ONLINE CLOSED CANDIDATE
NORMAL ONLINE CLOSED PROVISIONED
这个状态的官方解释:
PROVISIONED - Disk is not part of a disk group and may be added to a disk group with the ALTER DISKGROUP statement.
The PROVISIONED header status is different from the CANDIDATE header status in that PROVISIONED implies
that an additional platform-specific action has been taken by an administrator to
make the disk available for Automatic Storage Management.
意思是现在这个盘,是完全可以作为全新的盘加入到DG的,也就是说ASM已经不认识上面的数据了,只能重用,上面的数据也就丢失了
前面是PVID从有到无的过程,下面再验证下PVID从无到有的过程,先将所有的power lun的PVID清除掉,并创建了DG,可以正常mount
然后给PV生成新的pvid
chdev -l hdiskpower13 -a pv=yes
…
…
-mount出错
@>alter diskgroup dg1 mount;
alter diskgroup dg1 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk “4″ is missing
-ASM disk状态已经改变
@>select state,mode_status,mount_status,header_status from v$asm_disk;
STATE MODE_STATUS MOUNT_STATUS HEADER_STATUS
―――――- ――――- ――――- ――――――――
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED CANDIDATE
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED CANDIDATE
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED MEMBER
NORMAL ONLINE CLOSED CANDIDATE
NORMAL ONLINE CLOSED MEMBER
磁盘组数据仍然丢失了
可以看出,在AIX上,直接使用rhdisk,或者rpowerdisk来创建ASM后,一旦PVID有变化,ASM的数据都会丢失的,除非事先已经备份好每个ASM磁盘头的信息,否则修复起来是很困难的,这个是使用AIX raw disk+ASM要注意的
但文档中说的ASM的格式化会破坏磁盘的PVID,当OS重启时,会从ODM库将PVID同步回磁盘,反过来会破坏掉ASM,这个情况经过测试,没有出现
也许是因为上面的测试是在11G里面做的
关于PVID
PVID是用于标识physical volumn的一个标识符,有主板序列+时间戳组成,他的本意是做到这个号码在世界上是唯一的,PVID存在于3个地方,
物理卷的磁盘头
VGDA(如果没做VG,这部分就不存在)
ODM库
PVID最初的源头是在物理磁盘头上,后面两个都是从这里读取的,所以一个LUN如果共享给多个主机使用,每台主机看到的pvid都是一样的
一般在做VG或者手工chdev -l 时,会给盘付上pvid,理论上,上面3个地方的PVID应该是高度一致的,如果人为强行破坏,可能引起数据丢失,
比如VGDA的PVID与磁盘头的PVID信息不一致时,会导致VG不能varyon和import
也有人通过DD的方式手工修改PVID,这些动作都是非常危险的
另外请参考:Doc ID: 750016.1
建议继续学习:
- Oracle ASM存储方式浅析 (阅读:3261)
- ASM装载磁盘组时ORA-15063错误处理 (阅读:2529)
- ASM中如何配置多个控制文件 (阅读:2489)
- ASM的争论 (阅读:2311)
- ASM的争论 (阅读:2276)
- 用ASM和iSCSI实现的另类HA方案 (阅读:1965)
- ASM的优点总结–关于日志文件调整 (阅读:1562)
- ASM HEADER 备份与恢复 (阅读:1503)
扫一扫订阅我的微信号:IT技术博客大学习
- 作者:八神 来源: Alibaba DBA Team
- 标签: ASM
- 发布时间:2009-10-10 18:26:48
- [71] IOS安全–浅谈关于IOS加固的几种方法
- [70] Twitter/微博客的学习摘要
- [65] 如何拿下简短的域名
- [64] android 开发入门
- [63] Go Reflect 性能
- [62] find命令的一点注意事项
- [60] 流程管理与用户研究
- [59] 读书笔记-壹百度:百度十年千倍的29条法则
- [59] 图书馆的世界纪录
- [58] Oracle MTS模式下 进程地址与会话信