oracle 导出以开头的表,expdp导出时包含多个表

有时候在做expdp导出的时候,并不需要将整个schema都导出。只需将需要的表导出即可。本文就针对于需要导出多个表的场景进行一些分析:

1. 导出指定的多个表,比如导出A、B、C、D表

parfile:

userid=user/passwd

directory=expdir

dumpfile=testfile.dmp

include=table: " in ('PUB_GOODS','PUB_GOODS_UNIT') "

2. 导出指定的以A开头的表以及B开头的表

parfile:

userid=user/passwd

directory=expdir

dumpfile=testfile.dmp

include=table:"in(select table_name from user_tables where table_name like 'A%' or table_name like 'B%' ) "?

3. 导出某些无规律的表,有很多,也许需要动态维护

建立表exp_table

create table exp_table

(table_name varchar2(100);

然后将需要导出的表名插入exp_table中。

insert into exp_table values(‘A’);

insert into exp_table values(‘B’);

insert into exp_table values(‘PUB_GOODS’);

insert into exp_table values(‘PUB_GOODS_UNIT’);

最后导出的的时候:

parfile

userid=user/passwd

directory=expdir

dumpfile=testfile.dmp

include=table:" in (select table_name from exp_table ) "??

这样就可以导出exp_table中所包含的所有表了。更神奇的是,可以在exp_table里面将自己也插入进去,然后把exp_table也导出哦。

?

本文的示例都用parifle。因为这样更方便,也避免了字符转义的问题。

在编写好了parfile后,只需执行expdp parfile=即可。

?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值