How can I export Oracle schema from my local machine to Remote using expdp and impdp command

Mukesh Singh picture Mukesh Singh · Jul 3, 2015 · Viewed 9.1k times · Source

I want to take the back up of my local Oracle instance and want it to import on my remote server.

I have searched the web but couldn't find any solution. The solution I got is:

  • Export from local and import into only local.
  • Export from Remote and import into only remote server.

But my requirement is:

I have a schema in my local oracle instance. Now I want to take it's backup and import it on to my remote server.

Below are commands I am running for exporting and importing.

for Local--

expdp HR/HR@ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log

impdp HR/HR@ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log

for Remote--

expdp FASTAdmin/[email protected]:1521/ORCL network_link=to_rds directory=Data_pump_dir dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS='MUKESH'

impdp FASTAdmin/[email protected]:1521/ORCL directory=DATA_PUMP_DIR dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS=MUKESH

Note:Please give me the solution using expdp and impdp command only.

Answer

Lalit Kumar B picture Lalit Kumar B · Jul 3, 2015

Three simple steps:

  • EXPDP on your local to generate the dump file.
  • Move the dump file to the remote server and place it in the required directory, by default from 10g and up you could use DATA_PUMP_DIR
  • EXPDP on the remote server using the dump file you placed in step 2.

In step 2, if you don't know the directory, you could do:

SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';

See an example here.