asm拷貝檔案到檔案系統

oracle_mao發表於2013-12-18

SQL> create or replace directory SOURCE_DIR as '+DATA_DG/racdb/datafile/';

Directory created.

SQL> create or replace directory ORACLE_DEST as '/home/oracle/';

Directory created.

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA_DG/racdb/datafile/system.256.805972643
+DATA_DG/racdb/datafile/sysaux.257.805972643
+DATA_DG/racdb/datafile/undotbs1.258.805972645
+DATA_DG/racdb/datafile/users.259.805972645
+DATA_DG/racdb/datafile/undotbs2.267.805972815

SQL> BEGIN
  2  dbms_file_transfer.copy_file(source_directory_object =>'SOURCE_DIR', source_file_name => 'system.256.805972643',destination_directory_object => 'ORACLE_DEST',destination_file_name => 'system.256.805972643');
END;  3 
  4  /

PL/SQL procedure successfully completed.

SQL> !ls -l
total 779412
-rw-r--r-- 1 oracle oinstall     34657 Apr  9  2013 ashrpt_1_0409_1029.html
-rw-r--r-- 1 oracle oinstall   1139345 Apr  9  2013 awrdiff_1_1122_1_1130.html
-rw-r--r-- 1 oracle oinstall      1577 Apr 12  2013 droptable.sql
-rw-r--r-- 1 oracle asmadmin      1968 Jun  9  2013 pfileracdb.ora
-rw-r----- 1 oracle asmadmin 796925952 Dec 18 14:21 system.256.805972643
真的好簡單。

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

相關文章