星期四, 6月 15, 2017

[轉載] ASM Disk Header 備份與還原

Ref:

--
1. dd備份恢復

備份voting disk:
dd if=/dev/raw/raw3 of=/tmp/votedisk_lhr.bak bs=1024k count=4
恢復voting disk
dd if=/tmp/votedisk_lhr.bak of=/dev/raw/raw3 bs=1024k count=4

註:Oracle  11g 不推薦使用dd來進行ASM Header備份恢復,而改採用MD_Backup/ MD_restore指令進行 ;  ASM Disk Header一般是前4K

2. kfed恢復ASM Disk Header

dd if=/dev/rhdisk2 of=/asm_rhdisk2_dd.bak bs=1024 count=4
dd if=/dev/zero of=/dev/rhdisk2 bs=1024 count=4
kfed repair /dev/rhdisk2
關於kfedkfodamdu的更多內容可以參考:http://blog.itpub.net/26736162/viewspace-1694198/

3. md_backupmd_restore ASM Disk Header (11g 以後可以透過md_backup方式來備份ASM disk header)


asmcmd md_backup /oracle/app/11.2.0/tmp/asm_md_backup.bak

#坊間謠傳ASM Disk Header4K , 請在您的test environment實際測試過
dd if=/dev/rhdisk2 of=/asm_rhdisk2_dd.bak bs=1024k count=4
dd if=/dev/zero of=/dev/rhdisk2 bs=1024k count=4
crsctl stop has -f
crsctl start has
ASMCMD [+] > startup force nomount;
ASMCMD [+] > md_restore /oracle/app/11.2.0/tmp/asm_md_backup.bak

4.如果原本ASM DiskGroup是NORMAL Redunancy, 那麼單一disk corruption或壞掉, 可以透過以下方式修回:

@db1, db2
crsctl stop crs -f

@db1
crsctl start crs -excl -nocrs
dd if=/dev/zero of=/dev/mapper/votingdisk bs=1m count=10240
sqlplus / as sysasm
SQL> alter diskgroup VOTING add disk '/dev/mapper/votingdisk' force;
crsctl stop crs -f

@db1, db2
crsctl start crs


關於md_backupmd_restore更多測試內容可以參考:http://blog.itpub.net/26736162/viewspace-2121309/

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...