11g asm md_backup md_restore
11g asm md_backup md_restore
============================
11g中增加了對asm metadata備份恢復的命令
md_backup
md_restore
命令幫助如下:
ASMCMD [+] > help md_backup
md_backup
[-G '
Perform. ASM metadata backup for disk groups.
Back up into backup file disk group metadata information including
fail groups, disks, attributes, aliases, and templates.
Store information into
-G Disk groups to backup. All diskgroups are backed up by default.
ASMCMD [+] > help md_restore
md_restore
[--full|--nodg|--newdg] [-S
[-G '
[-o '
Perform. ASM Metadata restore for disk groups.
Read metadata information from
--silent Ignore errors. Normally if md_restore encounters an error, it
will stop. Specifying this flag ignores that.
--full create disk group and restore metadata.
--nodg restore metadata only.
--newdg create disk group with a different name and restore
metadata; -o is required.
-S Write SQL commands to
-G Select the disk groups to be restored. If no disk groups defined,
all of them will be restored.
-o Rename disk group
----------------------------------
md_backup
使用比較簡單
第一條命令為備份所有後設資料到指定檔案中
第二天命令新增了-G,可以指定備份特定的磁碟組
md_backup /tmp/asm_meta.bak
md_backup /tmp/asm_meta_DATA.bak -G DATA
----------------------------------
md_restore
使用md_backup備份出的內容,恢復後設資料
相對於備份,恢復的選項稍多
命令可選引數有
--silent 忽略恢復中的錯誤,但一旦出錯恢復將停止
--full 建立磁碟組並回復後設資料
--nodg 僅恢復後設資料
--newdg 建立重新命名的磁碟組,需要和-o一同使用
-S 生成sql語句,不執行命令
-G 指定磁碟組組
-o 重新命名磁碟組
第一條命令使用/tmp/asm_meta.bak重建並回復全部後設資料
第二條命令使用/tmp/asm_meta_DATA.bak重建並恢復磁碟組DATA
第三條命令使用/tmp/asm_meta.bak生成建立磁碟組的sql指令碼
第四條命令使用/tmp/asm_meta_DATA.bak重新建立磁碟組DATA,並重新命名為NEW_DG
md_restore --full /tmp/asm_meta.bak
md_restore --full -G DATA /tmp/asm_meta_DATA.bak
md_restore -S create_oradg.sql /tmp/asm_meta.bak
md_restore --newdg -o DATA:NEW_DG /tmp/asm_meta_DATA.bak
--------------------------------------
ASMCMD [+] > md_backup /tmp/asm_meta.bak
Disk group metadata to be backed up: DATA2
Disk group metadata to be backed up: DATA
Current alias directory path: DB11/TEMPFILE
Current alias directory path: DB11/CONTROLFILE
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: DB11/PARAMETERFILE
Current alias directory path: ASM
Current alias directory path: DB11/DATAFILE
Current alias directory path: DB11
Current alias directory path: DB11/ONLINELOG
ASMCMD [+] > ASMCMD [+] > exit
-bash-3.2$ more /tmp/asm
asm.ora asm_meta.bak
-bash-3.2$ more /tmp/asm_meta.bak
@diskgroup_set = (
{
'DISKSINFO' => {
'FG2' => {
'VOL2' => {
'TOTAL_MB' => '5114',
'FAILGROUP' => 'FG2',
'NAME' => 'VOL2',
'DGNAME' => 'DATA2',
'PATH' => 'ORCL:VOL2'
}
},
'FG1' => {
'VOL1' => {
'TOTAL_MB' => '5114',
'FAILGROUP' => 'FG1',
'NAME' => 'VOL1',
'DGNAME' => 'DATA2',
'PATH' => 'ORCL:VOL1'
}
}
},
'DGINFO' => {
'DGTORESTORE' => 0,
'DGCOMPAT' => '10.1.0.0.0',
'DGNAME' => 'DATA2',
'DGDBCOMPAT' => '10.1.0.0.0',
'DGTYPE' => 'NORMAL',
'DGAUSZ' => '1048576'
},
'ALIASINFO' => {},
'TEMPLATEINFO' => {
'11' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'TEMPFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'7' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'CHANGETRACKING',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'2' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASM_STALE',
'REDUNDANCY' => 'HIGH',
'SYSTEM' => 'Y'
},
'17' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DUMPSET',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'1' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASMPARAMETERFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'18' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASMPARAMETERBAKFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'0' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'PARAMETERFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'16' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'FINE',
'TEMPNAME' => 'CONTROLFILE',
'REDUNDANCY' => 'HIGH',
'SYSTEM' => 'Y'
},
'13' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ONLINELOG',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'6' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'FLASHBACK',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'3' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'OCRBACKUP',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'9' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'AUTOBACKUP',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'12' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DATAFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'14' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ARCHIVELOG',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'15' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'FLASHFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'8' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'XTRANSPORT',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'4' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'OCRFILE',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'10' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'BACKUPSET',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
},
'5' => {
'DGNAME' => 'DATA2',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DATAGUARDCONFIG',
'REDUNDANCY' => 'MIRROR',
'SYSTEM' => 'Y'
}
}
},
{
'ATTRINFO' => {
'TEMPLATE.PARAMETERFILE.MIRROR_REGION' => '0',
'TEMPLATE.TEMPFILE.REDUNDANCY' => '17',
'TEMPLATE.OCRBACKUP.REDUNDANCY' => '17',
'TEMPLATE.TEMPFILE.MIRROR_REGION' => '0',
'TEMPLATE.PARAMETERFILE.REDUNDANCY' => '17',
'SECTOR_SIZE' => '512',
'TEMPLATE.DATAGUARDCONFIG.REDUNDANCY' => '17',
'ACCESS_CONTROL.UMASK' => '066',
'TEMPLATE.ASM_STALE.STRIPE' => '0',
'TEMPLATE.ARCHIVELOG.STRIPE' => '0',
'TEMPLATE.DATAGUARDCONFIG.PRIMARY_REGION' => '0',
'TEMPLATE.OCRBACKUP.STRIPE' => '0',
'TEMPLATE.DATAFILE.STRIPE' => '0',
'AU_SIZE' => '1048576',
'TEMPLATE.ASMPARAMETERFILE.STRIPE' => '0',
'TEMPLATE.CHANGETRACKING.PRIMARY_REGION' => '0',
'TEMPLATE.CONTROLFILE.REDUNDANCY' => '17',
'TEMPLATE.FLASHFILE.STRIPE' => '0',
'TEMPLATE.BACKUPSET.PRIMARY_REGION' => '0',
'TEMPLATE.ARCHIVELOG.PRIMARY_REGION' => '0',
'TEMPLATE.CHANGETRACKING.STRIPE' => '0',
'TEMPLATE.ONLINELOG.PRIMARY_REGION' => '0',
'TEMPLATE.CHANGETRACKING.REDUNDANCY' => '17',
'TEMPLATE.BACKUPSET.STRIPE' => '0',
'TEMPLATE.OCRFILE.MIRROR_REGION' => '0',
'DISK_REPAIR_TIME' => '5h',
'TEMPLATE.FLASHBACK.MIRROR_REGION' => '0',
'TEMPLATE.AUTOBACKUP.REDUNDANCY' => '17',
'TEMPLATE.DUMPSET.REDUNDANCY' => '17',
'TEMPLATE.ASM_STALE.REDUNDANCY' => '17',
'TEMPLATE.DUMPSET.PRIMARY_REGION' => '0',
'TEMPLATE.DUMPSET.MIRROR_REGION' => '0',
'TEMPLATE.FLASHBACK.PRIMARY_REGION' => '0',
'TEMPLATE.CONTROLFILE.STRIPE' => '1',
'TEMPLATE.DATAFILE.REDUNDANCY' => '17',
'TEMPLATE.XTRANSPORT.REDUNDANCY' => '17',
'TEMPLATE.AUTOBACKUP.PRIMARY_REGION' => '0',
'TEMPLATE.CONTROLFILE.MIRROR_REGION' => '0',
'TEMPLATE.DATAFILE.PRIMARY_REGION' => '0',
'TEMPLATE.ASMPARAMETERFILE.REDUNDANCY' => '17',
'TEMPLATE.FLASHFILE.MIRROR_REGION' => '0',
'TEMPLATE.ASM_STALE.MIRROR_REGION' => '0',
'TEMPLATE.FLASHBACK.REDUNDANCY' => '17',
'TEMPLATE.DATAGUARDCONFIG.STRIPE' => '0',
'CELL.SMART_SCAN_CAPABLE' => 'FALSE',
'TEMPLATE_VERSION' => '186646528',
'TEMPLATE.PARAMETERFILE.STRIPE' => '0',
'TEMPLATE.DATAFILE.MIRROR_REGION' => '0',
'TEMPLATE.PARAMETERFILE.PRIMARY_REGION' => '0',
'TEMPLATE.BACKUPSET.MIRROR_REGION' => '0',
'TEMPLATE.OCRBACKUP.MIRROR_REGION' => '0',
'TEMPLATE.ONLINELOG.REDUNDANCY' => '17',
'TEMPLATE.ASMPARAMETERBAKFILE.STRIPE' => '0',
'ACCESS_CONTROL.ENABLED' => 'FALSE',
'TEMPLATE.DATAGUARDCONFIG.MIRROR_REGION' => '0',
'TEMPLATE.TEMPFILE.PRIMARY_REGION' => '0',
'COMPATIBLE.RDBMS' => '11.2.0.0.0',
'TEMPLATE.FLASHFILE.PRIMARY_REGION' => '0',
'TEMPLATE.ONLINELOG.MIRROR_REGION' => '0',
'TEMPLATE.FLASHFILE.REDUNDANCY' => '17',
'TEMPLATE.OCRBACKUP.PRIMARY_REGION' => '0',
'TEMPLATE.OCRFILE.STRIPE' => '0',
'TEMPLATE.ASM_STALE.PRIMARY_REGION' => '0',
'TEMPLATE.AUTOBACKUP.MIRROR_REGION' => '0',
'TEMPLATE.XTRANSPORT.PRIMARY_REGION' => '0',
'TEMPLATE.ASMPARAMETERBAKFILE.PRIMARY_REGION' => '0',
'TEMPLATE.DUMPSET.STRIPE' => '0',
'TEMPLATE.TEMPFILE.STRIPE' => '0',
'TEMPLATE.OCRFILE.PRIMARY_REGION' => '0',
'TEMPLATE.ONLINELOG.STRIPE' => '0',
'TEMPLATE.ARCHIVELOG.REDUNDANCY' => '17',
'TEMPLATE.OCRFILE.REDUNDANCY' => '17',
'TEMPLATE.ARCHIVELOG.MIRROR_REGION' => '0',
'TEMPLATE.ASMPARAMETERFILE.MIRROR_REGION' => '0',
'TEMPLATE.FLASHBACK.STRIPE' => '0',
'TEMPLATE.XTRANSPORT.MIRROR_REGION' => '0',
'TEMPLATE.CONTROLFILE.PRIMARY_REGION' => '0',
'TEMPLATE.BACKUPSET.REDUNDANCY' => '17',
'TEMPLATE.XTRANSPORT.STRIPE' => '0',
'TEMPLATE.ASMPARAMETERBAKFILE.REDUNDANCY' => '17',
'TEMPLATE.CHANGETRACKING.MIRROR_REGION' => '0',
'COMPATIBLE.ASM' => '11.2.0.0.0',
'TEMPLATE.ASMPARAMETERFILE.PRIMARY_REGION' => '0',
'TEMPLATE.ASMPARAMETERBAKFILE.MIRROR_REGION' => '0',
'TEMPLATE.AUTOBACKUP.STRIPE' => '0'
},
'DISKSINFO' => {
'DATA' => {
'DATA' => {
'TOTAL_MB' => '5114',
'FAILGROUP' => 'DATA',
'NAME' => 'DATA',
'DGNAME' => 'DATA',
'PATH' => 'ORCL:DATA'
}
}
},
'DGINFO' => {
'DGTORESTORE' => 0,
'DGCOMPAT' => '11.2.0.0.0',
'DGNAME' => 'DATA',
'DGDBCOMPAT' => '11.2.0.0.0',
'DGTYPE' => 'EXTERN',
'DGAUSZ' => '1048576'
},
'ALIASINFO' => {
'6' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'DB11/TEMPFILE',
'REFERENCE_INDEX' => '33554803'
},
'1' => {
'DGNAME' => 'DATA',
'LEVEL' => 0,
'ALIASNAME' => 'DB11',
'REFERENCE_INDEX' => '33554591'
},
'4' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'DB11/CONTROLFILE',
'REFERENCE_INDEX' => '33554697'
},
'0' => {
'DGNAME' => 'DATA',
'LEVEL' => 0,
'ALIASNAME' => 'ASM',
'REFERENCE_INDEX' => '33554485'
},
'3' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'DB11/PARAMETERFILE',
'REFERENCE_INDEX' => '33554856'
},
'7' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'DB11/DATAFILE',
'REFERENCE_INDEX' => '33554644'
},
'2' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'ASM/ASMPARAMETERFILE',
'REFERENCE_INDEX' => '33554538'
},
'5' => {
'DGNAME' => 'DATA',
'LEVEL' => 1,
'ALIASNAME' => 'DB11/ONLINELOG',
'REFERENCE_INDEX' => '33554750'
}
},
'TEMPLATEINFO' => {
'11' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ONLINELOG',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'7' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'AUTOBACKUP',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'2' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'OCRFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'17' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASMPARAMETERFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'1' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASM_STALE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'18' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'OCRBACKUP',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'0' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'PARAMETERFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'16' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ASMPARAMETERBAKFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'13' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'FLASHFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'6' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'XTRANSPORT',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'3' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DATAGUARDCONFIG',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'9' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'TEMPFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'12' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'ARCHIVELOG',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'15' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DUMPSET',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'14' => {
'DGNAME' => 'DATA',
'STRIPE' => 'FINE',
'TEMPNAME' => 'CONTROLFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'8' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'BACKUPSET',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'4' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'FLASHBACK',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'10' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'DATAFILE',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
},
'5' => {
'DGNAME' => 'DATA',
'STRIPE' => 'COARSE',
'TEMPNAME' => 'CHANGETRACKING',
'REDUNDANCY' => 'UNPROT',
'SYSTEM' => 'Y'
}
}
}
);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13177610/viewspace-714669/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- md_backup
- 通過ORACLE VM virtualbox環境安裝oracle 11G RAC(ASM)OracleASM
- 11g ASM 重啟 HAC 報錯 CRS-4124: Oracle High AvailabilityASMOracleAI
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- goldengate + asm + racGoASM
- gnu inline asminlineASM
- 【ASM】ASM啟動無法找到spfile問題原因ASM
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- ASM叢集檔案系統ACFS(ASM Cluster File System)ASM
- 11g rac新增節點步驟(11g)
- ASM Metadata Dump UtilityASM
- ASM磁碟組限制ASM
- 4.5.1.1 srvctl add asmASM
- Android Transform + ASM 初探AndroidORMASM
- RAC+ASM+DATAGUARDASM
- ASM Fast Mirror ResyncASMAST
- ASM(Automatic Storage Management)ASM
- 【ASM】asm常用命令及主要功能介紹ASM
- Oracle ASM神書《撥雲見日 解密Oracle ASM核心》出版了OracleASM解密
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- ASM下遷移spfileASM
- 遷移ASM磁碟組ASM
- Java ASM學習(2)JavaASM
- Automatic Storage Management (ASM)(轉)ASM
- Multi-path handling for asmASM
- Oracle ASM擴容(NFS)OracleASMNFS
- ASM 翻譯系列第十三彈:ASM 高階知識 - Forcing the issueASM
- 【ASM】ASM資料檔案和OS檔案(FILESYSTEM)轉移方法總結ASM
- 【ASM】ORA-27504 ORA-27300 ORA-27303 while starting ASM (Doc ID 2281441.1)ASMWhile
- Oracle ASM AMDU工具的使用OracleASM
- 遇到ASM的兩個BUGASM
- 【RMAN】RMAN備份至ASMASM
- 【RAC】asm_diskgroups 引數ASM
- Oracle ASM Cluster File Systems (ACOracleASM
- 【32asm】04 - 重定位ASM
- Oracle:ASM & 密碼檔案OracleASM密碼
- Oracle之11g DataGuardOracle
- 【ASM】RAC19C因引數設定不當,asm無法啟動ASM