ITPub博客

首页 > 数据库 > Oracle > oracle按照表条件expdp导出数据

oracle按照表条件expdp导出数据

原创 Oracle 作者:ZQqzz 时间:2021-01-27 15:01:59 0 删除 编辑

编写导出脚本

 

 

1. 编写参数文件

 

 

 

如要导出的表的查询条件如下:

 

 

select * from mf_acct_dtl where acct_date>'2018-12-31' and acct_date<'2020-01-01'

select * from mf_sub_gen_led where acct_date>'2018-12-31' and acct_date<'2020-01-01'

select * from hs_acct_dtl where acct_date>'2018-12-31' and acct_date<'2020-01-01'

select * from hs_sub_gen_led where acct_date>'2018-12-31' and acct_date<'2020-01-01'

select * from fin_acct_dtl where acct_date>'2018-12-31' and acct_date<'2020-01-01'

select * from fin_sub_gen_led where acct_date>'2018-12-31' and acct_date<'2020-01-01'

 

 

 

 

参数文件 exp.par 内容如下:

 

DUMPFILE=20200226.dmp

DIRECTORY=DATA_PUMP_DIR

JOB_NAME=JOB02

TABLES=

(

MF_ACCT_DTL,

MF_SUB_GEN_LED,

HS_ACCT_DTL,

HS_SUB_GEN_LED,

FIN_ACCT_DTL,

FIN_SUB_GEN_LED

)

QUERY=

(

MF_ACCT_DTL:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'",

MF_SUB_GEN_LED:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'",

HS_ACCT_DTL:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'",

HS_SUB_GEN_LED:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'",

FIN_ACCT_DTL:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'",

FIN_SUB_GEN_LED:"where acct_date>'2018-12-31' and acct_date<'2020-01-01'"

)

 

2. 编写导出命令

 

 

 

expdp  "'" / as sysdba"'"  parfile=exp.par


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69993859/viewspace-2753726/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle TX锁的处理
请登录后发表评论 登录
全部评论
数据库DBA

注册时间:2021-01-25

  • 博文量
    13
  • 访问量
    19146