直接修改ASM disk大小導致ORA-15036

myownstars發表於2013-05-16
ASM disk group mount fails with ORA-15036: disk  is truncated [ID 1077175.1]
Version 10.2.0.1 to 11.2.0.1

症狀:
載入磁碟組時遭遇如下錯誤
ORA-15032: not all alterations performed
ORA-15036: disk 'ORCL:DATA10' is truncated
ORA-15036: disk 'ORCL:DATA09' is truncated
此為在OS直接resize磁碟組,導致實際大小與metadata記錄不符所致

大致思路
檢視metadata記錄和磁碟實際大小,透過kfed修改metadata;

步驟
確認導致問題的磁碟資訊
ls -l /dev/oracleasm/disks/*
brw-rw---- 1 oracle dba 8, 161 Mar 14 11:25 DATA09
brw-rw---- 1 oracle dba 8, 177 Mar 14 11:25 DATA10

檢查其磁碟組metadata
$ kfed read /dev/oracleasm/disks/DATA09 | egrep "dskname|dsksize"
kfdhdb.dskname: DATA09 ; 0x028: length=6
kfdhdb.dsksize: 65530 ; 0x0c4: 0x0000fffa
$ kfed read /dev/oracleasm/disks/DATA10 | egrep "dskname|dsksize"
kfdhdb.dskname: DATA10 ; 0x028: length=6
kfdhdb.dsksize: 65530 ; 0x0c4: 0x0000fffa
確認其記錄大小為65530M

檢查磁碟實際大小
透過major/minor id獲取磁碟名
# ls -l /dev/sd* | egrep "8, 161|8, 177"
brw-rw---- 1 root disk 8, 161 Mar 14 11:25 sdk1
brw-rw---- 1 root disk 8, 177 Mar 14 11:25 sdl1
透過fdisk檢查其大小,為61530M
# fdisk -l /dev/sdk
Disk /dev/sdk: 68.7 GB, 68719476736 bytes
255 heads, 63 sectors/track, 8354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdk1 1 7844 63006898+ 83 Linux
# fdisk -l /dev/sdl
Disk /dev/sdl: 68.7 GB, 68719476736 bytes
255 heads, 63 sectors/track, 8354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdl1 1 7844 63006898+ 83 Linux


修改磁碟組metadata
$ kfed read /dev/oracleasm/disks/DATA09 > /tmp/DATA09_header.kfed
將kfdhdb.dsksize: 65530 ; 0x0c4: 0x0000fffa
修改為
kfdhdb.dsksize: 61530 ; 0x0c4: 0x0000f05a
更新磁碟組
$ kfed merge /dev/oracleasm/disks/DATA09 text=/tmp/DATA09_header.kfed


載入磁碟組並resize
SQL> alter diskgroup DG1 resize disk DATA09 size 61530 M;
SQL> alter diskgroup DG1 resize disk DATA10 size 61530 M;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-761277/,如需轉載,請註明出處,否則將追究法律責任。

相關文章