ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 数据泵全库迁移,排除一个大表【kingsql作品】

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

原创 Linux操作系统 作者:kingsql 时间:2013-03-16 11:11:48 0 删除 编辑

昨晚同学问我一个他工作中的问题
要导出整个数据库,但要排除一张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博客 ” ,链接:https://blog.itpub.net/28389881/viewspace-756299/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
OCM

注册时间:2013-02-28

  • 博文量
    237
  • 访问量
    918362