昨晚同学问我一个他工作中的问题

要导出整个数据库,但要排除一张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

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

Directory created.

>grant read,write on directory test to public;

Grant succeeded.

>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作品

转载请注明出处

如有问题请发电子邮件至

希望和大家一起交流

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐