【ASM】ASMCMD 之md_backup,md_restore介紹
在11g中ASMCMD 已經擴充備份和恢復ASM 磁碟組的功能。這個功能允許你重建一個與先前存在的磁碟組一樣路徑,名稱,屬性,模版,別名結構。在10g中如果磁碟損壞了,只能透過使用RMAN來恢復丟失的資料,而且你必須人工的重建ASM 磁碟組和任何必須的目錄,模版,在11g中我們可以使用md_backup命令備份磁碟組的後設資料並且使用md_restore命令在應用備份恢復之前重建磁碟組。md_backup:命令建立一個包含一個或者多個磁碟組的後設資料的檔案,預設情況下如果不指定備份檔案的路徑,包含所有載入狀態的磁碟組後設資料的備份檔案儲存在當前路徑。如果不指定備份檔案的名字,在預設為AMBR_BACKUP_INTERMEDIATE_FILE.
例子:
ASMCMD [+data] > md_backup /tmp/asmDATA.bak -G DATA --備份指定磁碟組DA他的後設資料
Disk group metadata to be backed up: DATA
Current alias directory path: rac/ASMPARAMETERFILE
Current alias directory path: rac/AUTOBACKUP/2011_05_26
Current alias directory path: rac/MREDO
Current alias directory path: rac/AUTOBACKUP/2010_10_21
Current alias directory path: rac/ARCHIVELOG/2011_07_07
Current alias directory path: rac/OCRFILE
Current alias directory path: tspitr
Current alias directory path: rac/ARCHIVELOG/2011_07_09
Current alias directory path: DUMMY
Current alias directory path: rac/ARCHIVELOG/2011_07_06
Current alias directory path: rac/AUTOBACKUP/2010_10_26
Current alias directory path: rac/AUTOBACKUP/2010_10_20
Current alias directory path: rac/AUTOBACKUP/2010_11_22
Current alias directory path: rac/AUTOBACKUP
Current alias directory path: rac/ARCHIVELOG/2010_09_05
Current alias directory path: rac/AUTOBACKUP/2010_10_19
Current alias directory path: rac/ARCHIVELOG/2011_06_25
Current alias directory path: DUMMY/PARAMETERFILE
Current alias directory path: rac/ARCHIVELOG/2011_06_27
Current alias directory path: rac/AUTOBACKUP/2011_06_02
Current alias directory path: rac
Current alias directory path: rac/AUTOBACKUP/2010_10_18
Current alias directory path: rac/ARCHIVELOG/2011_07_01
Current alias directory path: rac/AUTOBACKUP/2010_11_26
Current alias directory path: rac/TEMPFILE
Current alias directory path: rac/CONTROLFILE
Current alias directory path: rac/ARCHIVELOG/2011_06_24
Current alias directory path: rac/ARCHIVELOG/2011_06_29
Current alias directory path: rac/ARCHIVELOG/2011_07_05
Current alias directory path: rac/ARCHIVELOG
Current alias directory path: rac/DATAFILE
Current alias directory path: rac/ARCHIVELOG/2011_06_23
Current alias directory path: rac/ONLINELOG
ASMCMD> md_backup -b /tmp/asmDATA.bak -g DATA
Disk group to be backed up: DATA
在恢復模式,系統讀取先前建立的備份檔案來重建磁碟組和它的後設資料。使用者可以控制這個恢復的模式,以full,nodg,newdg三種方式來恢復。
1 full 模式恢復ASM磁碟組到它們備份時的狀態。
恢復的時候執行命令:
srvctl stop diskgroup –g DATA
否則恢復時會報ORA-15030錯誤
ASMCMD> md_restore -b /tmp/asmDATA.bak -t full -g DATA
Current Diskgroup being restored: DATA
ASMCMD-09352: CREATE DISKGROUP failed
ORA-15018: diskgroup cannot be created
ORA-15030: diskgroup name "DATA" is in use by another diskgroup (DBD ERROR: OCIStmtExecute)
SQL> drop diskgroup DATA;
Diskgroup dropped.
ASMCMD> md_restore -b /tmp/asmDATA.bak -t full -g DATA
Current Diskgroup being restored: DATA
Diskgroup DATA created!
System template XTRANSPORT modified!
System template ONLINELOG modified!
System template DATAGUARDCONFIG modified!
System template AUTOBACKUP modified!
System template TEMPFILE modified!
System template ARCHIVELOG modified!
System template ASM_STALE modified!
System template BACKUPSET modified!
System template DUMPSET modified!
System template FLASHBACK modified!
System template PARAMETERFILE modified!
System template CONTROLFILE modified!
System template DATAFILE modified!
System template CHANGETRACKING modified!
SQL> select group_number,name,type from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE
------------ -------------------- ------
1 DATA EXTERN
2 nodg 模式將備份檔案中記錄的屬性,模版,別名結構恢復一個已經存在的ASM磁碟組中。
ASMCMD> md_restore -b /tmp/asmDATA.bak -t nodg -g DATA
Current Diskgroup being restored: DATA
System template XTRANSPORT modified!
System template ONLINELOG modified!
System template DATAGUARDCONFIG modified!
System template AUTOBACKUP modified!
System template TEMPFILE modified!
System template ARCHIVELOG modified!
System template ASM_STALE modified!
System template BACKUPSET modified!
System template DUMPSET modified!
System template FLASHBACK modified!
System template PARAMETERFILE modified!
System template CONTROLFILE modified!
System template DATAFILE modified!
System template CHANGETRACKING modified!
3 newdg模式允許使用者重寫磁碟組的名稱,磁碟,和指定的故障磁碟組作為磁碟組重建的一部分,但保留部分屬性,模板,別名目錄結構。
ASMCMD> md_restore -b /tmp/asmDATA.bak -t newdg -o 'DATA:DG'--更改磁碟組的名稱
Current Diskgroup being restored: DATA
Current Diskgroup name replace by: DG
Diskgroup DG created!
System template XTRANSPORT modified!
System template ONLINELOG modified!
System template DATAGUARDCONFIG modified!
System template AUTOBACKUP modified!
System template TEMPFILE modified!
System template ARCHIVELOG modified!
System template ASM_STALE modified!
System template BACKUPSET modified!
System template DUMPSET modified!
System template FLASHBACK modified!
System template PARAMETERFILE modified!
System template CONTROLFILE modified!
System template DATAFILE modified!
System template CHANGETRACKING modified!
SQL> select group_number,name,type from v$asm_diskgroup
GROUP_NUMBER NAME TYPE
------------ ---------------- ----------
1 DG EXTERN
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2121309/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11g asm md_backup md_restoreASMREST
- oracle 11gR2 asmcmd 工具增加md_backup和md_restore命令OracleASMREST
- 【asmcmd】使用asmcmd工具管理ASMASM
- oracle asm asmcmdOracleASM
- ASM工具asmcmdASM
- asmcmd工具的詳細介紹ASM
- 【ASM】ASMCMD cp 命令ASM
- 【轉】Oracle ASM介紹OracleASM
- 【ASM】ASMCMD chtmpl 更改ASM 模版的屬性ASM
- ASMCMD - ASM command line utility .ASM
- ASMCMD簡介(1)ASM
- ASM命令列管理工具asmcmdASM命令列
- OCP(11g)------> ASM Command-Line Utility (ASMCMD)和 使用 ASMCMDASM
- Oracle 12C ASM asmcmd amdu_extractOracleASM
- 學習ASM技術(六)-- ASMCMD命令列ASM命令列
- 【ASM】asm常用命令及主要功能介紹ASM
- 使用 ASMCMD 工具管理ASM目錄及檔案ASM
- Elasticsearch之介紹Elasticsearch
- 用asmcmd 的rebal 代替 ASM_POWER_LIMIT 引數ASMMIT
- Oracle IZ0-053 Q36(ASM ASMCMD REMAP)OracleASMREM
- [zt] ORACLE 10g中ASMCMD使用及ASM檔案Oracle 10gASM
- SAP工作流介紹之ABAP Business Workflow介紹
- ASM 翻譯系列第三十四彈:ASM磁碟組重要屬性介紹ASM
- ASMCMD執行ASM後設資料備份與還原ASM
- Android之Zygote介紹AndroidGo
- docker之Dockerfile指令介紹Docker
- percona之tcprstat 介紹TCP
- java之Object類介紹JavaObject
- 【ORACLE ASM】ASM 支援工具簡介OracleASM
- Scrapy 框架介紹之 Puppeteer 渲染框架
- 機器學習入門之sklearn介紹機器學習
- Mybatis介紹之 動態SQLMyBatisSQL
- Angular 之 zone.js 介紹AngularJS
- Oracle PL/SQL之 Package介紹OracleSQLPackage
- 【EASYDOM系列教程】之Node介紹
- Arduino 入門之Arduino介紹UI
- Spring框架之IOC介紹Spring框架
- asmcmdASM