ASMCMD - New commands in 11gR1

 

       We have introduced three new functionalities to the ASMCMD utility to improve node recovery after a crash,repair bad blocks on a disk, copy files and simplify the listing of ASM disks in a diskgroup

       ASMCMD is also extended to include ASM disk group metadata backup and restore functionality.This provides the ability to create a pre-existing ASM diksgroup with the same disk paths, disk names,failure groups,attributes,templates and alias directory structure

 

ASMCMD - New commands in 11gR1

 

1.  ASMCMD cp command

       The ASMCMD cp option allows you to copy files between ASM disk groups and OS file systems and between two ASM servers.

The following file copy can be performed

- ASM Diskgroup to OS file system
- OS file system to ASM Diskgroup
- ASM Diskgroup to another diskgroup

 

1ASM Diskgroup to OS File system

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 /home/oracle/tbsext.dbf
source +DGEXT/orcl/datafile/tbsext.256.628847401
target /home/oracle/tbsext.dbf
copying file(s)...
file, /home/oracle/tbsext.dbf, copy committed.

2OS File system to ASM Diskgroup

ASMCMD> cp /home/oracle/tbsext.dbf +DGEXTBK/prod/datafile/tbsext.dbf
source /home/oracle/tbsext.dbf
target +DGEXTBK/prod/datafile/tbsext.dbf
copying file(s)...
file, +DGEXTBK/prod/datafile/tbsext.dbf, copy committed.

 

3ASM Diskgroup to another diskgroup


SQL> create diskgroup dgext external redundancy disk '/dev/raw/raw1','/dev/raw/raw2';


Diskgroup created.

SQL> create diskgroup DGEXTBK external redundancy disk '/dev/raw/raw3','/dev/raw /raw4';
Diskgroup created.

ASMCMD> cd DGEXTBK
ASMCMD> mkdir prod
ASMCMD> cd prod
ASMCMD> mkdir datafile
ASMCMD> cd datafile
ASMCMD> pwd
+DGEXTBK/prod/datafile

SQL> create tablespace TBSEXT datafile '+DGEXT' size 10m;
Tablespace created.

SQL> select name from v$datafile;

NAME
-------------------------------------------------------------
+DGEXT/orcl/datafile/tbsext.256.628847401

cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext 

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext 
source +DGEXT/orcl/datafile/tbsext.256.628847401 
target +DGEXTBK/prod/datafile/tbsext 
copying file(s)...file, +DGEXTBK/prod/datafile/tbsext, copy committed. 

The tbsext is alias name created in the folder +DGEXTBK/prod/datafile and actual file is created in the ASMTESTING folder

ASMCMD> ls -ltr 
Type Redund Striped Time Sys Name 
N tbsext => +DGEXTBK/ASMTESTING/DATAFILE/TESTING.256.628848885 

Also Refer Note 452158.1 ASMCMD cp command fails with ORA-15046 
 

 

2.  ASMCMD md_backup and md_restore

       ASMCMD is extended to include ASM disk group metadata backup and restore functionality.This provides the ability to recreate a pre-existing ASM disk group with the same disk paths,disk names, failure groups, attributes, templates and alias directory structure

       In 10g if an ASM disk group is lost, then it is only possible to restore the lost files using RMAN but you have to manually recreate the ASM disk group and any required user directories/templates.

       In 11g we can take backup of ASM diskgroup metadata.The md_backup command creates a backup file containing metadata for one or more disk groups. By default all the mounted disk groups are included in the backup file which is saved in the current working directory.
If the name of the backup file is not specified, ASM names the file AMBR_BACKUP_INTERMEDIATE_FILE.


ASMCMD> md_backup -b dgbk -g dgext
Disk group to be backed up: DGEXT

       In restore mode, it reads the previously generated file to reconstruct the diskgroup and its metadata. You have the possibility to control the behaviour in restore mode to do a full,nodg or newdg restore.

 

The full mode restores the diskgroup exactly as it was at the time of backup

 

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)

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

 

The 'nodg' mode restore the attributes,templates, and alias directory structure specified in the backup file to an existing disk group.

 

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!

 

The 'newdg' mode allows the user to override the disk group name,disk, and failgroup specifications as part of a diskgroup creation,but retains the attribute,template and, alias directory structure from the backup

 

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

 

 

 

 

From Oracle

-------------------------------------------------------------------------------------------------------

QQ: 492913789
Email: ahdba@qq.com
Blog: http://www.cndba.cn/dave

DBA1 群:62697716();   DBA2 群:62697977()   DBA3 群:62697850()  

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823   

聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值