You are on page 1of 31

ADM315

Caderno de Exerccios

ADM315
ADM315 Workload Analysis

Data Centro de Treinamento Instrutores Website

Caderno de Exerccios
Course Version: 2004 Q4 Course Duration: 3 Day(s !ateria" #umber: $00%&'03

An SAP Compass course - use it to learn, reference it for work

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Copyright
Copyright 2004 SAP AG. All rights reserved. No part of this publication ay be reproduced or trans itted in any for or for any purpose !ithout the e"press per ission of SAP AG. #he infor ation contained herein be changed !ithout prior notice. So e soft!are products ar$eted by SAP AG and its distributors contain proprietary soft!are co ponents of other soft!are vendors. ay

Trademarks
%icrosoft&' ()N*+(S&' N#&' ,-C,.&' (ord&' Po!erPoint& and S/. Server& are registered trade ar$s of %icrosoft Corporation. )0%&' *02&' +S12&' *0212000&' Parallel Sysple"&' %3S1,SA&' 4S12000&' A)-&' S1560&' AS1400&' +S1560&' and +S1400& are registered trade ar$s of )0% Corporation. +4AC.,& is a registered trade ar$ of +4AC., Corporation. )N7+4%)-&8+n.ine for SAP and )N7+4%)-& *yna ic Server#% are registered trade ar$s of )nfor i" Soft!are )ncorporated. 9N)-&' -1+pen&' +S71:&' and %otif& are registered trade ar$s of the +pen Group. Citri"&' the Citri" logo' )CA&' Progra Neighborhood&' %eta7ra e&' (in7ra e&' 3ideo7ra e&' %ulti(in& and other Citri" product na es referenced herein are trade ar$s of Citri" Syste s' )nc. ;#%.' *;#%.' -%.' -;#%. are trade ar$s or registered trade ar$s of (5C&' (orld (ide (eb Consortiu ' %assachusetts )nstitute of #echnology. <A3A& is a registered trade ar$ of Sun %icrosyste s' )nc. <A3ASC4)P#& is a registered trade ar$ of Sun %icrosyste s' )nc.' used under license for technology invented and i ple ented by Netscape. SAP' SAP .ogo' 412' 4)3A' 415' SAP Archive.in$' SAP 0usiness(or$flo!'(eb7lo!' SAP ,arly(atch' 0AP)' SAPP;)4,' %anage ent Coc$pit' ySAP.co .ogo and ySAP.co are trade ar$s or registered trade ar$s of SAP AG in Ger any and in several other countries all over the !orld. All other products entioned are trade ar$s or registered trade ar$s of their respective co panies.

Disclaimer
#;,S, %A#,4)A.S A4, P4+3)*,* 0= SAP +N AN >AS )S> 0AS)S' AN* SAP ,-P4,SS.= *)SC.A)%S AN= AN* A.. (A44AN#),S' ,-P4,SS +4 APP.),*' )NC.9*)NG ()#;+9# .)%)#A#)+N (A44AN#),S +7 %,4C;AN#A0).)#= AN* 7)#N,SS 7+4 A PA4#)C9.A4 P94P+S,' ()#; 4,SP,C# #+ #;,S, %A#,4)A.S AN* #;, S,43)C,' )N7+4%A#)+N' #,-#' G4AP;)CS' .)N?S' +4 AN= +#;,4 %A#,4)A.S AN* P4+*9C#S C+N#A)N,* ;,4,)N. )N N+ ,3,N# S;A.. SAP 0, .)A0., 7+4 AN= *)4,C#' )N*)4,C#' SP,C)A.' )NC)*,N#A.' C+NS,/9,N#)A.' +4 P9N)#)3, *A%AG,S +7 AN= ?)N* (;A#S+,3,4' )NC.9*)NG ()#;+9# .)%)#A#)+N .+S# 4,3,N9,S +4 .+S# P4+7)#S' (;)C; %A= 4,S9.# 74+% #;, 9S, +7 #;,S, %A#,4)A.S +4 )NC.9*,* S+7#(A4, C+%P+N,N#S.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Contedo
!nit " Analysis o# $ystem %%&&&&&&&&&&&&&%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&& '( !nit 3" )*3 Memory Management %%&%%%%&&&&&&&&&&&&&&&&&&&&&&&&&& '+ !nit (" ,ard-are Capacity &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1( !nit 5" Expensi.e $/0 $tatement %%%%%%&&&&&&&&&&&&&&&&&&&&&&&&& 11 !nit 2" Ta3le 45##ering %%&&&&&&&&&&&&&%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&& Appendix 1" Workload Analysis Transactions %%%%%%&&&&& ( Appendix " $ymptom and 6ossi3le Ca5ses %%%%%%%% 5 Appendix 3" )oad Maps %%%%%%%%%%%%%%%&&%% 2

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

!nit " Analysis o# $ystem


.ist of Activities in the 9nit :. %onitor 415 Progra 0uffer (ith (or$load Monitor )*3 6rogram 45##er With Workload Summary: #he students !ill onitor the effect of a !or$load si ulation on an A0AP Progra buffer that is configured too s all. #he instructor !ill help guide the students through the analysis. #he e"ercise can optionally be run a second ti e !ith an ade@uately siAed A0AP Progra buffer. Activity Type: Student e"ercise !ith !or$load si ulation ProcedureB :. *isplay transaction ZWRK. Clic$ the Create Problem pushbutton in the C415 Perfor ance %onitorsD bo" to decrease the siAe of the A0AP Progra buffer and other 415 buffers. #his pushbutton changes Ea ong othersF the current value of the follo!ing profile para etersB abap/buffersize ( !! "# $$! "#% rsdb/&tab/ftabsize ( !"# '"#%

=ou !ill be pro pted for a syste restart. syste should be restarted so that the ne! profile para eter can ta$e effect. #he syste several inutes. 2. *isplay transaction ZWRK. Clic$ the Start Wor(load pushbutton.

#he restart !ill ta$e

#his pushbutton starts a !or$load si ulation. =ou can chec$ transaction S"! to verify the !or$load si ulation users

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

ESAPGP,47F are logged on. +nce about half of the !or$load si ulation users are logged on' the students !ill be able to begin their analysis. %a$e sure that the students have sufficient ti e to understand the i portance of each onitor as this e"ercise progresses. Alt)ou*) t)e i&structor +ill lead t)e e,ercise- )e s)ould as( t)e stude&ts to try to *uide t)e a&alysis. T)e i&structor s)ould (eep t)e e,ercise movi&* i& t)e follo+i&* directio&. 5. +pen a 2nd user session !ith transaction //S"0!. After a fe! inutes' there !ill be any accesses Edirect readsF to the progra load tables because the progra buffer is too s all. =ou !ill also notice the 12oad pro*ram3 action because the progra buffer is too s all.

Additional )nfor

ationB #he A0AP14 load consists of four tables in the databaseB *0:0.)N7' *0:0.' *0:0/ and *0:0=. *0:0. contains the actual A0AP14 loadH *0:0/ and *0:0= contain the line references or the sy bol table of the generated progra . *0:0.)N7 contains general infor ation about the load' such
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

as the last ti e of change and the siAe of the data in *0:0.' *0:0/ and *0:0=. =ou !ill also see any accesses to table **N#7' that are caused by the any buffer s!aps of the description buffer Ersdb1ntab1ftabsiAe I 2000F. 4. +pen a 5rd user session !ith transaction 1+S#05N. Choose Expert mode Detailed analysis Last minute

load. Select the current application server. *isplay these statistical records before the si ulation has finished. E#he si ulation lasts for about 20 inutes' but :J inutes should be ore than sufficient for the students to evaluate the S"0! display.F Press to e"ecute.

7or the students' note the Avera*e Respo&se Time' Avera*e 2oad Time and Avera*e 4# Re5uest Time E#hese nu bers can be used for a co parison later.F. #he high *0 4e@uest #i e is due to the fre@uent accesses to the progra load tables' !hich also cause high .oad #i e. 0oth of these statistics are significantly i pacted by the s all siAe of the Progra buffer. J. +pen a 4th user session !ith transaction //ST!6.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Point out the fields CAllocatedD and CS!apsD for the Progra buffer. #hese fields sho! the current siAe to the Progra buffer and that it has a significant nu ber of obKect s!aps. *ouble clic$ on the field CProgra D in the C0ufferD section. Clic$ the Curre&t parameters pushbutton and note for the students the para eter na e and valueB abap/buffersize ($$! "#% rsdb/&tab/ftabsize ('"#%

#hese are the profile para eters that have been changed for this e"ercise. #he obKect s!aps occur because the buffers are not large enough to hold all of the necessary obKects. #hey ust be displaced to a$e roo for others and then reloaded as needed. *iscuss the results of this e"ercise !ith the students to a$e sure that they have a clear understanding. 2. *isplay transaction L(4?. Clic$ the Solve Problem pushbutton in the C415 Perfor ance %onitorsD bo".

#his pushbutton changes the current value of the follo!ing profile para eterB abap/buffersize ($$! "# !!"#% rsdb/&tab/ftabsize ('"# !"#% =ou !ill be pro pted for a syste restart. #he syste should be restarted so that the ne! profile para eter can ta$e effect. #he syste restart !ill ta$e several inutes. #he first part of the e"ercise is co plete. M. *epending on the available ti e' you can optionally run the !or$load si ulation again. 7ollo! the sa e process of analysis as during the first half of the e"ercise. #he points of difference are that Average *0 4e@uest #i e and Average .oad #i e are decreased and there are no obKect s!aps in the progra buffer. #he progra buffer is ade@uate for this !or$load si ulation. #he discussion of a larger Progra buffer solution can also be done using the slides for this e"ercise that represent the larger Progra buffer configuration.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

!nit 3" )*3 Memory Management


.ist of Activities in the 9nit :. %onitor 415 %e ory 9sage 2. %onitor 415 %e ory 9sage (ith (or$load Monitor )*3 Memory !sage SummaryB #he instructor !ill de onstrate onitoring the current usage of 415 ,"tended %e ory and 415 ;eap %e ory. Activity Type: )nstructor de onstration ProcedureB :. *isplay transaction ZWRK. Clic$ the Create Problem pushbutton in the C415 %e ory %anage entD bo".

#his pushbutton changes the current values of the follo!ing profile para etersB em/i&itial7size7"# (' 8 "# 60! "#% ztta/roll7e,te&sio& (6 9# $8! "#% abap/)eap7area7dia (6 9# $0! "#% em/ma,7size7"# (6 9# 60! "#%

=ou !ill be pro pted for a syste restart. #he syste should be restarted so that the ne! profile para eters can ta$e effect. #he syste restart !ill ta$e several inutes.

2. *isplay transaction ST!6. *ouble clic$ on the field C,"tended %e oryD %e oryD section. Clic$ the Curre&t parameters pushbutton students the para eter valuesB em/i&itial7size7"# (60! "#% ztta/roll7e,te&sio& ($8! "#% abap/)eap7area7dia ($0! "#%

in the CSAP and note for the

#hese are the e ory anage ent para eters that are ost relevant for this de onstration. 5. +pen a 2nd user session !ith transaction //S"0!. Sho! the students that there are currently no !or$
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

processes in PR:;

ode.

4. +pen a 5rd user session !ith transaction //S<=8. ,"ecute the progra ZA4"=$07>S<7"<" !ith a value of 0! in the field C%0D. #his value in the field !ill cause the progra to use appro"i ately J0 %0 of 415 ,"tended %e ory. J. S!itch to the ST!6 session opened earlier and clic$ the #ac( arro! icon in the icon bar to e"it the CCurrent para etersD display. Clic$ the "ode list pushbutton EST0 ! Detail analysis menu ! SAP "emory ! "ode listF. #his screen displays the e ory usage of each user that is logged on the syste . Point out the user C#rainerD that is using appro"i ately J0 %0 of 415 ,"tended %e ory Ecolu n C,"t %e DF. 2. +pen a 4th user session !ith transaction //S<=8 to run the progra ZA4"=$07>S<7"<" again !ith a value of 6!! in the field C%0D. M. S!itch to the "ode list session opened earlier and refresh the display. Point out the user C#rainerD that is using appro"i ately :MJ %0 of 415 ,"tended %e ory Ecolu n C,"t %e DF and appro"i ately 2J %0 of

415 ;eap %e ory Ecolu n C;eapDF. ,"plain that there is appro"i ately 2J %0 of 415 ;eap %e ory usage because the profile para eter ztta/roll7e,te&sio& ($8! "#% li its the a ount of 415 ,"tended %e ory that a !or$ process can use. #he re ainder of the e ory re@uire ent is fulfilled fro 415 ;eap %e ory. N. S!itch to the S%J0 session opened earlier and refresh the display. Point out that a !or$ process has no! gone into PR:; mode because it is using 415 ;eap %e ory.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

6. +pen a Jth user session !ith transaction 1+S,5N to run the progra LA*%5:JG9S,G%,% again !ith a value of :00 in the field C%0D. :0. S!itch to the "ode list session opened earlier and refresh the display.

Point out the user C#rainerD that is using appro"i ately :00 %0 of 415 ;eap %e ory Ecolu n C;eapDF. ,"plain that there is appro"i ately :00 %0 of 415 ;eap %e ory usage because the profile para eter em/i&itial7size7"# (60! "#% has no! been e"hausted !ith the three e"ecutions of the progra LA*%5:JG9S,G%,% EJ0 %0' 200 %0' and :00

%0F. ::. S!itch to the S"0! session opened earlier and refresh the display. Point out that t!o !or$ processes are no! in P4)3 ode because both are using 415 ;eap %e ory.

:2. Cancel the three S,5N sessions opened earlier to run the progra LA*%5:JG9S,G%,% to release the 415 ,"tended %e ory and 415 ;eap %e ory that they consu ed. :5. +pen a user session !ith transaction //S<=8 to run the progra ZA4"=$07>S<7"<" again !ith a value of !! in the field C%0D. After a fe! seconds' there !ill be an A0AP progra du p ETS;7T?<W7PA9<7A22/C7@A:2<4F because all 415 %e ory available for *ialog !or$ processes has been e"hausted and no ore can be allocated for the progra . #he profile para eter ztta/roll7e,te&sio& ($8! "#% plus the profile para eter abap/)eap7area7dia ($0! "#% e@uals ==! "#' !hich is less than the
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

1'

ADM315

Caderno de Exerccios

!! "# that the progra re@uires. A progra aborts !hen it re@uires ore e ory than is available. #he de onstration is co plete. #he user session e"ecuting the progra LA*%5:JG9S,G%,% should be canceled.

Additional )nfor

ationB )n this de onstration' the profile para eters em/i&itial7size7"# and em/ma,7size7"# are e@ual' !hich si ulates a 9N)- environ ent. )n the current 9N)- environ ent' the para eter em/i&itial7size7"# li its the total siAe of 415 ,"tended %e ory. )n the N# environ ent' 415 ,"tended %e ory ay increase dyna ically up to the value of the profile para eter em/ma,7size7"#. Monitor )*3 Memory !sage With Workload SummaryB #he students !ill onitor the current usage of 415 ,"tended %e ory and 415 ;eap %e ory !ith a !or$load si ulation on the syste . #he first run of the !or$load si ulation !ill use the e ory anage ent para eters that have been set in the previous de onstration. #he second run of the !or$load si ulation' !hich is optional' !ill use ore opti al e ory anage ent para eters. Activity TypeB Student e"ercise !ith !or$load si ulation ProcedureB :. +pen a session !ith //ZWRK. Clic$ the Start Wor(load pushbutton.

2. 9se transaction S"! to verify all of the !or$load si ulation users are logged on.

#here should be appro"i ately :0 !or$load si ulation users. +nce all of these users are logged on' the students !ill be able to begin their analysis. %a$e sure that the students have sufficient ti e to understand the i portance of each onitor as this e"ercise progresses. Although the instructor !ill lead the e"ercise' he should as$ the students to try to guide the analysis. #he instructor should $eep the e"ercise oving in the follo!ing direction. 5. +pen a 2nd session !ith transaction //S"0!.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

11

ADM315

Caderno de Exerccios

=ou !ill notice a progra na ed SAP2SA26 accu ulating cloc$ ti e. #he students should be able to deter ine that this progra Etogether !ith report LA*%5:JG9S,G%,%F is consu ing 415 ,"tended %e ory by e"a ining the %ode list ES#02 double clic$ C,"tended %e oryD "ode list pushbuttonF. #his progra helps create the environ ent for the !or$load by consu ing 415 ,"tended %e ory. After about t!o inutes' !or$load si ulation users ESAPGP,47F should appear in the S%J0 display. After about five inutes' so e of these !or$load si ulation users should have !or$ processes !ith a status of PR:;. #he P4)3 status is !hat is i portant to observe in this onitor. After about seven to nine inutes' there should be a significant nu ber of the !or$ processes !ith a P4)3 status. 4e ind the students that !hen a !or$ process has a status of P4)3' it is consu ing 415 ;eap %e ory and is loc$ed by a particular user. 4. +pen a 5rd user session !ith transaction 1+S%22. Sho! the students that this onitor displays si ilar infor ation as transaction S"0! for active !or$ processes across the entire syste . J. +pen a 4th user session !ith transaction //ST!6.

Point out the 1Curre&t use3 fields for ,"tended %e ory. #he CCurrent useD should be at :00O' !hich sho!s that the 415 ,"tended %e ory is co pletely consu ed and so e !or$ processes are forced to use 415 ;eap %e ory. #his situation can be further analyAed in the %ode list. 2. *ouble clic$ on the C,"tended %e oryD field in transaction S#02. Clic$ the "ode list pushbutton . )t is easy to see the users on the syste and the a ount of 415 ,"tended %e ory Ecolu n P,"t %e QF and 415 ;eap %e ory Ecolu n P;eapQF that they are using

. ,ach user displayed in this onitor that is consu ing 415 ;eap %e ory causes a !or$ process to have a status of P4)3. #he instructor should have a discussion !ith the students to a$e sure they understand ho! to perfor this e ory onitoring. M. *isplay transaction L(4?. Clic$ the Solve Problem pushbutton in the C415 %e ory %anage entD bo". #his pushbutton changes the current values of the follo!ing profile para etersB em/i&itial7size7"# (60! "# ' 8 "#% ztta/roll7e,te&sio& ($8! "# 6 9#% abap/)eap7area7dia ($0! "# 6 9#%
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

em/ma,7size7"# (60! "# 6 9#%

=ou !ill be pro pted for a syste restart. #he syste should be restarted so that the ne! profile para eters can ta$e effect. #he syste restart !ill ta$e several inutes. #he first part of the e"ercise is co plete. N. *epending on the available ti e' you can optionally run the !or$load si ulation again. 7ollo! the sa e process of analysis as during the first half of the e"ercise. #he pri ay point of difference is that there are no !or$ processes !ith a status of P4)3 during this !or$load si ulation because the para eters have a ore opti al configuration.

!nit (" ,ard-are Capacity


.ist of Activities in the 9nit :. *etect ,"ternal Processes Monitor )*3 ,ard-are Capacity 8External 6rocesses9 SummaryB #he students !ill analyAe the syste because of a significant perfor ance proble . #he students should analyAe this proble !ith little help fro the instructor. #he reason for the proble is that e"ternal operating syste processes are consu ing CP9 resources. Activity TypeB Student e"ercise !ith !or$load si ulation ProcedureB :. ,"plain to the students that you !ill create a perfor ance proble on the syste . As$ the to onitor the syste for a fe! inutes before you create the proble . #his !ill allo! the to have an idea ho! the syste loo$s !ith no proble s. )nstruct the to use the onitors already discussed to identify the proble after you have created it. 2. *isplay transaction ZWRK. Clic$ the Create Problem pushbutton in the C;ard!are CapacityD bo" to start the e"ternal operating syste processes.

#!o e"ternal processes !ill consu e all of the available CP9 resources. Additionally' clic$ the Start Wor(load pushbutton to create a !or$load si ulation that !ill provide statistical records for analysis.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

13

ADM315

Caderno de Exerccios

5. *isplay transaction ST!'. Point out that CP9 )dle #i e is 0O and CP9 9ser 9tiliAation is :00O.

Clic$ the Refres) display pushbutton several ti es. #he situation does not change. #here is a proble related to CP9 utiliAation. 7urther analysis about CP9 utiliAation is necessary. Clic$ the 4etail a&alysis me&u pushbutton. Clic$ the Top CP> processes pushbutton. Point out the t!o processes at the top of the process list that are consu ing al ost all of the

CP9 resources. Prove that these t!o processes are e"ternal to the 415 Syste by de onstrating that they are not 415 !or$ processes. 4. +pen a 2nd user session !ith transaction //S"0!. Point out that the P)*s Eprocess )* nu bersF of the t!o processes fro C#op CP9 processesD do not appear in the S%J0 display.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

1(

ADM315

Caderno de Exerccios

#his proves that they are not 415 !or$ processes. )t is also evident that these t!o processes are not database related because the database is represented as a single operating syste process EC+4AC.,N0D in our e"a pleF in the C#op CP9 processesD display for this operating

syste . #he correct analysis of this e"ercise is processes that are e"ternal to the 415 syste can degrade 415 perfor ance. #he solution is to eli inate the e"ternal processes. J. After the !or$load has been running for :0 to :2 inutes' open a 5 rd user session !ith transaction code ST!=? to ta$e a loo$ at the statistical records for this !or$load si ulation. Choose A<,pert modeB

4etailed a&alysis Blast mi&ute loadB' then choose the current application server. AnalyAe the last N or :0 inutes. Point out that the Processing #i e E*ispatch ti e 8 Average roll ti e 8 Average database re@uest ti e 8 Average en@ueue ti e 8 Average roll ti eF is significantly larger than the Average CP9 ti e.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

15

ADM315

Caderno de Exerccios

Processi&* Time (PT% ust be larger than CP> Time (CP>T%B P# R 2 S CP9#. )n this sa pleB (PT C .'D$ E $.00D E $.'8= E $6 E 6=0 E D0 C $$66%. #his indicates a resource bottlenec$ EP# R 2 S CP9#FB $$66 F 6 G 0!$. )n this e"a ple' it is a CP9 bottlenec$ due to e"ternal processes consu ing CP9. #he Average !ait ti e and the Average database re@uest ti e is also high as a result of the CP9 bottlenec$. 2. *isplay transaction L(4?. Clic$ the Solve Problem pushbutton in the C;ard!are CapacityD bo" to $ill the e"ternal operating syste processes. S!itch to the first screen of the ST!' session opened earlier. Point out that the CP9 utiliAation is nor al again. Also display the CTop CP> processD again. Point out that the t!o e"ternal process are no! gone. #he e"ercise is co plete. *iscuss the e"ercise !ith the student to a$e sure they understand the ethodology.

!nit 5" Expensi.e $/0 $tatements


.ist of Activities in the 9nit :. *atabase .oc$ *e onstration 2. ,"pensive S/. 5. ,"pensive S/. (ith (or$load Monitor Data3ase 0ocks SummaryB #he instructor !ill de onstrate a database loc$ situation E,"clusive loc$ !ait situationF. #his de onstration is independent of the SAP ,n@ueue1*e@ueue Elogical loc$ingF process that can be onitored !ith transaction S%:2. Activity TypeB )nstructor de onstration ProcedureB :. *isplay transaction *00:. Sho! the students that there are no current database loc$ situations. 2. +pen a 2nd user session !ith transaction 1+S,5N. *isplay the progra LA*%5:JG.+C? and e"plain that a database loc$ situation is created because the >select single for update> is coded in the progra . #his progra holds a loc$ on the table N4)3 because the >brea$8point> occurs before the progra is finished and the database loc$ can be released. ,"ecute the progra . 5. +pen a 5rd user session !ith transaction 1+S%J0. Sho! the students that a *ialog !or$ process is no! in *,09G ode because of the >brea$8point> in the progra . #his is the !or$ process that is used by the progra LA*%5:JG.+C?. #here is no! a database loc$ on the table N4)3. #his is not really a proble until another progra !ants to access the table N4)3. 4. +pen a 4th user session !ith transaction 1+S,5N. ,"ecute the progra LA*%5:JG.+C? a second ti e. #he progra !ill display an hourglass because it is !aiting for a database loc$ on table N4)3. J. S!itch to the S%J0 session opened earlier Erefresh the display if necessaryF and sho! the students that t!o *ialog !or$ processes are no! consu ed because of this database loc$ proble . #!o *ialog !or$ processes are accu ulating cloc$ ti e and are not able to service other user re@uests. Also clic$ on the CP9 pushbutton to de onstrate that the t!o *ialog !or$ processes are not getting CP9 ti e. 2. S!itch to the *00: session and sho! the students the >loc$ holder> and the >loc$ !aiter> for table N4)3. #he P)*s for the >loc$ holder> and >loc$ !aiter> correspond to the P)*s of the *ialog !or$ processes that
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

12

ADM315

Caderno de Exerccios

are accu ulating cloc$ ti e in the S%J0 onitor. =ou can also double clic$ on the loc$ obKect EN4)3F in the *00: display to get ore detailed infor ation about the loc$ed obKect. M. Press the 7N $ey on the screen of the first progra so that it can continue past the >brea$8point> and finish. #he database loc$ situation is no! gone because both progra s are no longer trying to get a loc$ on the table N4)3. Sho! the display of *00: to prove the database loc$ proble is gone. Press the 7N $ey on the screen of the second progra so that it can go past the >brea$8point> and finish. #he de onstration is co plete.

Additional )nfor

ationB #he instructor can also sho! the database !ait situation created by the database loc$ in this de onstration if desired. :. (hile both progra s are running' open a user session for transaction S#04 Detail analysis menu (ait events. #his display !ill de onstrate ho! to get additional database loc$ infor ation Ee"pressed in cloc$ ti e and as a percentage of database resourcesF. Clic$ the Reset pushbutton and !ait a fe! seconds. Clic$ the Si&ce Reset pushbutton. =ou can continually clic$ the Si&ce Reset pushbutton to sho! that the >en@ueue> event is accu ulating cloc$ ti e and is near the top of the event list. 2. (hen both progra s are finished' again display transaction S#04 *etail analysis enu (ait events. Clic$ the Reset pushbutton and !ait a fe! seconds. Clic$ the Si&ce Reset pushbutton. =ou can continually clic$ the Si&ce Reset pushbutton to sho! that the >en@ueue> event is no longer so near the top of the event list and is not rapidly accu ulating cloc$ ti e. Expensi.e $/0 $tatements SummaryB #he instructor !ill create an S/. trace involving t!o e"pensive S/. state ents. #he instructor !ill analyAe the first e"pensive S/. state ent and create a secondary inde" as the solution. #he students !ill analyAe the second e"pensive S/. state ent and discuss ho! to solve the proble on their o!n. #he instructor !ill oderate the discussion. Activity TypeB )nstructor de onstration1Student e"ercise ProcedureB :. +pen a user session !ith transaction //S<=8. ,"ecute progra ZA4"=$07S<2<CT7Z"ARA. A progra should be e"ecuted once before the S/. trace is activated to populate any local SAP table buffers. Alternately' the progra can be run fro transaction L(4? by clic$ing the Select from Z"ARA

pushbutton. 2. +pen a user session !ith transaction //ST!0. Clic$ the Trace o& pushbutton. 5. S!itch to the S,5N session opened earlier and e"ecute the progra LA*%5:JGS,.,C#GL%A4A. Note the run ti e of S/. state ents : and 2 Ethey !ill be referenced laterF. 4. S!itch to the ST!0 session opened earlier and clic$ the Trace off pushbutton.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

11

ADM315

Caderno de Exerccios

Clic$ the 2ist trace pushbutton. Clic$ the <,ecute Echec$ ar$F pushbutton on the ne"t screen to get the trace list. #he students should also list the trace after you have it on your screen. J. #he S/. trace list displays t!o state ents !ith very high duration ti es in the database. 0oth state ents involve the table L%A4A. Place the cursor on the first line of the list that has a database operation of R</P<? for the obKect L%A4A and clic$ the <,plai& SH2 pushbutton. #he S/. state ent is a$ing a selection against table L%A4A using the fields %AN*# and 0)S%#. #he e"ecution plan involves an inde" range scan. #he inde" should be investigated to see if is appropriate. 2. *ouble clic$ on the na e of the inde" EL%A4AT#F to deter ine !hat fields it is using. #he display sho!s that this inde" uses fields %AN*# and %A#?.. #he inde" does not contain the field 0)S%# that is in the (;,4, clause of the S/. state ent. #he e"isting inde" is not appropriate for the S/. state ent. #he solution is to create a secondary inde" for table L%A4A that contains the fields %AN*# and 0)S%#. M. +pen a user session !ith transaction //S<$6. ,nter L%A4A in the field >+bKect na e> and clic$ the 4isplay pushbutton. Clic$ the :&de,esI pushbutton. Clic$ the Create pushbutton. ,nter = in the field >)nde" )*>. Clic$ the Co&ti&ue Echec$ ar$F pushbutton. ,nter an inde" description in the field >Short description>. ,nter %AN*# and 0)S%# in the colu n >7ield na e> to specify the fields of the ne! inde" E%AN*# is not generally a good field for and inde"' but is used here to be consistent !ith the e"isting secondary inde".F. Clic$ the Activate pushbutton to activate the ne! inde" in the SAP data dictionary and in the database. N. S!itch to the S,5N session opened earlier and e"ecute the progra LA*%5:JGS,.,C#GL%A4A. Note the run ti e of S/. state ent : again. #he run ti e has decreased dra atically because there is no! an appropriate secondary inde" for S/. state ent :. #he de onstration is co plete. #he re aining portion of the e"ercise is a lab for the students. #hey should apply !hat they have learned to try to solve the proble !ith the second e"pensive S/. state ent. #he solution involves updating the database opti iAer statistics. #he students have not been sho!n ho! to do this and should not be able to solve the proble . #his is an i portant point because current statistics for the database opti iAer are critical. #he instructor !ill de onstrate and discuss the results of the lab !ith the students after they have had sufficient ti e
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

1+

ADM315

Caderno de Exerccios

to discuss it. :. #he instructor should no! create another S/. trace of the progra LA*%5:JGS,.,C#GL%A4A. #he list of this trace !ill contain only one e"pensive S/. state ent because the other e"pensive S/. state ent has no! been addressed. #he students should list the trace after the instructor has created it. #he students should begin their o!n analysis of the proble starting !ith the list of the trace. 2. After the students have had sufficient ti e to discuss the e"ercise E:J820 inutes should be enough ti eF' the instructor should de onstrate and e"plain the solution. N+#,S for the discussion and solution for e"pensive S/. state ent 2B :. #he secondary inde" that is selected by the opti iAer is not appropriate. #he S/. state ent uses the fields %AN*#' 0)S%#' and %A#?. in its (;,4, clause. ;o!ever' the secondary inde" uses the fields %AN*# and %A#?. #he secondary inde" does not atch the (;,4, clause of the S/. state ent. #his de onstrates that an appropriate secondary inde" should e"ist in order to i prove database re@uest ti e. 2. Create a ne! secondary inde" EL%A4ATLF using only the field 0)S%# and run the progra again. #he field 0)S%# is used for the secondary inde" because it is the ost selective field E T)is i&de, is esse&tially t)e same as t)e Z"ARAJK i&de, a&d demo&strates t)at eit)er could be used. F. ,"ecute the progra again. )t is e"pected that response ti e should i prove. ;o!ever' the response ti e does not i prove. #here is no i prove ent because the database opti iAer statistics do not e"ist for this ne! inde" Ei portantUF. #he database opti iAer statistics ust be updated. 5. ,"ecute transaction 4#6! to get to the %aintain Statistics screen. Alternately' clic$ the Create Z"ARA Stats pushbutton fro the transaction L(4?. ,nter L%A4A in the field >#able> and clic$ Create statistics. ,"ecute the progra again and notice that the response ti e is greatly i proved. #his i prove ent is because the database opti iAer statistics no! e"ist and the appropriate secondary inde" is used. 4. Create a S/. trace of the progra and sho! the students that the ne! secondary inde" EL%A4ATLF is used. J. Sho! the students that a full table scan can be better than using an inappropriate secondary inde". *elete both secondary inde"es that !ere created in this e"ercise EL%A4AT= and L%A4ATLF. ,"ecute the progra again. 4esponse ti e is still better than the original response ti e !hen the e"ercise !as started' though both additional inde"es have been deleted. #he reason for this is because the database opti iAer has current statistics and $no!s that a full table scan is ore efficient than using the only re aining secondary inde" EL%A4AT#F. 2. Create a S/. trace of the progra to sho! the students that a full table scan is used rather an inde". Expensi.e $/0 $tatement With Workload SummaryB #he instructor !ill start a !or$load si ulation involving an e"pensive S/. state ent and help the students analyAe the proble and develop a solution. #he instructor can help lead the students through the analysis. Activity TypeB Student e"ercise !ith !or$load si ulation ProcedureB :. *isplay transaction S"0! EProcess +vervie! %onitorF. Sho! the students that there are currently no long running !or$ processes. 2. +pen a 2nd user session !ith transaction //S"'' ESyste !ide Process +vervie! %onitorF. Sho! the students that there are currently no long running !or$ processes. 4e ind the students that the analysis of the !or$load si ulation !ill start !ith transactions S%J01S%22. 5. +pen a 5rd user session !ith transaction //ZWRK. Clic$ the Create problem pushbutton in the ,"pensive S/. State ents bo" E#his pushbutton deletes the inde" that is the solution for this e"ercise.F. Clic$ the Start Wor(load pushbutton. #his pushbutton starts a !or$load si ulation !ith S* users. #he S* users e"ecute transaction 3A0:' !hich a$es user e"its that call the progra LLS,.,C#. #he progra LLS,.,C# accesses the table L.)PS.
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

17

ADM315

Caderno de Exerccios

4. =ou can chec$ transaction S"! to verify that the !or$load si ulation users are logged on. +nce these users are logged on' the students !ill be able to begin their analysis. %a$e sure that the students have sufficient ti e to understand the i portance of each onitor as this e"ercise progresses. As$ the to try to lead you through the analysis. J. )nstruct the students to onitor transactions S"0!/S"'' and to identify the P4+G4A%' #A0., and #4ANSAC#)+N that are associated !ith the proble . (ith transaction S%J0' the progra na e ELLS,.,C#F can be found in the colu n >Progra > and the table na e EL.)PSF can be found in the colu n >#able>. (ith transaction S%22' the progra na e ELLS,.,C#F can be found in the colu n >4eport>. Clic$ the ?e,t vie+ icon in the icon bar of the S%22 display. #he transaction na e E3A0:F can be found in the colu n >#code> and the table na e EL.)PSF can be found in the colu n >#able>. , phasiAe that the e"pensive S/. state ent can be found Preal8ti eQ !ith transactions S%J0 and S#04 E*atabase %onitorF or PhistoricallyQ !ith transactions S#05N E(or$load %onitorF and S#0J ES/. #raceF. #he Shared Cursor Cache ES#04 *etail analysis enu S/. re@uestF can also be analyAed to help find e"pensive S/. state ents. 2. )dentify the e"pensive S/. state ent Ethe Preal8ti eQ !ayF by atching the P)* nu ber of one of the long running *ialog !or$ processes accessing table L.)PS Ethe !or$ process ust be running for this to !or$F in S"0! +it) its correspo&di&* Clie&t Process &umber i& t)e 4atabase Process "o&itor (ST! 4etail a&alysis me&u /racle sessio&%. *ouble clic$ on the line !ith the corresponding Client Process nu ber and the S/. state ent should be displayed. #i ing is critical for this to !or$. )t ay be necessary to try this several ti es. =ou can clic$ the <,plai& pushbutton to get further infor ation Eincluding the full state ent and any inde" that is usedF. M. #o get the average response ti e of 3A0: during the si ulation Eit is ostly database re@uest ti eF' call the (or$load %onitor EST!=?F' s!itch to >e"pert ode> and choose >4etailed a&alysisL L2ast mi&ute loadL LMi&sta&ce &ameFL. #his can be used as a co parison for later in the e"ercise. ,nter the figure for the duration of the !or$load si ulation run. Clic$ Co&ti&ue. 7ro the analysis vie!s' choose >#ransaction profile> >Standard>. Sort the transactions by >Average 4esponse #i e>. #ransaction 3A0: should be at the top of the list and have a high average response ti e and a high database re@uest ti e. #he !or$load si ulation last for about :J inutes' but you do not have to !ait for it to co plete before ta$ing a loo$ at these statistical records. N. +nce the e"pensive S/. state ent has been displayed using the *atabase Process %onitor' clic$ the <,plai& pushbutton to see the e"ecution plan for the state ent. SELECT * FROM "ZLIPS" W ERE "M!"#T" $ %!& !"# "M!T"R" $ %!' !"# "WER(S" $ %!) !"# "L*ORT" $ %!+ E,ecution Plan

SELECT ST!TEME"T - Esti.ated Costs $ )/0 1 T!2LE !CCESS F3LL ZLIPS Point out to the students the relevant fields that are used in the (;,4, clause of the S/. state ent E%A#N4' (,4?S' and .G+4#F and that there is a full table access of table L.)PS.
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

'

ADM315

Caderno de Exerccios

6. Create a S/. trace of transaction 3A0: for the purpose of co parison !ith the solution to the e"ercise Ethe interest here is database re@uest ti e for table L.)PSF. 4e e ber to run the transaction once before turning on the trace. +pen a user session !ith transaction //;A!$. #ype S+ in the >+rder type> field and press the ,nter $ey. #ype S44!!!!! in the >Custo er> field and press the ,nter $ey and turn the S/. #race off Ethis is a very short trace involving entry of only t!o fieldsF. .ist the trace and point out the high database re@uest ti e for access to table L.)PS. 9se the <,plai& pushbutton to see the detail for the state ent accessing table L.)PS. +nce the trace is listed' you can use the co press feature to a$e it ore readable EGoto Su ary Su ariAeF. :0. #he data dictionary should be chec$ed ne"t to see !hat inde"es e"ist for the table L.)PS. +pen a user session !ith transaction 1+S,:2 E*ata *ictionaryF and display the e"isting secondary inde"es for table L.)PS. #here are no e"isting secondary inde"es for table L.)PS. Create and activate a secondary inde" on the field %A#N4 because it is the ost selective field of those that are used in the (;,4, clause of the S/. state ent. #he secondary inde" can also be created by using transaction L(4?' and then clic$ing the Solve Problem pushbutton in the bo" >,"pensive S/. State ents>. ::. Create another S/. #race EST!0F of transaction 3A0: Kust li$e the earlier one. .ist the trace and point out that the access ti e for table L.)PS has been greatly reduced because of the ne! secondary inde" on the field %A#N4. #his basically co pletes the e"ercise. Also sho! the students that si ilar infor ation can be obtained fro the Shared Cursor Cache. :2. *isplay the Shared Cursor Cache EST! 4etail a&alysis me&u SH2 re5uestF. #he selection criteria fields should be blan$' e"cept for the field >S/. state ents te plate>' !hich should have a value of Z2:PS. Clic$ <,ecute. #his !ill display S/. state ents that access the table L.)PS. *ouble clic$ on the state ent !ith the ost e"ecutions and then clic$ on the <,plai& pushbutton. #he e"plain function al!ays sho!s the e"ecution plan that the opti iAer !ould choose V here' this plan should involve the inde" on %A#N4 created in step :0. #he Solve Problem pushbutton in the >,"pensive S/. State ents> bo" in transaction L(4? ust be clic$ed !hen this e"ercise is co plete.

!nit 2" Ta3le 45##ering


.ist of Activities in the 9nit :. 0uffering database accesses Monitor )*3 Ta3le 45##ering SummaryB #he students have to analyAe progra LA*%5:JGS,.,C#G0977,4 to find out for each S/. state ent if the data are retrieved fro the buffer or the database. Activity TypeB Student e"ercise ProcedureB #he trainer has to perfor a S/. trace of progra ZA4"=$07S<2<CT7#>@@<R. *isplay the S/. trace and the source code. #he students have to analyAe each S/. state ent and should deter ine if the data are retrieved fro the buffer or the database. )f the data are retrieved fro the buffer' the students should deter ine the buffering type

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Etransaction S<$=F.

#o display the pri ary $ey and the technical settings of a table use transaction S<$6 or S<$$.

!nit 1" :nter#ace Monitoring


Activities in this 9nit :. Parallel 47Cs ,"ercise :nter#ace Monitoring Summary: #he students !ill analyAe the syste because of a significant perfor ance proble . #he reason for the proble is that asynchronous 47Cs are started in parallel and use nearly all resources. . Activity Type: Student e"ercise ProcedureB :. Call transaction L(4?. Clic$ the Create Problem pushbutton in the PParallel 47CsQ bo". #his pushbutton calls the report 4SA47C.*' !hich changes the current value of the profile para eter rdisp/rfc7mi&7+ait7dia7+p fro N to 2. #his para eter specifies the nu ber of dialog !or$ processes that should re ain free for the other users. Apart fro the para eter change the report displays the current settings of the 47C resource anage ent. 2. Go bac$ to transaction L(4? and push the AStart Wor(loadB button' !hich starts the bench ar$ users and the report ZA4"=$07START7R@C7#ATCN6- that triggers asynchronous 47Cs for about 20 inutes. )f you !ant to stop this report' use the PStop #ransactionQ by clic$ing the SAPG9) icon in the upper left corner of the corresponding G9) !indo!. 5. +pen a 2nd screen !ith transaction S"0!. #here you !ill see any processes that are running under your user EtrainerF. )n the process overvie! you !ill see the progra s SAP.LA*%5:J and SAP.A47C
2$(0)(200$ * 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

respectively SAP.,47C' that are caused by the activity of the asynchronous 47Cs. #hese progra s have any accesses to tables A47C4S#A#, and A47C*A#A +nly about t!o !or$processes are $ept free for the online dialog users' i.e. bench ar$ users and students. 4. )n a 5rd screen you should open transaction S"! ' !here you can onitor the logged on users. Apart fro the students and the SAPGP,47 users you !ill see any users that are logged on !ith your na e and type R@C. J. After :J820 inutes you should call transaction PS#05 8R #his application server8R .ast inute load8RGoto8 RProfiles8R47C profile8RServersQ #here you !ill find the function odules that have been called via 47C. #he function odules A47CG*,S#GC+N7)4%' A47CG*,S#GS;)P' A47CG49NGN+(A)#' 47CGP)NG and #47CGS=S.+A*G0P are called by the fra e!or$ of the t47C processing. #he function odule Z7A4"=$07START7TR@C is called by the report ZA4"=$07START7R@C7#ATCN6- !hich is the reason for the high 47C load. 2. Go to transaction L(4? and clic$ the ASolve ProblemB pushbutton. #his !ill sub it the report 4SA47C.* again and reset the para eter rdisp1rfcG8 inG!aitG!p to N. After that press the pushbutton PStart (or$loadQ and let the students analyse the situation again. #he nu ber of !or$processes' that is occupied by the asynchronous 47Cs is no! restricted to 2 and the bench ar$ runs !ithout proble s.

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Appe&di, $: Wor(load A&alysis Tra&sactio&s


Dialog response time in detail
$T'3< $T'3> )? ' D413 $TAD $T'
D:A D:A DW 4TC E</ !6D $6; $ $ $ $ $ $ D4W) C=6T 0>W) A)C,

$A6 Memor y
)oll 6aging

$A6 45##ers

$T'

$T1' $TATT)ACE
6M;< $M;<

$T'(

$E3' $T'1 $T1(

$M5 ' $M2 2

$T'5 D4 ' D4'1

D4' D4'5

$T'2 saposcol&exe

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Appe&di, 6: Symptoms a&d Possible Causes

1 1 1 1 1 1

,igh -ait time" :ns5##icient n5m3er o# #ree -ork processes ,igh roll@-ait time" Comm5nication pro3lem -ith >!:A external systemA or large amo5nt o# data reB5ested ,igh load and generation time" $A6 35##ers 86rogramA C!A or $creen9 too small ,igh data3ase reB5est time" C6!*memory 3ottleneck on data3ase ser.erC comm5nication pro3lem -ith data3ase ser.erA expensi.e $/0 statementsA data3ase locksA missing indexesA missing statistics or small data3ase 35##er8s9 ,igh C6! time" Expensi.e A4A6 processingA #or exampleA processing large ta3lesC ine##icient programming 6rocessing time more than t-ice C6! time" C6! 3ottlenecks

T2e ;perating $ystem can a33ect t2ese 0a"ues by about 40 5

A.erage )esponse Time 8)T9


Dialog" approx& 1 second !pdate" D 1 second

A.erage 6rocessing Time 86T F )T WT ):<T 0T D4T9


D (' E A.erage Dispatch Time 8DT F )T WT9 D 8 G C6!T9

A.erage Wait Time 8WT9


D 1 E o# A.erage )T !s5ally D 1' E A.erage )T

A.erage )oll@in Time 8):<T9


D ' ms

A.erage D4 )eB5est Time 8D4T9


Approx& (' E o# A.erage DT Direct reads" D 1' ms $eB5ential reads" D (' ms Changes" H 5 ms

A.erage 0oad Time 80T9


D 1' E A.erage )T D 5' ms

A.erage C6! Time 8C6!T9


Approx& (' E o# A.erage DT H 86T * 9

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

Appe&di, =: Road "aps

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

ADM315

Caderno de Exerccios

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

3'

ADM315

Caderno de Exerccios

2$(0)(200$

* 200$ +,- .rasi"/ Todos os direitos reser0ados

31