陈奇网络工作室

使用&expdp&expdp备份数据时的估计大小——ESTIMATE参数

建设工作站服务器

通过EXPDP,可以在数据导出完成时,使用ESTIMATE参数评估导出的数据库对象的大小。 请简单说明一下作为参考。

显示有关ESTIMATE参数的帮助信息

1 )显示命令行帮助信息

ora10g@secDB /expdp$ expdp help=y

……

estimatecalculatejobestimateswherethevalidkeywordsare :

( BLOCKS )和静态。

……

2 ) Oracle官方文档的ESTIMATE参数说明

链接地址: http://download.Oracle.com/docs/CD/b 19306 _ 01/server.102/b 14215/DP _ export.htm # ST href 105

引用内容如下。

电话

默认: blocks

Purpose

特殊方法

Export will use to estimate how

muchdiskspaceeachtableintheexportjobwillconsume ( in bytes )。

theestimateisprintedinthelogfileanddisplayedontheclient\\ & amp; quot; s

sandardoutputdevice.theestimateisfortablerowdataonly; it does

非包含元数据。

同步和描述

ESTIMATE={BLOCKS | STATISTICS}

blockstheestimateiscalculatedbymultiplyingthe

numberofdatabaseblocksusedbythesourceobjects,times the

应用程序块大小。

tat isticstheestimateiscalculatedusingstatistics

foreach table.forthismethodtobeasaccurateaspossible,all

tablesshouldhavebeenanalyzedrecently。

重定义

ifthedatapumpexportjobinvolvescompressedtables,the default

sizeestimationgivenforthecompressedtableisinaccuratewhenestimate=blocks

is used.thisisbecausethesizeestimatedoesnotreflectthatthe

datawasstoredinacompressedform.togetamoreaccuratesize

estimate for compressed tables,use ESTIMATE=STATISTICS。

Example

thefollowingexampleshowsauseoftheestimate

parameterinwhichtheestimateiscalculatedusingstatisticsfortheemployes

制表:

expdp HR/HR tables=employees estimate=statistics directory=d pump _ dir 1

DUMPFILE=estimate_stat.dmp

将ESTIMATE参数显式指定为BLOCKS

ora 10g @ se CDB/expdp $ expdp sec/sec directory=expdp _ dir dump file=sec.DMP estimate=blocks

export:10.2.0.3.0版64 bitproductiononsaturday,10 April,2010年6月23日至26日

版权所有( c ) 2003,2005,Oracle. All rights reserved。

connected to:Oracle数据库10 genterpriseeditionrelease 10.2.0.3.064位产品

With the Partitioning,Oracle Label Security,olapanddataminingscoringengineoptions

starting sec.sys _ export _ schema _ 01:sec/* * * * * directory=expdp _ dir dump file=sec.DMP estimate=block

estimateinprogressusingblocksmethod…

processingobjecttypeschema _ export/table/table _ data

. estimated SEC.TEST_SEC 2 MB

. estimated SEC.TEST_SEC1 2 MB

. estimated SEC.TEST_SEC2 2 MB

totalestimationusingblocksmethod:6mb

processingobjecttypeschema _ export/user

processingobjecttypeschema _ export/system _ grant

processingobjecttypeschema _ export/role _ grant

processingobjecttypeschema _ export/default _ role

processingobjecttypeschema _ export/pre _ schema/proc act _ schema

processingobjecttypeschema _ export/table/table

processingobjecttypeschema _ export/table/index/index

processingobjecttypeschema _ export/table/constraint/constraint

processingobjecttypeschema _ export/table/index/statistics/index _ statistics

processingobjecttypeschema _ export/table/comment

. exported sec.test _ sec 1.018 MB 11716 rows

. exported sec.test _ sec 1.018 MB 11717 rows

. exported sec.test _ sec 21.018 MB 11718 rows

mastertablesec.sys _ export _ schema _ 01 successfully loaded/unloaded

********************************。

dumpfilesetforsec.sys _ export _ schema _ 01is :

/expdp/sec.dmp

job sec.sys _ export _ schema _ 01 successfullycompletedat 06:23:37

此时,对每个数据库块的估计单位进行统计,与最终导出的大小相比并不准确,但有一定的参考意义。

将ESTIMATE参数指定为静态

ora 10g @ se CDB/expdp $ expdp sec/sec directory=expdp _ dir dump file=sec.DMP estimate=statistics

export:10.2.0.3.0版64 bitproductiononsaturday,10 April,2010 6:22:02

版权所有( c ) 2003,2005,Oracle. All rights reserved。

connected to:Oracle数据库10 genterpriseeditionrelease 10.2.0.3.064位产品

With the Partitioning,Oracle Label Security,olapanddataminingscoringengineoptions

starting sec.sys _ export _ schema _ 01:sec/* * * * * directory=expdp _ dir dump file=sec.DMP estimate=statate

estimateinprogressusingstatisticsmethod…

processingobjecttypeschema _ export/table/table _ data

. estimated SEC.TEST_SEC 9.558 KB

. estimated SEC.TEST_SEC1 9.558 KB

. estimated SEC.TEST_SEC2 9.558 KB

totalestimationusingstatisticsmethod:28.67 kb

processingobjecttypeschema _ export/user

processingobjecttypeschema _ export/system _ grant

processingobjecttypeschema _ export/role _ grant

processingobjecttypeschema _ export/default _ role

processingobjecttypeschema _ export/pre _ schema/proc act _ schema

processingobjecttypeschema _ export/table/table

processingobjecttypeschema _ export/table/index/index

processingobjecttypeschema _ export/table/constraint/constraint

processingobjecttypeschema _ export/table/index/statistics/index _ statistics

processingobjecttypeschema _ export/table/comment

. exported sec.test _ sec 1.018 MB 11716 rows

. exported sec.test _ sec 1.018 MB 11717 rows

. exported sec.test _ sec 21.018 MB 11718 rows

mastertablesec.sys _ export _ schema _ 01 successfully loaded/unloaded

********************************。

dumpfilesetforsec.sys _ export _ schema _ 01is :

/expdp/sec.dmp

job sec.sys _ export _ schema _ 01 successfullycompletedat 06:22:14

这个时候的统计结果比较奇怪,为什么?

如果使用ESTIMATE=STATISTICS参数估计实际原因,则数据源是表中的分析数据,如果表未被分析或分析数据不准确,则会发生此处的数据失真。

4 .在数据库中分析sec用户,然后再次完成数据导出

1 ) sec用户分析

sys @ or a10 gexecdbms _ stats.gather _ schema _ stats ( own name=\& amp; quot; sec\\\& quot;ESTIMATE_PERCENT=10,destimate_percent ) 10

pl/sqlproceduresuccessfullycompleted。

2 )再次导出sec用户下的数据

ora 10g @ se CDB/expdp $ expdp sec/sec directory=expdp _ dir dump file=sec.DMP estimate=statistics

export:10.2.0.3.0版64 bitproductiononsaturday,10 April,2010年6月30日20点

版权所有( c ) 2003,2005,Oracle. All rights reserved。

connected to:Oracle数据库10 genterpriseeditionrelease 10.2.0.3.064位产品

With the Partitioning,Oracle Label Security,olapanddataminingscoringengineoptions

starting sec.sys _ export _ schema _ 01:sec/* * * * * directory=expdp _ dir dump file=sec.DMP estimate=statate

estimateinprogressusingstatisticsmethod…

processingobjecttypeschema _ export/table/table _ data

. estimated SEC.TEST_SEC2 993.6 KB

. estimated SEC.TEST_SEC1 993.6 KB

. estimated SEC.TEST_SEC 993.5 KB

totalestimationusingstatisticsmethod:2.910 MB

processingobjecttypeschema _ export/user

processingobjecttypeschema _ export/system _ grant

processingobjecttypeschema _ export/role _ grant

processingobjecttypeschema _ export/default _ role

processingobjecttypeschema _ export/pre _ schema/proc act _ schema

processingobjecttypeschema _ export/table/table

processingobjecttypeschema _ export/table/index/index

processingobjecttypeschema _ export/table/constraint/constraint

processingobjecttypeschema _ export/table/index/statistics/index _ statistics

processingobjecttypeschema _ export/table/comment

processingobjecttypeschema _ export/table/statistics/table _ statistics

. exported sec.test _ sec 21.018 MB 11718 rows

. exported sec.test _ sec 1.018 MB 11717 rows

. exported sec.test _ sec 1.018 MB 11716 rows

mastertablesec.sys _ export _ schema _ 01 successfully loaded/unloaded

********************************。

dumpfilesetforsec.sys _ export _ schema _ 01is :

/expdp/sec.dmp

job sec.sys _ export _ schema _ 01 successfullycompletedat 06:30:35

OK,此时的推测数据与最后的生成数据大小接近。

不指定ESTIMATE参数

ora 10g @ se CDB/expdp $ expdp sec/sec directory=expdp _ dir dump file=sec.DMP

export:10.2.0.3.0版64 bitproductiononsaturday,10 April,2010 7:26:54

版权所有( c ) 2003,2005,Oracle. All rights reserved。

connected to:Oracle数据库10 genterpriseeditionrelease 10.2.0.3.064位产品

With the Partitioning,Oracle Label Security,olapanddataminingscoringengineoptions

starting sec.sys _ export _ schema _ 01:sec/* * * * * directory=expdp _ dir dump file=sec.DMP

estimateinprogressusingblocksmethod…

processingobjecttypeschema _ export/table/table _ data

totalestimationusingblocksmethod:6mb

processingobjecttypeschema _ export/user

processingobjecttypeschema _ export/system _ grant

processingobjecttypeschema _ export/role _ grant

processingobjecttypeschema _ export/default _ role

processingobjecttypeschema _ export/pre _ schema/proc act _ schema

processingobjecttypeschema _ export/table/table

processingobjecttypeschema _ export/table/index/index

processingobjecttypeschema _ export/table/constraint/constraint

processingobjecttypeschema _ export/table/index/statistics/index _ statistics

processingobjecttypeschema _ export/table/comment

processingobjecttypeschema _ export/table/statistics/table _ statistics

. exported sec.test _ sec 1.018 MB 11716 rows

. exported sec.test _ sec 1.018 MB 11717 rows

. exported sec.test _ sec 21.018 MB 11718 rows

mastertablesec.sys _ export _ schema _ 01 successfully loaded/unloaded

********************************。

dumpfilesetforsec.sys _ export _ schema _ 01is :

/expdp/sec.dmp

job sec.sys _ export _ schema _ 01 successfullycompletedat 07:27:05

如果未指定ESTIMATE参数,则缺省情况下使用BLOCKS进行估计,但忽略特定数据库对象的估计,只提供以下信息:

totalestimationusingblocksmethod:6mb

6 .总结

ESTIMATE参数提供估计大小的功能,但在使用EXPDP备份数据时,请尽量不要使用。 所有额外的操作都需要成本。

好路克。

secooler

10.04.10

— The End —

详情请访问云服务器、域名注册、虚拟主机的问题,请访问西部数码代理商官方网站: www.chenqinet.cn

相关推荐

后台-系统设置-扩展变量-手机广告位-内容页底部广告位3