-
将有问题的数据文件修改为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/gc_test1.dbf 25
SQL> alter database datafile 25 offline;
Database altered.
SQL> select file_name, file_id, online_status from dba_data_files where file_id=25;
FILE_NAME FILE_ID ONLINE_STATUS
---------- -------
/u01/oracle/oradata/gc_test1.dbf 25 RECOVER
-
使用asmcmd命令将文件从本地目录复制到共享磁盘组中
ASMCMD> cp /u01/oracle/oradata/gc_test1.dbf +DATADG/PROD/DATAFILE/gc_test1.dbf
copying /u01/oracle/oradata/gc_test1.dbf -> +DATADG/PROD/DATAFILE/gc_test1.dbf
-
rename每一个完成复制的数据文件
SQL> alter database rename file '/u01/oracle/oradata/gc_test1.dbf' to '+DATA/PROD/DATAFILE/gc_test1.dbf'; Database altered.
-
recover数据文件并将其online
SQL> alter database recover datafile 25;
Database altered.
SQL> alter database datafile 25 online;
Database altered.
-
确认修改成功
SQL> select file_name, file_id, online_status from dba_data_files where file_id=6;
FILE_NAME FILE_ID ONLINE_STATUS
----------------- -----------------
+DATA/prod/datafile/gc_test1.dbf 25 ONLINE
参考文档:How to Move a Datafile from Filesystem to ASM Using ASMCMD CP Command. (Doc ID 1610615.1)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31436737/viewspace-2646535/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31436737/viewspace-2646535/