oracle impdp&expdp

sqlplus /nolog
conn / as sysdba

--创建oracle目录
create directory backup as '/home/oracle/dump';
--查看目录
select * from dba_directories;
--或者删除目录
drop directory backup;

--导出整个数据库
expdp scott/tiger@orcl DIRECTORY=backup DUMPFILE=full.dmp FULL=y;
--按用户导出
expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp DIRECTORY=backup;

--导入数据库
impdb scott/tiger@orcl DIRECTORY=backup DUMPFILE=full.dmp FULL=y;
--导入同名用户下
impdp scott/tiger@orcl DIRECTORY=backup DUMPFILE=expdp.dmp SCHEMAS=scott;
--导入其他用户下
impdp scott/tiger@orcl DIRECTORY=backup DUMPFILE=expdp.dmp remap_schema=scott:otheruser;

 

你可能感兴趣的:(oracle impdp&expdp)