oracle 11g的expdp工具提供了真正意义上的ldquo;备份压缩rdquo;,这个技术在备份空间不足的情况下非常实用。oracle在改进和优化
这个压缩比例可以和操作系统“gzip -9”相媲美,某些特例下有可能比gzip还要高效。体验之,供参考。
1.oracle 11g中expdp帮助页中关于compression参数的描述
secooler@secdb /home/oracle$ expdp -help
……
compression
reduce the size of a dump file.
valid keyword values are: all, data_only, [metadata_only] and none.
……
可见,11g中的compression参数提供四个选项,分别是all、data_only、metadata_only和none,非常的丰富,稍后我们将使用all参数进行操作。
2.oracle 10g中关于compression参数的描述如下
keyword description (default)
---------------------------------------------------------------------
……
compression reduce size of dumpfile contents where valid
keyword values are: (metadata_only) and none.
……
10g中的compression参数只提供metadata_only和none两个选项,,基本上没有提供压缩功能。
3.使用11g expdp工具的四个压缩参数分别生成四个dump文件
1)使用all参数
secooler@secdb /expdp$ expdp sec/sec dumpfile=sec_all.dmp logfile=sec_all.log tables=t directory=dump_dir compression=all
export: release 11.2.0.1.0 - production on sat mar 20 22:48:52 2010
copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production
with the partitioning, oracle label security, olap, data mining,
oracle database vault and real application testing options
starting sec.sys_export_table_01: sec/******** dumpfile=sec_all.dmp logfile=sec_all.log tables=t directory=dump_dir compression=all
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 136 mb
processing object type table_export/table/table
. . exported sec.t 14.26 mb 1155520 rows
master table sec.sys_export_table_01 successfully loaded/unloaded
******************************************************************************
dump file set for sec.sys_export_table_01 is:
/expdp/sec_all.dmp
job sec.sys_export_table_01 successfully completed at 22:49:08
2)使用data_only参数
secooler@secdb /expdp$ expdp sec/sec dumpfile=sec_data_only.dmp logfile=sec_data_only.log tables=t directory=dump_dir compression=data_only
export: release 11.2.0.1.0 - production on sat mar 20 22:49:32 2010
copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production
with the partitioning, oracle label security, olap, data mining,
oracle database vault and real application testing options
starting sec.sys_export_table_01: sec/******** dumpfile=sec_data_only.dmp logfile=sec_data_only.log tables=t directory=dump_dir compression=data_only
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 136 mb
processing object type table_export/table/table
. . exported sec.t 14.26 mb 1155520 rows
master table sec.sys_export_table_01 successfully loaded/unloaded
******************************************************************************
dump file set for sec.sys_export_table_01 is:
/expdp/sec_data_only.dmp
job sec.sys_export_table_01 successfully completed at 22:49:48
3)使用metadata_only参数
secooler@secdb /expdp$ expdp sec/sec dumpfile=sec_metadata_only.dmp logfile=sec_metadata_only.log tables=t directory=dump_dir compression=metadata_only
export: release 11.2.0.1.0 - production on sat mar 20 22:50:16 2010
copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production
with the partitioning, oracle label security, olap, data mining,
oracle database vault and real application testing options
starting sec.sys_export_table_01: sec/******** dumpfile=sec_metadata_only.dmp logfile=sec_metadata_only.log tables=t directory=dump_dir compression=metadata_only
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 136 mb
processing object type table_export/table/table
. . exported sec.t 111.7 mb 1155520 rows
master table sec.sys_export_table_01 successfully loaded/unloaded
******************************************************************************
dump file set for sec.sys_export_table_01 is:
/expdp/sec_metadata_only.dmp
job sec.sys_export_table_01 successfully completed at 22:50:27
4)使用none参数
secooler@secdb /expdp$ expdp sec/sec dumpfile=sec_none.dmp logfile=sec_none.log tables=t directory=dump_dir compression=none
export: release 11.2.0.1.0 - production on sat mar 20 22:50:43 2010
copyright (c) 1982, 2009, oracle and/or its affiliates. all rights reserved.