impdp & expdp 使用方法
1.全库:
导出:
create directory ext as '路径' (后面的directory均为此路径)expdp sys/xxx full=y directory=ext dumpfile=full.dmp;
导入:
impdp sys/xxx full=y directory=ext dumpfile=full.dmp tables_exists_action=skip或append或replace或truncate;
2.导表:
导出:
expdp sys/xxx tables=scott.emp,scott.dept directory=ext dumpfile=tables.dmp;
导入:
impdp sys/xxx tables=scott.emp directory=ext dumpfile=tables.dmp tables_exists_action=skip或append或replace或truncate;
3.导用户:
导出:
expdp sys/xxx schemas=scott directory=ext dumpfile=scott.dmp
导入:
impdp sys/xxx directory=ext dumpfile=full.dmp remap_schema=scott:u;
4.导数据行
导出:
expdp sys/xxx tables=scott.emp query=\' where empno=1\' directory=ext dumpfile=rows.dmp;
导入:
impdp sys/xxx tables=scott.emp directory=ext dumpfile=rows.dmp
5.直接导入(不用先导出再导入)
expdp sys/xxx network_link=orcl(services_name或dblink_name) schemas=scott remap_schema=scott:u
PS: db link : create public database link exptest connect to scott identified by oracle using 'orcl(链接字符串)'