
作者 | kf_dbd
来源 | 咖啡逗不逗(ID: kf_dbd)
转载请联系授权 | (微信ID:xh870545795)
大家好,我是 kf_dbd,很高兴又和大家见面了,今天分享一个数据泵参数的介绍文章。本文首发于微信公众号【咖啡逗不逗】,欢迎点击上方蓝字关注我吧!
[oracle@itdbcs ~]$sqlplus as sysdbaSQL> create or replace directory EXP as '/home/u01/expdp';--创建数据泵工作路径(前提/home/u01/expdp路径存在,不存在可新建)SQL>grant read,write on directory EXP to scott;--给权限
[oracle@itdbcs ~]$expdp scott/scott@PROD schemas=scott dumpfile=expdp.dmp DIRECTORY=EXP logfile=expdp.log
[oracle@itdbcs ~]$expdp scott/scott@PROD TABLES=emp,dept DIRECTORY=EXP dumpfile=expdp.dmp logfile=expdp.log;--还可以根据表的查询条件导:[oracle@itdbcs ~]$expdp scott/scott@PROD TABLES=emp DIRECTORY=EXP dumpfile=expdp.dmp logfile=expdp.log QUERY=\"where DEPTNO\='20'\"--注意转义符号
[oracle@itdbcs ~]$expdp \"\/ as sysdba\" DIRECTORY=EXP DUMPFILE=tablespace.dmp TABLESPACES=temp,users
[oracle@itdbcs ~]$expdp \"\/ as sysdba\" DIRECTORY=exp DUMPFILE=full_%U.dmp FULL=y parallel=4 filesize=500m compression=all cluster=n
DATA_ONLY :仅对表数据进行压缩,对于大数据量的导出效果明显,会比METADATA_ONLY方式得到更小的压缩文件。
METADATA_ONLY :仅对元数据进行压缩,而不会对表数据进行压缩,这种压缩执行后效果一般不是很明显,不过速度比较快。
NONE :不进行任何的压缩,导出后的文件也是最大的。
DEFAULT :默认方式,即不指定COMPRESSION参数,会采用默认的压缩方式METADATA_ONLY。

[oracle@itdbcs ~]$impdp scott/scott@PROD directory=exp dumpfile=expdp.dmp schemas=scott
[oracle@itdbcs ~]$impdp \"\/ as sysdba\" directory=EXP dumpfile=expdp.dmp tables=scott.dept,scott.emp remap_schema=scott:system
[oracle@itdbcs ~]$impdp \"\/ as sysdba\" directory=exp dumpfile=tablespace.dmp tablespaces=example
[oracle@itdbcs ~]$impdp \"\/ as sysdba\" directory=exp dumpfile=full_%U.dmp full=y parallel=4
[oracle@itdbcs ~]$impdp \" / as sysdba \" directory=exp dumpfile=full_%U.dmp schemas=scott remap_schema=scott:test transform=oid:n logfile=full.log parallel=4 data_options=skip_constraint_errors

文章转载自咖啡逗不逗,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




