前端之家收集整理的这篇文章主要介绍了
impdp 按条件导入测试 query,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--创建测试表 create table t_table as select * from dba_tables; --导出测试表 expdp TEST/******* directory=EXPDATA dumpfile=impdp_query_test.dmp logfile=impdp_query_test.log tables=TEST.t_table Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning,OLAP,Data Mining and Real Application Testing options Starting "TEST"."SYS_EXPORT_TABLE_01": TEST/******** directory=EXPDATA dumpfile=impdp_query_test.dmp logfile=impdp_query_test.log tables=TEST.t_table Estimate in progress using BLOCKS method... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 576 KB Processing object type TABLE_EXPORT/TABLE/TABLE . . exported "TEST"."T_TABLE" 449.2 KB 1727 rows Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded ****************************************************************************** Dump file set for TEST.SYS_EXPORT_TABLE_01 is: /arch/expdp/impdp_query_test.dmp Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 16:36:20 --根据条件导入测试表,remap_schema 加 query 条件 生效 vi impdp_query_test2.par userid=TEST/****** DIRECTORY=EXPDATA DUMPFILE=impdp_query_test.dmp remap_schema=TEST:TEST2 CONTENT=all LOGFILE=result_test.log TABLES= TEST.t_table query=(TEST.t_table:"where owner ='TEST'") impdp parfile=impdp_query_test2.par Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning,Data Mining and Real Application Testing options Master table "TEST"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded Starting "TEST"."SYS_IMPORT_TABLE_01": TEST/******** parfile=impdp_query_test2.par Processing object type TABLE_EXPORT/TABLE/TABLE Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported "TEST2"."T_TABLE" 449.2 KB 6 out of 1727 rows Job "TEST"."SYS_IMPORT_TABLE_01" successfully completed at 16:38:01 --
添加remap_table
修改表名条件,query条件不生效 vi impdp_query_test2.par userid=TEST/****** DIRECTORY=EXPDATA DUMPFILE=impdp_query_test.dmp remap_schema=TEST:TEST2 remap_table=t_table:t_table1 CONTENT=all LOGFILE=result_test.log TABLES= TEST.t_table query=(TEST.t_table:"where owner ='TEST'") impdp parfile=impdp_query_test2.par Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning,Data Mining and Real Application Testing options Master table "TEST"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded Starting "TEST"."SYS_IMPORT_TABLE_01": TEST/******** parfile=impdp_query_test2.par Processing object type TABLE_EXPORT/TABLE/TABLE Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported "TEST2"."T_TABLE1" 449.2 KB 1727 rows Job "TEST"."SYS_IMPORT_TABLE_01" successfully completed at 16:42:29
原文链接:https://www.f2er.com/oracle/213191.html