11g 导出数据时的几种压缩方法

做一个简单的实验说明compress 参数的用法。
compression=all:对于ALL方式,数据泵会对导出的源数据和表数据都进行压缩,顾名思义,这种方式得到的数据泵导出文件是最小的,不过用时相对也会比较长:
在我这里由于数据量的关系,时间大小不具有可比性。
C:\Users\aaaa>expdp yang/yang tables=yang_part3 directory=dumpdir dumpfile=yang_all.dmp compression=all
Export: Release 11.1.0.6.0 - Production on 星期三, 30 3月, 2011 22:58:10
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "YANG"."SYS_EXPORT_TABLE_01":  yang/******** tables=yang_part3 directory=dumpdir dumpfile=yang_
all.dmp compression=all
正在使用 BLOCKS 方法进行估计...
处理对象类型 TABLE_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 832 KB
处理对象类型 TABLE_EXPORT/TABLE/TABLE
. . 导出了 "YANG"."YANG_PART3":"P201004"               119.7 KB    4513 行
. . 导出了 "YANG"."YANG_PART3":"P201002"               62.79 KB    2258 行
. . 导出了 "YANG"."YANG_PART3":"P201003"               64.47 KB    2325 行
. . 导出了 "YANG"."YANG_PART3":"P201001"               28.35 KB     904 行
. . 导出了 "YANG"."YANG_PART3":"P2009"                     0 KB       0 行
已成功加载/卸载了主表 "YANG"."SYS_EXPORT_TABLE_01"
******************************************************************************
YANG.SYS_EXPORT_TABLE_01 的转储文件集为:
  D:\DUMP\YANG_ALL.DMP
作业 "YANG"."SYS_EXPORT_TABLE_01" 已于 22:58:26 成功完成
耗时:16秒
compression=data_only:对于DATA_ONLY方式,数据泵对表数据进行压缩,这种压缩方式对于大数据量的导出效果明显,一般来说,这种方式回比METADATA_ONLY方式得到更小的压缩文件:
C:\Users\aaaa>expdp yang/yang tables=yang_part3 directory=dumpdir dumpfile=yang_data.dmp compression=data_only
Export: Release 11.1.0.6.0 - Production on 星期三, 30 3月, 2011 22:59:42
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "YANG"."SYS_EXPORT_TABLE_01":  yang/******** tables=yang_part3 directory=dumpdir
dumpfile=yang_data.dmp compression=data_only
正在使用 BLOCKS 方法进行估计...
处理对象类型 TABLE_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 832 KB
处理对象类型 TABLE_EXPORT/TABLE/TABLE
. . 导出了 "YANG"."YANG_PART3":"P201004"               119.7 KB    4513 行
. . 导出了 "YANG"."YANG_PART3":"P201002"               62.79 KB    2258 行
. . 导出了 "YANG"."YANG_PART3":"P201003"               64.47 KB    2325 行
. . 导出了 "YANG"."YANG_PART3":"P201001"               28.35 KB     904 行
. . 导出了 "YANG"."YANG_PART3":"P2009"                     0 KB       0 行
已成功加载/卸载了主表 "YANG"."SYS_EXPORT_TABLE_01"
******************************************************************************
YANG.SYS_EXPORT_TABLE_01 的转储文件集为:
  D:\DUMP\YANG_DATA.DMP
作业 "YANG"."SYS_EXPORT_TABLE_01" 已于 23:00:01 成功完成
耗时:19秒

compression=none不进行任何的压缩,导出后数据文件也是最大的:
C:\Users\aaaa>expdp yang/yang tables=yang_part3 directory=dumpdir dumpfile=yang_none.dmp compression=none
Export: Release 11.1.0.6.0 - Production on 星期三, 30 3月, 2011 23:00:49
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "YANG"."SYS_EXPORT_TABLE_01":  yang/******** tables=yang_part3 directory=dumpdir
dumpfile=yang_none.dmp compression=none
正在使用 BLOCKS 方法进行估计...
处理对象类型 TABLE_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 832 KB
处理对象类型 TABLE_EXPORT/TABLE/TABLE
. . 导出了 "YANG"."YANG_PART3":"P201004"               217.6 KB    4513 行
. . 导出了 "YANG"."YANG_PART3":"P201002"                 112 KB    2258 行
. . 导出了 "YANG"."YANG_PART3":"P201003"               115.1 KB    2325 行
. . 导出了 "YANG"."YANG_PART3":"P201001"               48.56 KB     904 行
. . 导出了 "YANG"."YANG_PART3":"P2009"                     0 KB       0 行
已成功加载/卸载了主表 "YANG"."SYS_EXPORT_TABLE_01"
******************************************************************************
YANG.SYS_EXPORT_TABLE_01 的转储文件集为:
  D:\DUMP\YANG_NONE.DMP
作业 "YANG"."SYS_EXPORT_TABLE_01" 已于 23:01:16 成功完成
耗时27秒

对于METADATA_ONLY方式,数据泵只对源数据进行压缩,而不会压缩数据文件,这种压缩执行后效果一般不是很明显,不过速度比较快:
C:\Users\aaaa>expdp yang/yang tables=yang_part3 directory=dumpdir dumpfile=yang_metadata_only.dmp compression=metadata_only

Export: Release 11.1.0.6.0 - Production on 星期三, 30 3月, 2011 23:01:50
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "YANG"."SYS_EXPORT_TABLE_01":  yang/******** tables=yang_part3 directory=dumpdir dumpfile=yang_
metadata_only.dmp compression=metadata_only
正在使用 BLOCKS 方法进行估计...
处理对象类型 TABLE_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 832 KB
处理对象类型 TABLE_EXPORT/TABLE/TABLE
. . 导出了 "YANG"."YANG_PART3":"P201004"               217.6 KB    4513 行
. . 导出了 "YANG"."YANG_PART3":"P201002"                 112 KB    2258 行
. . 导出了 "YANG"."YANG_PART3":"P201003"               115.1 KB    2325 行
. . 导出了 "YANG"."YANG_PART3":"P201001"               48.56 KB     904 行
. . 导出了 "YANG"."YANG_PART3":"P2009"                     0 KB       0 行
已成功加载/卸载了主表 "YANG"."SYS_EXPORT_TABLE_01"
******************************************************************************
YANG.SYS_EXPORT_TABLE_01 的转储文件集为:
  D:\DUMP\YANG_METADATA_ONLY.DMP
作业 "YANG"."SYS_EXPORT_TABLE_01" 已于 23:02:11 成功完成

耗时21秒
C:\Users\aaaa>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22664653/viewspace-691337/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22664653/viewspace-691337/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值