Sie sind auf Seite 1von 9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

GettingStarted Newsletters

LogOn

Hi,Guest

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

Communications

Actions

SAPERPFinancialsControlling

Howtoanalyzeperformanceproblem
PostedbyOwenLiuinSAPERPFinancialsControllingonApr21,20154:15:51PM
Share

Tweet

Like

PerformanceProblemGuideTipsandTricks

Purpose

PerformanceproblemalwayshappenduringCOperiodendclosing.
Itsalwaysnotclearwhattodowhenwemeetperformanceproblem.
Thisblogwillguideyouwhattodowithdetailedsteps.

InitialAnalysis

NecessaryInformation
Afteryougetaincidentofperformanceissue,firstyouneedtoknowbelowinformation:
Whatistheprogram/Tcodeused?
Whatsthestatusofthejob?Isitstillrunning?Howlonghaveitbeenrunning?Whatsthenormalfinishtime?
Havethisissuehappenedbefore?Ifyes,howwasitsolved?
IsthereanyDBupdate,Kernelupdate,supportpackageupdaterecently?
Istheperformanceproblemforthisjobonlyorsystemlevel?

CheckJobwithSM37

Firstofall,ofcourse,youneedtologontothesystem.
Step1.Tcode:SM37tocheckthejob
TheeasywaytofindthejobistouseJobname.
Youcanalsoselectthejobaccordingtostatus.
Sometimesthejobnamesareidentical,weneedtofindtheexactjobbyselectthestartcondition.

Step1.Tcode:SM37tocheckthejob
TheDurationtimeisthemostimportantfigureinthispage.
Clickthisbuttontoshowthelog.Youcancheckwhetherthereareanyerrormessages.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

1/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

ClickParameter,thenclickMENUGotoVarianttocheckthevariantthisjobisusing.Seenextscreen>
Hereistheprogramname.

Hereyoucanseealltheparametersforthejob.

BackgroundTracewithST12

BackgroundtracewithST12
Iftheperformanceissueisreproducible,thiswillbethebest.SincewecanstartaST12traceforthejob.The
performancedatacollectedwillbemoreaccurateandeasytoanalyze.

YouneedtomakesettingsforST12first.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

2/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

Checkcurrentsystemtime
Thencheckthecurrenttimeforthesystem(sometimesthesystemyouareusingiswithdifferenttimezone)
ClickMENUSystemStatus..
Hereisthecurrentsystemtime.

Schedulethejob
Openanewsession,andgototheTcodeyouwanttotraceandschedulethejob.
Remembertousebackgroundprocessing.
Settheexecutiontime.(Accordingtocurrentsystemtime)
ClickConfirm.

ScheduleST12trace
GobacktoST12
ClickMENUUtilitiesScheduletraceForBatchjoborworkprocess
Inputthejobnameinthelastpage.
Ifthejobnameisnotidentical,youcanuseusernameandprogramnameto

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

3/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

WeneedtosettheFromtimeaccordingtothejobstarttime.Totime,setittoonehourlater.
ChangeIntervalto10sec
InputameaningfulComment
Atlast,pressScheduletrace

ScheduleST12trace
Ifthetraceissuccessfullycollected,youshouldbeabletoseebelowstatusinthetracelist:
GobacktotheinitialscreenofST12,onthebottomofthepage,youshouldbeabletoselectandcheckthetrace
result:

CheckTraceResult
NowclicktheABAPtracebutton,belowscreenwillshowup:
Pleasechecknextscreenfordetailexplanation.

AdvancedAnalysis

CheckTraceResult
First,pleasecheckthetimepercentagebar.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

4/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

IfABAPtakesthemosttime,itshouldbeprogramproblem,whichshouldbeanalyzedbytheteamthatownsthe
program.Butforperformanceissueswhichtakelongtime,90%oftheissuesarecausedbyDB.
SomostofthetimeDatabasewilltakethemosttime.NormallyDatabasewillshowabove75%ofthetotaltime.In
fact,ifyougetthisresult.
Ifyouwanttocontinuetheanalysis:
FirstyoucansortdescendingbyNettime,thenyoucanseethefirstlineshowstheCallwhichtakesthemosttime.
Normallythisshouldbethecausefortheperformanceproblem.
Asyoucanseeintheexample,thetimeaccessingtableKEKOtakesthemosttime.Sofirstyoucantrytosearch
NoteswithkeywordsProgramName+TableName+Performance.
YoucanclickDB>tocheckmoredetail.

CheckExecutionPlan
YoucanseeherearethelistofrelevantstatementsaccessingtableKEKO.
YoucanselectthemostexpensiveoneandclickbuttonExplain.

CheckExecutionPlan
HereyoucanseetheexecutionplanforthisSQLstatement:

Index
FirstweneedtounderstandwhatisIndex:
WhenyoulookupbusinessesinaYellowPagestelephonebook,youprobablyneverconsiderreadingtheentire
telephonebookfromcovertocover.Youmorelikelyopenthebooksomewhereinthemiddleandzeroinonthe
requiredbusinessbysearchingbackandforthafewtimes,usingthefactthatthenamesaresortedalphabetically.
Onewayforthedatabasetodealwithanunsortedtableisbyusingatimeconsumingsequentialreadrecordby
record.TosavethedatabasefromhavingtoperformasequentialreadforeverySQLstatementquery,eachdatabase
tablehasacorrespondingprimaryindex.
ThenweneedtounderstandthedifferencebetweenPrimaryIndexandSecondaryIndex:
WecanconsiderthekeyfieldscombinationofatableisthePrimaryIndex.YoucancheckwithSE11foreachtableto
finditskeyfields.
Aprimaryindexisalwaysuniquethatis,foreachcombinationofindexfields,thereisonlyonetableentry.
SometimesthePrimaryIndexisnotsufficient.WeneedtodefineaSecondaryIndexthatcontainsthefieldsweneed.
YoucanalsocheckSecondaryIndexwithSE11byclickingbuttonIndexes.
Forexample,MaterialNumberisnotakeyfieldoftableKEKO.IfwewanttosearchbyMaterialNumber,wecan
defineaSecondaryIndexonthefieldMaterialNumber.WecancheckinSE11,KEKO~AistheSecondaryIndexwe
talkedabout.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

5/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

RootCause
Wehaveknownhowtochecktheexecutionplanandtheuseofindexes.Nowletsdiscussthecausesof
performanceissue.
Basicallythereare2kindsofissues:
Indexismissing.
WrongIndexisused.
(TestingcanbeperformedviaST05EnterSQLStatement)

Indexismissing.
Forexample,whensearchKEKOwithZIFFR,sinceitsnotinPrimaryIndexandnoSecondaryIndexcreated,system
needtomakefulltablescan.
IfthefieldZIFFRcontainsalotofuniquevalues,thisfulltablescanwillbeverytimeconsuming.

Solution:DefinenewSecondaryIndexforthetable.

WrongIndexisused.
Sometimes,althoughthecorrectindexexists,duetosomereasons,theoptimizerstillchoosesthewrongindex.
oThismightbecausebyobsoletetablestatistics.Whentherearechangestothetableindexes,tablestatisticsneedto
beupdatedmanually.
oWithsomedatabase(e.g.MSSQLServer),theexecutionplandoesntchangepereachcall,sometimesitfollowsthe
lastcallsexecutionplan.Sotherethewrongindexmightbeused.
Solutions:
Updatetablestatistics.
CreateDBhints(ReferenceNote2006946)

Howtoupdatetablestatistics
Tcode:DB02

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

6/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

WhenJobisstillrunningornotreproducible

Jobisstillrunning.
AnalyzewithSM50
Normallyissuehappensononeortwotables,whenyoukeeprefreshthescreen,thetableremainsthesame.Then
youshouldfindoutthestatementandchecktheexecutionplan.
ViaMENUAdministrationProgramDebugging,youcanstartdebuggingandfindoutthestatementwhichiscurrently
beingread.

TracewithST12
Ifthejobisrunningforalongtimeandisstillrunning.YoucandoST12traceforthejobforaperiodlikewedidin
partI.
YoucangetthejobdetailsfromSM37.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

7/9

4/21/2015

Howtoanalyzeperformanceproblem|SCN

CheckwithSTAD
Ifcantreproducetheissueagain.WecancheckthestatusduringjobrunningtimeviaSTAD.

YoucanchecktheresultforDatabaserequesttime.

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

8/9

4/21/2015
128Views

Howtoanalyzeperformanceproblem|SCN

Topics:performanceTags:background,controlling,st12,copc

AverageUserRating
(2ratings)

Share

Tweet

Like

0Comments
Therearenocommentsonthispost

SiteIndex
Privacy

ContactUs
TermsofUse

SAPHelpPortal
LegalDisclosure

Copyright

http://scn.sap.com/community/erp/financials/controlling/blog/2015/04/21/howtoanalyzeperformanceproblem

FollowSCN

9/9

Das könnte Ihnen auch gefallen