oracle datapump - ghdrako/doc_snipets GitHub Wiki

EKSPORT SCHEMATU

expdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp 

IMPORT SCHEMATU

impdp system/oracle DIRECTORY=dmpdir DUMPFILE=scott.dmp

Network in source system:

create database link old_scott connect to scott identified by tiger  using 'orcl.oracle.com';

in target system:

impdp new_scott/tiger DIRECTORY=dmpdir NETWORK_LINK=old_scott remap_schema=scott:new_scott

PL/SQL API

DECLARE
  hand NUMBER;
BEGIN
  hand := Dbms_DataPump.Open(operation => 'EXPORT',
                              job_mode => 'FULL',
                              job_name => 'FULLEXPJOB',
                               version => 'COMPATIBLE');
  Dbms_DataPump.Add_File(handle => hand,
                       filename => 'expdp_plsql.log',
                      directory => 'DMPDIR',
                       filetype => 3);
  Dbms_DataPump.Add_File(handle => hand,
                       filename => 'expdp_plsql.dmp',
                      directory => 'DMPDIR',
                       filetype => 1);
  -- Dbms_DataPump.Set_Parameter(handle => hand,
  --                               name => 'ESTIMATE',
  --                              value => 'STATISTICS');
  Dbms_DataPump.Start_Job(hand);
END;
/