Home » ORA-HOWTO, Oracle, Tips Scripts

File transfers for database cloning

23 November 2009 449 views No Comment

There are lot of ways in which files are copied from one database to the other during database cloning or transporting tablespaces.

File transfers can be done using oracle package called “DBMS_FILE_TRANSFER”.

Let us assume we need to transfer a file x.dbf from database SOURCE_DB to database DEST_DB

Do the following :

AT SOURCE_DB:
==============
1)Create directory source_dir as ‘/u01/dbdata’;

2)Create database link remote_db
connect to system identified by manager
using ‘remmote_db’;

Make sure to add this entry in TNSNAMES.ORA file.

Check if the database link works by

select count(1) from dba_tables@remote_db;

AT DEST_DB:
============
create directory dest_dir as ‘/u02/dbdata’;

Now back to SOURCE_DB:

exec dbms_file_transfer.put_file(‘SOURCE_DIR’,'x.dbf’,'DEST_DIR’,'x.dbf’,'REMOTE_DB’);

Now the file is copied from SOURCE_DB to DEST_DB.

This package also has get_file and copy_file (for local copy).

Google : File transfers for database cloning
Google Search: File transfers for database cloning
DB Error Code: File transfers for database cloning

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.