How to copy a datafile from ASM to a file system not using RMAN

dayong2015發表於2014-08-28
文章參考:http://blog.csdn.net/tianlesoftware/article/details/6342763
1.首先RAC環境下資料檔案的位置
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+RAC_GROUP/hhpen1/datafile/system.277.856639363
+RAC_GROUP/hhpen1/datafile/undotbs1.276.856639369
+RAC_GROUP/hhpen1/datafile/sysaux.268.856639367
+RAC_GROUP/hhpen1/datafile/users.270.856639369
+RAC_GROUP/hhpen1/datafile/undotbs2.278.856639551
2.在目標資料庫上建立一個源目錄source_dir
SQL> create or replace directory source_dir as '+RAC_GROUP/hhpen1/datafile';

Directory created.
3.在目標資料庫上建立一個目標目錄
SQL> create or replace directory data_dir as '/u01/app/arch_bak/bak_dest';

Directory created.
4.執行DBMS_FILE_TRANSFER包
SQL> BEGIN
  2    dbms_file_transfer.copy_file(
  3    source_directory_object =>'source_dir',
  4    source_file_name =>'system.277.856639363',
  5    destination_directory_object =>'data_dir',
  6    destination_file_name =>'system.277.856639363');
  7  END;
  8  /

PL/SQL procedure successfully completed.
5.檢視是否成功複製
[oracle@rac1 bak_dest]$ ll
total 492012
-rw-r----- 1 oracle oinstall 503324672 Aug 28 16:49 system.277.856639363
[oracle@rac1 bak_dest]$ pwd
/u01/app/arch_bak/bak_dest

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29634949/viewspace-1259648/,如需轉載,請註明出處,否則將追究法律責任。

相關文章