Sundaramurthy Blog

March 29, 2010

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

Filed under: ASM — sundar5 @ 10:25 pm

Ref: metalink

1. Log onto source oracle database and connect as sys user.

2. Create directory in the source (rman it is called target database) database.

SQL> create or replace directory SOURCE_DIR as ‘+DATA/DAWAPP/datafile/’;
Directory created.

Here “+DATA/DAWAPP/datafile/” is the location of source database datafile.
and where we are going to copy the file from.)

3. Create destination directory within source database.

SQL> create or replace directory DESTINATION_DIR as ‘/mnt/datafile/’;
Directory created.

Here “/mnt/datafile/” is the location of  destination directory where the datafile
is to be copied to.)

4. Use dbms_file_transfer package to transfer the the datafile.

SQL> BEGIN
dbms_file_transfer.copy_file(source_directory_object => ‘SOURCE_DIR’,
source_file_name =>’daily_etl_data.340.617284331′,
destination_directory_object => ‘DESTINATION_DIR’,
destination_file_name => ‘daily_etl_data.dbf’);
END;

/

PL/SQL procedure successfully completed.

(In this example daily_etl_data.340.617284331 is the file transfer and the destination file   is  daily_etl_data.dbf)

5. The file has now been copied to the /mnt/datafile/ directory.

Note:

This steps are provided for educational purpose only and not used in the production

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: