Upload
raoch
View
1
Download
0
Embed Size (px)
DESCRIPTION
Android and Technology scratch pad_ How to view Segment Advisor recommendations.pdf
Citation preview
HowtoviewSegmentAdvisorrecommendationsHere'saquicknoteonhowtoviewSegmentAdvisorrecommendationsusingtheASA_RECOMMENDATIONSfunctionoftheDBMS_SPACEpackage.Ifasegmentwouldbenefitfromasegmentshrink,reorganization,orcompression,theSegmentAdvisorgeneratesarecommendationforthesegment.Youcanviewresultsinthefollowingways:WithEnterpriseManagerByqueryingtheDBA_ADVISOR_*viewsBycallingtheDBMS_SPACE.ASA_RECOMMENDATIONSprocedureTheASA_RECOMMENDATIONSfunctionreturnsrecommendationsusingthestoredresultsoftheautosegmentadvisor.Thisfunctionreturnsresultsfromthelatestrunonanygivenobject.DBMS_SPACE.ASA_RECOMMENDATIONS(all_runsINVARCHAR2DEFAULT:=TRUE,show_manualINVARCHAR2DEFAULT:=TRUE,show_findingsINVARCHAR2DEFAULT:=FALSE)RETURNASA_RECO_ROW_TBPIPELINED;ASA_RECOMMENDATIONSProcedureParametersParameter Descriptionall_runsIfTRUE,returnsrecommendations/findingsforallrunsofautosegmentadvisor.IfFALSE,returnstheresultsoftheLATESTrunonly.LATESTdoesnotmakesenseformanualinvocationofsegmentadvisor.Thisisapplicableonlyforautoadvisor.show_manualIfTRUE,weshowtheresultsofmanualinvocationsonly.Theautoadvisorresultsareexcluded.IfFALSE,resultsofmanualinvocationofsegmentadvisorarenotreturned.show_findings ShowonlythefindingsinsteadoftherecommendationsHereisanexampleofhowtousetheDBMS_SPACE.ASA_RECOMMENDATIONSsubprogramtoviewtherecommendationsforallrunsofautosegmentadvisor.SELECTrecommendations,c1,c2,c3FROMtable(dbms_space.asa_recommendations('TRUE','FALSE','FALSE'));ASA_RECOMMENDATIONSFunctionSyntaxParametersUsageexamplec1c2c3recommendationsaltertable"U"."T1"shrinkspacealtertable"U"."T1"shrinkspaceCOMPACTaltertable"U"."T1"enablerowmovementEnablerowmovementofthetableU.T1andperformshrink,estimatedsavingsis351890073bytes.CompressobjectU.T2,estimatedsavingsis6998196224bytes.altertable"U"."T2"compressforoltpaltertable"U"."T2"moveThesearethecolumnsthatcanbeselectedwhenusingthefunction.Thisinformationisusefulwhenbuildingscriptstoautomaticallyactontherecommendations.ItcanbemoreconvenienttogettheinformationfromthisfunctioninsteadofjoiningthedifferentDBA_ADVISOR_*viewstogether.TABLESPACE_NAMESEGMENT_OWNERSEGMENT_NAMESEGMENT_TYPEPARTITION_NAMEALLOCATED_SPACEUSED_SPACERECLAIMABLE_SPACECHAIN_ROWEXCESSIOREQPMIOWAITPMIOWAITPRRECOMMENDATIONSC1C2C3TASK_IDMESG_IDColumnsoftheASA_RECOMMENDATIONSfunction