创建目录
create directory dir as '/home/oracle/dir';
给目录授权
grant read,write on directory dir to ydsr1011;
查看
select * from dba_directories;
-------------------------------------
源库导出数据
用户模式
expdp scott/tiger@orcl schemas=ydsr1011 dumpfile=user.dmp directory=dir
并行进程方式
expdp scott/tiger@orcl tables=emp,dept dumpfile=process.dmp directory=dir
表模式
exedp scott/tiger@orcl directory=dir dumpfile=table.dmp tables=emp
表空间模式
expdp system/oracle directory=dir dumpfile=tablespace.dmp tablespaces=temp,example
查询条件模式
expdp scott/tiger@orcl directory=dir dumpfile=select.dmp tables=emp querry='where deptno=20';
全库模式
expdp system/oracle directory=dir dumpfile=full.dmp full=y
----------------------------------------------
导入目标数据库
指定用户下
impdp scott/tiger directory=dir dumpfile=user.dmp schemas=scott;
改变表owner
impdp system/oracle directory=dir dmpfile=table.dmp tables=scott.dept remap_schema=scott:syst
表空间
impdp system/oracle DIRECTORY=dir DUMPFILE=tablespace.dmp TABLESPACES=example;
导入数据库
impdb system/oracle DIRECTORY=dir DUMPFILE=full.dmp FULL=y;
追加数据
impdp system/oracle DIRECTORY=1 DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION=append;
create directory dir as '/home/oracle/dir';
给目录授权
grant read,write on directory dir to ydsr1011;
查看
select * from dba_directories;
-------------------------------------
源库导出数据
用户模式
expdp scott/tiger@orcl schemas=ydsr1011 dumpfile=user.dmp directory=dir
并行进程方式
expdp scott/tiger@orcl tables=emp,dept dumpfile=process.dmp directory=dir
表模式
exedp scott/tiger@orcl directory=dir dumpfile=table.dmp tables=emp
表空间模式
expdp system/oracle directory=dir dumpfile=tablespace.dmp tablespaces=temp,example
查询条件模式
expdp scott/tiger@orcl directory=dir dumpfile=select.dmp tables=emp querry='where deptno=20';
全库模式
expdp system/oracle directory=dir dumpfile=full.dmp full=y
----------------------------------------------
导入目标数据库
指定用户下
impdp scott/tiger directory=dir dumpfile=user.dmp schemas=scott;
改变表owner
impdp system/oracle directory=dir dmpfile=table.dmp tables=scott.dept remap_schema=scott:syst
表空间
impdp system/oracle DIRECTORY=dir DUMPFILE=tablespace.dmp TABLESPACES=example;
导入数据库
impdb system/oracle DIRECTORY=dir DUMPFILE=full.dmp FULL=y;
追加数据
impdp system/oracle DIRECTORY=1 DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION=append;