Oracle - Importing data from another database (impdb)

April 10, 2013

The following script transferes the schema AAA from a database using the database link BBB. Because we want to store the log of this operation in file CCC we have to inform oracle to save it int the directory object DDD:

impdp system/system_user_password schemas=AAA directory=DDD network_link=BBB logfile=CCC_  remap_schema=AAA:AAA remap_tablespace=AAA:AAA_

Nota:
1- The above script takes into consideration that the tablespace has the same name as the schema

2- In order to import the data, instead of only the databale elements (tables, views, etc) droping the schema might also be necesary.
To do it close all the connectiosn to that schema (TOAD, SqlDeveloper, etc), enter sqlpplus and drop the user:

drop user XXX cascade;