码迷,mamicode.com
首页 > 数据库 > 详细

『ORACLE』 数据泵Data Pump中expdp导出(11g)

时间:2017-05-24 23:52:54      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:acl   director   style   bsp   exp   ora   pwd   好处   users   

[oracle@enmo1 ~]$ mkdir datadump
[oracle@enmo1 ~]$ cd datadump/
[oracle@enmo1 datadump]$ pwd
/home/oracle/datadump

SQL> create or replace directory dir_dp as ‘/home/oracle/datadump‘;

Directory created.

SQL> grant read,write on directory dir_dp to scott;

Grant succeeded.

导出表中指定行

[oracle@enmo1 datadump]$ expdp scott/tiger directory = dir_dp dumpfile = emp.dmp tables = emp  query = "‘where deptno = 30 ‘"

[oracle@enmo1 datadump]$ ll
total 136
-rw-r----- 1 oracle oinstall 131072 May 24 21:21 emp.dmp
-rw-r--r-- 1 oracle oinstall 1244     May 24 21:21 export.log

parfile导出表中指定行,用参数文件的好处是,特殊字符不用转义,密码也相对隐藏

[oracle@enmo1 datadump]$ vi par.txt

userid=scott/tiger
directory=dir_dp
dumpfile=emp30_2.dmp
logfile=emp30_2.log
tables=emp
query=‘where deptno = 30‘

[oracle@enmo1 datadump]$ expdp parfile=par.txt

[oracle@enmo1 datadump]$ ls
emp30_2.dmp emp30_2.log emp.dmp export.log par.txt

导出表

[oracle@enmo1 datadump]$ rm *
[oracle@enmo1 datadump]$ ls
[oracle@enmo1 datadump]$ expdp scott/tiger directory = dir_dp dumpfile = emp.dmp tables = emp

[oracle@enmo1 datadump]$ ls
emp.dmp export.log

导出表空间

[oracle@enmo1 datadump]$ expdp system/oracle directory = dir_dp dumpfile = emp.tbp tablespaces = users

导出schema

[oracle@enmo1 datadump]$ expdp scott/tiger directory = dir_dp dumpfile = emp.scm schemas = scott

『ORACLE』 数据泵Data Pump中expdp导出(11g)

标签:acl   director   style   bsp   exp   ora   pwd   好处   users   

原文地址:http://www.cnblogs.com/KT-melvin/p/6901253.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!