Expdp and impdp 倒入导出例子

--using expdp and impdp to export data from one db to other db
--1. create the  same schema, tablespace 
--2. if the two db version are different, please add target db version when do expdp and impdb

----3. create directory  on source db 
create directory dpdata1 as '/temp/dump';
--4.check directory in db
select * from dba_directories;
--5. grant a user  permission to directory
grant read,write on directory dpdata1 to user_name;

-- 6. export user data 
EXPDP USERID='SYS/test@prd as sysdba' schemas=user_s directory=dpdata1 PARALLEL=4 FILESIZE=200M dumpfile=data_file_%u.dmp logfile=export.log version= ;

-- 7.copy dumpfile to target db directory folder, and create the same directory in target db

---8. import data into target db, if  directory didn't be created on share disk, need to cluster=no to avoid error.

IMPDP USERID='SYS/test@prd as sysdba' schemas=user_s directory=dpdata1 PARALLEL=4  dumpfile=data_file_%u.dmp cluster=no logfile=import.log version=;