impdp expdp

CONN / AS SYSDBA
ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;

CREATE OR REPLACE DIRECTORY test_dir AS '/home/oracle/dp/'; -- creates and links the physical and logical directories
GRANT READ, WRITE ON DIRECTORY test_dir TO hr;

Tables:
expdp hr/hr@xe tables=EMPLOYEES,DEPARTMENTS directory=test_dir dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log -- backup 
impdp hr/hr@xe tables=EMPLOYEES directory=test_dir dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log REMAP_SCHEMA=hr:jl -- restore

Schema:
expdp hr/hr@xe schemas=hr directory=test_dir dumpfile=hr.dmp logfile=expdpSCOTT.log
impdp hr/hr@xe schemas=hr directory=test_dir dumpfile=hr.dmp logfile=impdpSCOTT.log

Database:
expdp system/password@xe full=Y directory=test_dir dumpfile=xe.dmp logfile=expdpxe.log
impdp system/password@xe full=Y directory=test_dir dumpfile=xe.dmp logfile=impdpxe.log

refer: https://oracle-base.com/articles/10g/oracle-data-pump-10g

Comments