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, OLAP, 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, OLAP, 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值