zl程序教程

您现在的位置是:首页 >  后端

当前栏目

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

导出方法数据 几种 压缩 11g
2023-09-14 08:57:30 时间
做一个简单的实验说明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