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

Posted 九號客栈

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了『ORACLE』 数据泵Data Pump中expdp导出(11g)相关的知识,希望对你有一定的参考价值。

[[email protected] ~]$ mkdir datadump
[[email protected] ~]$ cd datadump/
[[email protected] 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.

导出表中指定行

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

[[email protected] 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导出表中指定行,用参数文件的好处是,特殊字符不用转义,密码也相对隐藏

[[email protected] datadump]$ vi par.txt

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

[[email protected] datadump]$ expdp parfile=par.txt

[[email protected] datadump]$ ls
emp30_2.dmp emp30_2.log emp.dmp export.log par.txt

导出表

[[email protected] datadump]$ rm *
[[email protected] datadump]$ ls
[[email protected] datadump]$ expdp scott/tiger directory = dir_dp dumpfile = emp.dmp tables = emp

[[email protected] datadump]$ ls
emp.dmp export.log

导出表空间

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

导出schema

[[email protected] datadump]$ expdp scott/tiger directory = dir_dp dumpfile = emp.scm schemas = scott
















以上是关于『ORACLE』 数据泵Data Pump中expdp导出(11g)的主要内容,如果未能解决你的问题,请参考以下文章

Data Pump(数据抽取)介绍

使用 Cloud Shell 导出数据泵

Oracle 数据泵导入导出(expdp/impdp)

Oracle 数据泵备份 带过滤条件的 数据表

数据泵导入(出)dmp文件

Data Pump Export 数据泵导出因ORA-31693 ORA-02354 和 ORA-01555 错误且没有LOB损坏而失败 (Doc ID 1507116.1)