数据泵全库迁移,排除一个大表【kingsql作品】

昨晚同学问我一个他工作中的问题
要导出整个数据库,但要排除一张50G的大表
我查看了数据泵的语法,找到解决办法,只需要分2步导出即可

第一步:排除该用户,导出全库;第二步:排除该表,导出该用户
以scott.dept为例子,假设它就是那个50G的大表
[oracle@hong ~]$ mkdir -p /home/oracle/dir_test
[oracle@hong ~]$ export ORACLE_SID=hzh
[oracle@hong ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 16 11:02:28 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SYS@hzh >create or replace directory test as '/home/oracle/dir_test';

Directory created.

SYS@hzh >grant read,write on directory test to public;

Grant succeeded.

SYS@hzh >exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@hong ~]$ expdp system/oracle directory=test dumpfile=test1.dmp logfile=test1.log full=y exclude=schema:"IN('SCOTT')"

输出略

[oracle@hong ~]$ expdp scott/oracle directory=test dumpfile=test2.dmp logfile=test2.log exclude=table:"IN('DEPT')"

输出略

[oracle@hong ~]$ ll dir_test/
total 65100
-rw-r----- 1 oracle oinstall 66347008 Mar 16 11:06 test1.dmp
-rw-r--r-- 1 oracle oinstall    54791 Mar 16 11:06 test1.log
-rw-r----- 1 oracle oinstall   176128 Mar 16 11:08 test2.dmp
-rw-r--r-- 1 oracle oinstall     1530 Mar 16 11:08 test2.log

 

--kingsql作品

转载请注明出处

如有问题请发电子邮件至hongzhuohui@kingsql.com

希望和大家一起交流


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

转载于:http://blog.itpub.net/28389881/viewspace-756299/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值