Oracle11g ASMCMD新命令

Oracle10g的ASMCMD命令,提供了通过命令行方式管理ASM的接口,但是功能非常有限,比如无法在asm和os之间直接复制文件,就是一件很让人头痛的事情,只能通过rman或者dbms_file_transfer实现。

Oracle11g的ASMCMD终于加上了一个比较实用的cp命令,不但可以在ASM和OS之间复制文件,也可以在不同的ASM Instance和Diskgroup之间复制文件,这就非常的方便了。

ASMCMD> cp +dgtest/test/datafile/USERS.264.646186565 users.dbf
source +dgtest/test/datafile/USERS.264.646186565
target users.dbf
copying file(s)…
file, E:\ORACLE\PRODUCT\11.1.0\DB_1\DATABASE\USERS.DBF, copy committed.

但是有点头痛的是,在windows平台上,不知道如何指定OS的路径,因为cp命令语法中,冒号被用作连接字符串和具体路径之间的分隔符了,有知道怎么解决的朋友请留言告知,谢谢。

ASMCMD> help cp
cp [-ifr] <[\@connect_identifier:]src> <[\@connect_identifier:]tgt>

Oracle10g对于ASM的metadata的保护是非常弱的,基本上没有提供常规的手段来备份或者恢复metadata,这样一旦出现metadata损坏之类的问题,就会非常的麻烦。11g的ASMCMD新增加了md_backup/md_restore两个命令,对ASM的metadata提供了备份恢复的功能。

ASMCMD> md_backup -b meta.bak -g dgtest
Disk group to be backed up: DGTEST

从备份出来的文件看,ASM的metadata是相当的简单的:

@diskgroup_set = (
{
‘ATTRINFO’ => {
‘AU_SIZE’ => ‘1048576’,
‘DISK_REPAIR_TIME’ => ‘3.6h’,
‘COMPATIBLE.ASM’ => ‘11.1.0.0.0’,
‘COMPATIBLE.RDBMS’ => ‘10.1.0.0.0’
},
‘DISKSINFO’ => {
‘DGTEST_0001′ => {
‘DGTEST_0001′ => {
‘TOTAL_MB’ => ‘1024’,
‘FAILGROUP’ => ‘DGTEST_0001′,
‘NAME’ => ‘DGTEST_0001′,
‘DGNAME’ => ‘DGTEST’,
‘PATH’ => ‘E:\\ASM\\DISK2′
}
},
‘DGTEST_0000′ => {
‘DGTEST_0000′ => {
‘TOTAL_MB’ => ‘1024’,
‘FAILGROUP’ => ‘DGTEST_0000′,
‘NAME’ => ‘DGTEST_0000′,
‘DGNAME’ => ‘DGTEST’,
‘PATH’ => ‘E:\\ASM\\DISK1′
}
}
},
‘DGINFO’ => {
‘DGTORESTORE’ => 0,
‘DGCOMPAT’ => ‘11.1.0.0.0’,
‘DGNAME’ => ‘DGTEST’,
‘DGDBCOMPAT’ => ‘10.1.0.0.0’,
‘DGTYPE’ => ‘EXTERN’,
‘DGAUSZ’ => ‘1048576’
},
‘ALIASINFO’ => {},
‘TEMPLATEINFO’ => {
‘6’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘ASM_STALE’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
’11’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘FINE’,
‘TEMPNAME’ => ‘FLASHBACK’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘3’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘ARCHIVELOG’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘7’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘BACKUPSET’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘9’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘XTRANSPORT’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘2’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘FINE’,
‘TEMPNAME’ => ‘CONTROLFILE’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
’12’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘DATAGUARDCONFIG’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘8’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘AUTOBACKUP’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘4’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘FINE’,
‘TEMPNAME’ => ‘ONLINELOG’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘1’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘DUMPSET’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘0’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘PARAMETERFILE’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
’10’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘CHANGETRACKING’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
’13’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘TEMPFILE’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
},
‘5’ => {
‘DGNAME’ => ‘DGTEST’,
‘STRIPE’ => ‘COARSE’,
‘TEMPNAME’ => ‘DATAFILE’,
‘REDUNDANCY’ => ‘UNPROT’,
‘SYSTEM’ => ‘Y’
}
}
}
;



无觅相关文章插件,快速提升流量

3条评论

  • At 2008.07.01 19:37, Rain_At_DNA said:

    很cool的命令!

    • At 2008.07.01 19:39, Rain_At_DNA said:

      但是应该有大小限制吧?

      • At 2009.12.11 13:46, 玉面飞龙 said:

        如果数据库是10g的,ASM实例是11g的,不知道能用上这些命令吗。。。


        (Required)
        (Required, will not be published)