昨晚同学问我一个他工作中的问题
要导出整个数据库,但要排除一张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/