How to move a datafile from a file system to ASM
How to move a datafile from ASM to the file system
http://www.cndba.cn/Dave/article/817
步骤如下:
1. Log onto the target database that is local to the ASM instance as the sys user.
2. create source directory within the target database.
SQL> create or replace directory SOURCE_DIR as '+DGROUP1/V10ASM/datafile/';
Directory created.
(In this example +DGROUP1/V10ASM/datafile/ is the source directory where the datafile is located and where you wish to copy the file from.)
3. create destination directory within database.
SQL> create or replace directory ORACLE_DEST as '/restore';
Directory created.
(In this example /restore is the destination directory where the datafile is to be copied to.)
4. Execute the dbms_file_transfer package.
SQL>
BEGIN
dbms_file_transfer.copy_file(source_directory_object =>
'SOURCE_DIR', source_file_name => 'system.272.617284341',
destination_directory_object => 'ORACLE_DEST',
destination_file_name => 'system.dbf');
END;
/
PL/SQL procedure successfully completed.
(In this example system.272.617284341 is the file I wish to transfer and the destination file is system.dbf)
The file has now been copied to the /restore directory.