本文共 1555 字,大约阅读时间需要 5 分钟。
在10g的时候 如果要将数据文件从os 迁移到asm 或者反之,必须使用rman或者dbms_file_transfer实现。在oracle 11g的asmcmd提供了cp命令来实现asm 磁盘组和os 之间,asm 磁盘之间的数据文件的迁移。
共如下三种方式: 1 .ASM Diskgroup to OS file system 2..OS file system to ASM Diskgroup 3 .ASM Diskgroup to another diskgroup -- ASM Diskgroup to OS File system ASMCMD [+data] > cp +DATA/rac/datafile/users.950.732883617 /tmp/user.dbf copying +DATA/rac/datafile/users.950.732883617 -> /tmp/user.dbf--OS File system to ASM DiskgroupASMCMD [+data] > cp /tmp/user.dbf +DATA/rac/datafile/users.950.732883617
copying /tmp/user.dbf -> +DATA/rac/datafile/users.950.732883617--ASM 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/datafileSQL> create tablespace TBSEXT datafile '+DGEXT' size 10m;
Tablespace created. SQL> select name from v$datafile; NAME ------------------------------------------------------------- +DGEXT/orcl/datafile/tbsext.256.628847401ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext
+DGEXT/orcl/datafile/tbsext.256.628847401 -> +DGEXTBK/prod/datafile/tbsextfoldertbsext是建立在+DGEXTBK/prod/datafile文件夹下数据文件的别名,真正的文件建立在文件夹ASMTESTING下
ASMCMD> ls -ltr
Type Redund Striped Time Sys Name N tbsext => +DGEXTBK/ASMTESTING/DATAFILE/TESTING.256.628848885参考 metalink [ID 451900.1]
转载地址:http://lxbno.baihongyu.com/