You are on page 1of 4

ConcurrentProcessingHowToGatherStatisticsOnOracleApplicationsRelease11i

and/orRelease12ConcurrentProcess,TempTables,Manually(DocID419728.1)
InthisDocument
Goal
Solution

TorunconcurrentprogramGatherSchemaStatistics:

GatheringStatisticsConcurrentRequests

ManualExecution

AutomaticStatisticGathering

VerifyingStatistics

References

APPLIESTO:
OracleConfiguratorVersion11.5.10.2andlater
OracleCostManagementVersion11.5.10.0andlater
OracleiProcurementVersion11.5.10andlater
OracleApplicationObjectLibraryVersion11.5.10.0andlater
OracleShippingExecutionVersion11.5.10.0andlater
Informationinthisdocumentappliestoanyplatform.
EXECUTABLE:FNDGSCSTGatherSchemaStatistics
EXECUTABLE:FNDGTSTGatherTableStatistics

GOAL

HowdoesonegatherschemastatisticsinOracleApplicationsR11iand/orR12?

SOLUTION
PriortoRelease11i,OracleApplicationshavedefaultedtousetheRuleBasedOptimizer.Oracle'sApplications
developmentteamhasreviewedSQLstatementsin11itotunethemforusebytheCostBasedOptimizer(CBO).CBO
usesstatisticstodecidetheexecutionofSQLstatements.
FND_STATSisavitalpartofcollectingthisdata.
ProperconfigurationofyourOracleserverrequiresthatyougatherstatisticsfortheobjectsinyourdatabase.
Recommendationisthatyougathernewstatisticsafterthecompletionofanupgradeorinstallation,uponloadinglarge
amountsofdataintothedatabase,andthereaftergatherstatisticsonaregularbasis.Ifyourunintoaperformance
issue,ensurestatisticshavebeenrecentlygatheredonemayreferencegatheringschemastatisticswhichwould
betherecommendedactiontotake.
Notethatobjectswithahighthroughput,and/orlargedatavolumesmayrequirethatstatisticsbegatheredmore
frequently,suchasdaily.IfyouuseOracleApplications,itisrecommendedthatyouruntheconcurrent
programs(detailstofollow)forgatheringstatistics.IfyouloadinterfacetablesforAPIuse,thereisanexample
methodtogatherstatisticsasillustratedbytheAdvancedPricingdetailedbelow.AlsoManualexecutionstepsandhow
togatherstaticsontemporarytablesarelisted.

TorunconcurrentprogramGatherSchemaStatistics:
1.LogontoOracleApplicationswith
Responsibility=SystemAdministrator
2.SubmitRequestWindow
Navigateto:List>Request>Run.
3.Entertheappropriateparameters.Thiscanberunforspecific
schemasbyspecifyingtheschemanameorentering'ALL'togather
statisticsforeveryschemainthedatabase.
4.Submitthegatherschemastatisticsprogram.

GatheringStatisticsConcurrentRequests
OracleApplicationsprovidesasetofproceduresintheFND_STATSpackagetofacilitatecollectionofthesestatistics.
FND_STATSusestheDBMS_STATSpackagetogatherstatistics.
ThefollowingconcurrentrequestsareavailableinOracleApplicationsforgatheringstatistics:
GatherAllColumnStatistics
GatherColumnStatistics
GatherSchemaStatistics
GatherTableStatistics
ForOracleApplications11iitisrecommendedtouseonlythe'GatherSchemaStatistics'orthe'GatherTable
Statistics'.PleaserefertotheOracleApplicationSystemAdministrationGuideforconcurrentrequestparameters.Here
arecommonparametersandtheirmeanings:
Schemaname
YoumayenterALLtoanalyzeeverydefinedAppschema.
Estimate_percent
Percentageofrowstoestimate.Ifleftemptyitwilldefaultto10%.Thevalidrangeis099.Ahigherpercentagewill
bemoreaccurate,buttakelongertorun.Iftheobject(s)thatyouaregatheringstatisticsfordonotchangeoftenor
theobject(s)hasdataenteredthatisverysimilaryoumaychoosealowernumber.However,ifthedatachanges
frequentlyalargernumberenteredforthisparameterwouldberecommendedtoprovideamoreaccurate
representationofyourdata.
Degree
EntertheDegreeofparallelism.Ifnotentered,itwilldefaulttomin(cpu_count,parallel_max_servers).Modifyingthe
degreeofparallelismonatablecancausetheplantochange.Increasingthedegreeofparallelismislikelytomake
fulltablescansappearcheaperandmoreattractivewhilereducingitwillmakeFullTableScanslooklessattractive.
BackupFlag
Ifthevalueis'NOBACKUP'thenitwon'ttakeabackupofthecurrentstatisticsandshouldrunquicker.Ifthevalueis
'BACKUP'thenitdoesanexport_table_statspriortogatheringthestatistics.
RestartRequestId
Entertherequestidthatshouldbeusedforrecoveringgather_schema_statsifthisrequestshouldfail.Youmayleave
thisparameternull.
GatherOptions
Asof11.5.10,FND_STATS.GATHER_SCHEMA_STATSintroducedanewparametercalledOPTIONSthat,ifsetto
GATHERAUTO,allowsFND_STATStoautomaticallydeterminethetablesforwhichstatisticsshouldbegatheredbased
onthechangethreshold.TheModificationsThresholdcanbeadjustedbytheuserbypassingavalueformodpercent,
whichbydefaultisequalto10.GATHERAUTOusesadatabasefeaturecalledTableMonitoring,whichneedstobe
enabledforallthetables.AprocedurecalledENABLE_SCHEMA_MONITORINGhasbeenprovidedtoenablemonitoring
onalltablesforagivenschemaorallApplicationsschemas.

ManualExecution
InR11icustomersshouldbeusingtheFND_STATScommand.
DonotusetheANALYZEcommandorDBMS_STATSpackagedirectly,
asdoingsomaycauseincompletestatisticstobegenerated.
Usethefollowingcommandtogatherschemastatistics:
execfnd_stats.gather_schema_statistics('ONT')<Foraspecificschema>
execfnd_stats.gather_schema_statistics('ALL')<Forallschemas>
Usethefollowingcommandforgatheringstatisticsonatemporarytable
(ie:temporarytablename=TEMP_tmpinschemaABC):
execfnd_stats.gather_table_stats('ABC','TEMP_tmp')
GatheringstatisticsafterpopulationforQP(AdvancedPricing)Interfacetables:
Reference:Note394687.1BulkLoadPriceListOpenInterfaceSlowPerformance

AutomaticStatisticGathering
Note377152.1BestPracticesforautomaticstatisticscollectionon10g

VerifyingStatistics
Note163208.1bde_last_analyzed.sqlVerifiesCBOStatistics
CREATEINDEXwithCOMPUTEoptiondoesnotgatherstatistics.
==============================================
PleasereferenceNote5352807.8Bug5352807CREATEINDEXwithCOMPUTEoptiondoesnotgatherstatistics
AdditionalResources
Pleaserefertothefollowingarticlesdependingontheversioninquestion:
Document1445302.1HowtoGatherOptimizerStatisticson12c
Document749227.1*HowtoGatherOptimizerStatisticson11g
Document605439.1*HowtoGatherOptimizerStatisticson10g
Document388474.1*HowtoGatherOptimizerStatisticson9i
Document114671.1GatheringStatisticsfortheCostBasedOptimizer(Pre10g)
BestPractices
ProActiveProblemAvoidanceandDiagnosticCollection
Althoughsomeproblemsmaybeunforeseen,inmanycasesproblemsmaybeavoidableifsignsaredetectedearly
enough.Additionally,ifanissuedoesoccur,itisnousecollectinginformationaboutthatissueaftertheevent.For
informationonsuggesteduses,otherproactivepreparationsanddiagnostics,see:
Document1482811.1BestPractices:ProactivelyAvoidingDatabaseandQueryPerformanceIssues
Document1477599.1BestPracticesAroundDataCollectionForPerformanceIssues

REFERENCES
BUG:5352807CREATINGINDEXIN10.2.0.2WITHCOMPUTEOPTIONDOESNOTGATHERSTATISTICS
NOTE:122371.1HowToGatherStatisticsForOracleApplicationsPriorto11.5.10

NOTE:163208.1bde_last_analyzed.sqlVerifiesCBOStatistics
NOTE:377152.1BestPracticesforAutomaticStatisticsCollection
NOTE:394687.1BulkLoadPriceListOpenInterfaceSlowPerformance
NOTE:5352807.8Bug5352807CREATEINDEXwithCOMPUTEoptiondoesnotgatherstatistics
Didn'tfindwhatyouarelookingfor?

You might also like