使用asmcmd cp命令 把datafile从文件系统移动(move)到asm磁盘组中--针对11gR2
参考原文:
How to Move a Datafile from Filesystem to ASM Using ASMCMD CP Command. (Doc ID 1610615.1)
适用于:
Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.
症状:
datafile被错误的添加到了文件系统中,应该是放在asm磁盘组中的。
原因:
这不是一个system表空间的datafile
解决方案:
1 让该datafile offline
SQL> alter system switch logfile;
System altered.
SQL> select file_name, file_id from dba_data_files;
FILE_NAME FILE_ID
---------------------
/u01/oracle/oradata/test1.dbf 6
SQL> alter database datafile 6 offline;
Database altered.
SQL> select file_name, file_id, online_status from dba_data_files where file_id=6;
FILE_NAME FILE_ID ONLINE_STATUS
---------- -------
/u01/oracle/oradata/test1.dbf 6 RECOVER
2. 使用asmcmd命令 将此文件从文件系统拷贝到asm磁盘组中。
ASMCMD> cp /u01/oracle/oradata/test1.dbf +DATA/LONDON/DATAFILE/test.dbf
copying /u01/oracle/oradata/test1.dbf -> +DATA/LONDON/DATAFILE/test.dbf
ASMCMD> ls -lt
Type Redund Striped Time Sys Name
N test.dbf => +DATA/ASM/DATAFILE/test.dbf.286.833718815
ASMCMD> pwd
+DATA/ASM/DATAFILE
3. 一旦该datafile被拷贝完成,重命名该datafile
SQL> alter database rename file '/u01/oracle/oradata/test1.dbf' to '+DATA/LONDON/DATAFILE/test.dbf';
Database altered.
4. recover 该datafile ,并且onlime 该datafile
SQL> alter database recover datafile 6;
Database altered.
SQL> alter database datafile 6 online;
Database altered.
5.确认正确的文件名和路径
SQL> select file_name, file_id, online_status from dba_data_files where file_id=6;
FILE_NAME FILE_ID ONLINE_STATUS
---------- -------
+DATA/london/datafile/test.dbf 6 ONLINE
转载:http://www.it165.net/database/html/201407/7289.html