EXPDP按条件导出,将下面SQL语句的查询结果导出
export ORACLE_SID=sid
expdp system/password parfile=/home/oracle/backup/02.par
--执行SQL
select * from hx_ff.ff_ffkf a where substr(a.ssswjg_dm ,1,3) in ('137','237');
select * from hx_ff.ff_kfgly a where substr(a.kfgly_dm ,1,3) in ('137','237');
select * from hx_ff.ff_kfgly_dbffzl a where substr(a.lrr_dm ,1,3) in ('137','237');
select * from hx_ff.ff_DKff_TDZSBM a where substr(a.swjg_dm ,1,3) in ('137','237');
select * from hx_pz.PZ_JBJXPZ_JKMX_2014 where jbjxpzuuid in(select jbjxpzuuid from hx_pz.PZ_JBJXPZB_2014 where substr(pzjg_dm,1,3) in('137','237'));
--需导出的数据SQL
--编辑02.par文件
vi /home/oracle/backup/02.par
PARALLEL=10
cluster=no
COMPRESSION=ALL
DUMPFILE=HXff_%U.dmp
DIRECTORY=dp_dir
logfile=expdp_HXff.log
EXCLUDE=TRIGGER,INDEX,GRANT
tables=
(
hx_ff.ff_ffkf,
hx_ff.ff_kfgly,
hx_ff.ff_kfgly_dbffzl,
hx_ff.ff_DKff_TDZSBM,
hx_pz.PZ_JBJXPZ_JKMX_2014
)
query=
(
hx_ff.ff_ffkf:"where substr(ssswjg_dm ,1,3) in ('137','237')",
hx_ff.ff_kfgly:"where substr(kfgly_dm ,1,3) in ('137','237')",
hx_ff.ff_kfgly_dbffzl:"where substr(lrr_dm ,1,3) in ('137','237')",
hx_ff.ff_DKff_TDZSBM:"where substr(swjg_dm ,1,3) in ('137','237')",
hx_pz.PZ_JBJXPZ_JKMX_2014:"where jbjxpzuuid in(select jbjxpzuuid from hx_pz.PZ_JBJXPZB_2014 where substr(pzjg_dm,1,3) in('137','237'))"
)
--注意 :"冒号前无空格。表名不能重复使用,表不能有别名
阅读(1647) | 评论(0) | 转发(0) |