参考原文:
ASMCMD - New commands in 11gR1 (Doc ID 451900.1)
适用于:
Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.1.0.7 [Release 11.1]
Information in this document applies to any platform.
***Checked for relevance on 02-Jan-2013***
asmcmd cp命令允许你在文件系统和 asm磁盘组之间拷贝文件,cp也能用于2个asm 磁盘组之间拷贝。
- ASM Diskgroup to OS file system
- OS file system to ASM Diskgroup
- ASM Diskgroup to another diskgroup
ASMCMD> md_restore -b dgbk -t full -g dgext
Current Diskgroup being restored: DGEXT
ASMCMD-09352: CREATE DISKGROUP failed
ORA-15018: diskgroup cannot be created
ORA-15030: diskgroup name "DGEXT" is in use by another diskgroup (DBD ERROR: OCIStmtExecute) --->可以看到,已经使用的磁盘组不能restore
SQL> drop diskgroup dgext;
Diskgroup dropped.
ASMCMD> md_restore -b dgbk -t full -g dgext
Current Diskgroup being restored: DGEXT
Diskgroup DGEXT 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 DGEXT EXTERN
nodg模式 restore 备份文件中的 属性,模板 和别名目录结构 到一个存在的磁盘组中。
ASMCMD> md_restore -b dgbk -t nodg -g dgext
Current Diskgroup being restored: DGEXT
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!
ASMCMD> md_restore -b dgbk -t newdg -o ‘DGEXT:DG‘
Current Diskgroup being restored: DGEXT
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