2
How to view Segment Advisor recommendations Here's a quick note on how to view Segment Advisor recommendations using the ASA_RECOMMENDATIONSfunction of the DBMS_SPACE package. If a segment would benefit from a segment shrink, reorganization, or compression, the Segment Advisor generates a recommendation for the segment. You can view results in the following ways: With Enterprise Manager By querying the DBA_ADVISOR_* views By calling the DBMS_SPACE.ASA_RECOMMENDATIONS procedure The ASA_RECOMMENDATIONS function returns recommendations using the stored results of the auto segment advisor. This function returns results from the latest run on any given object. DBMS_SPACE.ASA_RECOMMENDATIONS ( all_runs IN VARCHAR2 DEFAULT := TRUE, show_manual IN VARCHAR2 DEFAULT := TRUE, show_findings IN VARCHAR2 DEFAULT := FALSE) RETURN ASA_RECO_ROW_TB PIPELINED; ASA_RECOMMENDATIONS Procedure Parameters Parameter Description all_runs If TRUE, returns recommendations/findings for all runs of auto segment advisor. If FALSE, returns the results of the LATEST run only. LATEST does not make sense for manual invocation of segment advisor. This is applicable only for auto advisor. show_manual If TRUE, we show the results of manual invocations only. The auto advisor results are excluded. If FALSE, results of manual invocation of segment advisor are not returned. show_findings Show only the findings instead of the recommendations Here is an example of how to use the DBMS_SPACE.ASA_RECOMMENDATIONS subprogram to view the recommendations for all runs of auto segment advisor. SELECT recommendations, c1, c2, c3 FROM table(dbms_space.asa_recommendations('TRUE', 'FALSE', 'FALSE')); ASA_RECOMMENDATIONS Function Syntax Parameters Usage example

Android and Technology Scratch Pad_ How to View Segment Advisor Recommendations

  • 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