Professional Documents
Culture Documents
ASA_RECOMMENDATIONSFunction
Here'saquicknoteonhowtoviewSegmentAdvisorrecommendationsusing
theASA_RECOMMENDATIONSfunctionoftheDBMS_SPACEpackage.
Ifasegmentwouldbenefitfromasegmentshrink,reorganization,orcompression,theSegmentAdvisor
generatesarecommendationforthesegment.
Youcanviewresultsinthefollowingways:
WithEnterpriseManager
ByqueryingtheDBA_ADVISOR_*views
BycallingtheDBMS_SPACE.ASA_RECOMMENDATIONSprocedure
TheASA_RECOMMENDATIONSfunctionreturnsrecommendationsusingthestoredresultsoftheautosegment
advisor.Thisfunctionreturnsresultsfromthelatestrunonanygivenobject.
Syntax
DBMS_SPACE.ASA_RECOMMENDATIONS(
all_runsINVARCHAR2DEFAULT:=TRUE,
show_manualINVARCHAR2DEFAULT:=TRUE,
show_findingsINVARCHAR2DEFAULT:=FALSE)
RETURNASA_RECO_ROW_TBPIPELINED;
Parameters
ASA_RECOMMENDATIONSProcedureParameters
Parameter
Description
all_runs
IfTRUE,returnsrecommendations/findingsforallrunsofautosegment
advisor.IfFALSE,returnstheresultsoftheLATESTrunonly.LATESTdoesnot
makesenseformanualinvocationofsegmentadvisor.Thisisapplicable
onlyforautoadvisor.
IfTRUE,weshowtheresultsofmanualinvocationsonly.Theautoadvisor
resultsareexcluded.IfFALSE,resultsofmanualinvocationofsegment
advisorarenotreturned.
show_findings Showonlythefindingsinsteadoftherecommendations
show_manual
Usageexample
HereisanexampleofhowtousetheDBMS_SPACE.ASA_RECOMMENDATIONSsubprogramtoviewthe
recommendationsforallrunsofautosegmentadvisor.
SELECTrecommendations,c1,c2,c3
FROMtable(dbms_space.asa_recommendations('TRUE','FALSE','FALSE'));
c1
c2
c3
recommendations
altertable"U"."T1"shrinkspace
altertable"U"."T1"shrinkspaceCOMPACT
altertable"U"."T1"enablerowmovement
EnablerowmovementofthetableU.T1andperformshrink,estimated
savingsis351890073bytes.
CompressobjectU.T2,estimatedsavingsis6998196224bytes.
altertable"U"."T2"compressforoltp
altertable"U"."T2"move
<null>
ColumnsoftheASA_RECOMMENDATIONSfunction
Thesearethecolumnsthatcanbeselectedwhenusingthefunction.Thisinformationisusefulwhenbuilding
scriptstoautomaticallyactontherecommendations.Itcanbemoreconvenienttogettheinformationfrom
thisfunctioninsteadofjoiningthedifferentDBA_ADVISOR_*viewstogether.
TABLESPACE_NAME
SEGMENT_OWNER
SEGMENT_NAME
SEGMENT_TYPE
PARTITION_NAME
ALLOCATED_SPACE
USED_SPACE
RECLAIMABLE_SPACE
CHAIN_ROWEXCESS
IOREQPM
IOWAITPM
IOWAITPR
RECOMMENDATIONS
C1
C2
C3
TASK_ID
MESG_ID