8
02/14/2013 Page 1 of 8 SAP Note 1601951 - Self Service 'SQL Statement Tuning' - Prerequisites and FAQ Note Language: English Version: 3 Validity: Valid Since 01/16/2012 Summary Symptom It is considered or planned to perform a Self Service "SQL Statement Tuning" (currently possible for ABAP based systems running with Oracle or (as of ST-SER 2010_1 SP 10) DB2 UDB for Unix, Linux and Windows release >= 9.5.) o 1 When to perform this service o 2 How to perform the service - 2.1 General Steps - 2.2 How to perform those steps in the Solution Manager o 3 Prerequisites - 3.1 Prerequisites on Solution Manager - 3.2 Prerequisites on Managed System - 3.3 Non-technical Prerequisites. o 4 Frequently Asked Questions Note that those topics are discussed in detail in the corresponding "Expert Guided Implementation session" (see http://service.sap.com/expert-guided-implementation). Other terms GSS_SQL, performance, expensive statements Reason and Prerequisites Solution 1 When to perform this service The Self Service "SQL Statement Tuning" aims to optimize the general system performance by reducing the impact from those SQL statements that have the highest contribution to the overall DB load. This means: in order to get a noticeable effect, this service should be performed if: - There is a general performance problem. - Database time contributes significantly to the overall response time. - Significant DB load is caused by only a small number of SQL statements.

1601951 SelfSer Sqltuning Faq Prereq v3

Embed Size (px)

DESCRIPTION

tuning of sql statements in SAP

Citation preview

Page 1: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 1 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

Note Language: English Version: 3 Validity: Valid Since 01/16/2012

Summary

SymptomIt is considered or planned to perform a Self Service "SQL StatementTuning" (currently possible for ABAP based systems running with Oracle or(as of ST-SER 2010_1 SP 10) DB2 UDB for Unix, Linux and Windows release >=9.5.)

o 1 When to perform this service

o 2 How to perform the service

- 2.1 General Steps

- 2.2 How to perform those steps in the Solution Manager

o 3 Prerequisites

- 3.1 Prerequisites on Solution Manager

- 3.2 Prerequisites on Managed System

- 3.3 Non-technical Prerequisites.

o 4 Frequently Asked Questions

Note that those topics are discussed in detail in the corresponding "ExpertGuided Implementation session" (seehttp://service.sap.com/expert-guided-implementation).

Other termsGSS_SQL, performance, expensive statements

Reason and Prerequisites

Solution

1 When to perform this service

The Self Service "SQL Statement Tuning" aims to optimize the general systemperformance by reducing the impact from those SQL statements that have thehighest contribution to the overall DB load. This means: in order to get anoticeable effect, this service should be performed if:

- There is a general performance problem.

- Database time contributes significantly to the overall responsetime.

- Significant DB load is caused by only a small number of SQLstatements.

Page 2: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 2 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

In an EarlyWatch Alert report, the rating of the section "Database serverload from expensive SQL statements" is defined according to those criteria(See SAP Notes 551646, 1625795 for details). If this section is rated"yellow" or "red", an "Alert" is raised inside the EarlyWatch Alert sessionand the recommendation to perform the Self Service "SQL Statement Tuning"is provided in the report.

2 How to perform the service

2.1 General Steps

The service consists of steps:

o Preparation:

First, the system to be analyzed needs to be chosen. Then, it hasto be decided whether the analysis should be based on data alreadycollected in a previous EarlyWatch Alert session (for example whentrying to analyze exactly those SQL Statement responsible for"yellow" or "red" rating in an EarlyWatch Alert report) or whetherfresh data need to be collected. Note: While the collection offresh data takes some time (depending on the system, the collectiontime can vary between several minutes to more than one hour), nodelay is caused when existing data from a previous EarlyWatch Alertreport are to be analyzed.

o Analysis:

The data collected in the "Preparation" step lead to a list of SQLstatements to be analyzed. Technical details of those SQLstatements are provided both to support and to document theanalysis. Each SQL statement is classified and an appropriateanalysis path is provided. The order of the steps in the analysispath follows the preference for the different possible solutions.Once one of the steps in the analysis path provides a solution forthe analyzed SQL statement, the next SQL Statement can be analyzed.Finally, an HTML or Word document can be generated, documentingboth the details of the problematic SQL statements and the solutionfound in the analysis.

o Follow Up:

After the analysis is finished, a follow-up is required: themeasures recommended in the analysis step needs to be performed,i.e. the appropriate person or organization needs to be informed.

2.2 How to perform those steps in the Solution Manager

The Solution Manager helps to perform those steps. Depending on the releaseof the Solution Manager system, performing the Self Service "SQL StatementTuning" in a slightly different way.

Page 3: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 3 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

o Solution Manager runs ST 7.1

Using transaction "solman_workcenter", the Work Center "SAPEngagement and Service Delivery" can be opened. By pressing"Services", an overview of the existing services for the selected"Solution" is given. Pressing "Create" allows the creation of the(Guided) Self Service "SQL Statement Tuning". A Guided Procedureappears with the steps (1) "Preparation" (2) "Analysis" (3)"Report" and (4) "Follow-Up".

In the first sub-step of the "Preparation", an overview of thesystems in the solution is given together with information whetheran analysis can be performed and whether an analysis wasrecommended in a recent EarlyWatch Alert report. The final step"Follow-Up" links the results of the Analysis with the "IssueManagement" of the Solution Manager: for each finding in the"Analysis", a "Task" is created that can be assigned to theappropriate processor. If the "Issue Management" in the solutionmanager is not used, the follow-up steps have to be performedwithout support by the tool.

o Solution Manager runs ST 400 and ST-SER 701_2010_1

Like in case of a Solution Manager with ST 7.1, the service("Guided SQL Tuning - Session") can be created in the Work Center"SAP Engagement and Service Delivery". However, after the serviceis created, the session will not be opened automatically. Instead,it is necessary first to click the triangle symbol in front of theservice name. After this is done, a new line with the session title"SQL Statement Tuning" appears. This line has to be marked in orderto see the "Details of Service". In the tab "Sessions" of the"Details of Service", the button "Create Questionnaire" needs to bepressed to create a second entry "Guided Self Service: SQL Tuning -Questionnaire" along the previous entry "Guided Self Service: SQLTuning - Session" in the table "Session".

After the "Questionnaire" and the "Session" are created, theprocedure is similar to the ST 7.1 situation: By clicking "GuidedSelf Service: SQL Tuning - Questionnaire", a new screen opens andallows to perform the first step "Preparation". After the"Preparation" is completed, the step "Analysis" can be performed byclicking "Guided Self Service: SQL Tuning - Session". After theanalysis is completed, the button "Word Document" can be pressedinside the session in order to create the report. Finally, also thefollow-up steps can be performed (if required) with the "IssueManagement" functionality of the Solution Manager: After the reporthas been created, the "Details of Service: SQL Statement Tuning"needs to be refreshed: after the refresh, two new tabs appear: inthe tab "Attachments", the word report can be found and in the tab"Assigned Issues", the tasks created by the analysis are listed andcan be distributed to the appropriate person.

o Solution Manager runs ST 400 and ST-SER older than701_2010_1

In this situation, the tool does not provide a convenient guidance

Page 4: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 4 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

through the various steps. Nonetheless, the essential buildingblocks are already available and the process can be performed,although additional manual steps are required.

The motivation to perform an SQL tuning can still be provided bythe EarlyWatch Alert report: if the section "Database server loadfrom expensive SQL statements" points to problems caused by"expensive" SQL statements, those statement should and can beinvestigated with already existing tool: In the Work Center "SAPEngagement and Service Delivery", a "SAP EarlyWatch Health Check"for specific system can be created. After the session is created,the service data needs to be collected. This happens usually onceper night, i.e. the session can be performed only at the followingday (unless the collection of service data is initiated manually).

Before starting the "EarlyWatch Health Check", it needs to beverified that the service data are already available. This can bedone in the tab "Sessions" in "Details of Service: EarlyWatchHealth Check": Clicking on "SDCC Download" results either in thewarning "No SDCC download exists." or the collected data aredisplayed in a new screen. Only after the SDCC download isavailable, session "Self Service: SAP EarlyWatch Health Check" canbe started successfully.

Performing the "EarlyWatch Health Check" could be done in twodifferent ways: if a general health check is to be performed, allthe steps of this session need to be performed. However, if theanalysis should focus only on expensive SQL Statements, many stepscan be ignored: First, just the step "Session Initialization" needsto be saved. After this step has been performed, only the check"SQL Cache and ABAP Program Analysis" and its sub-steps are to beexecuted.

The word report can be created by pressing the button "Word Report"within the "EarlyWatch Health Check". In case the analysis wasconcentrating exclusively on the SQL statements, the generatedreport needs some "cleaning up": sections that were generatedautomatically as part of a general analysis should be removed.

In case the "Issue Management" is used, issues need to be bothcreated and assigned to the "EarlyWatch Health Check" manually.

3 Prerequisites

3.1 Prerequisites on Solution Manager

o Software:

- For Oracle, a basic version of the "SQL Statement Tuning"should be possible with a Solution Manager running on ST 7.0 SP18 with ST 400 SP18 and the content edition ST-SER 701_2008_2.If the session is to be performed for DB2 UDB LUW, ST-SER701_2010_1 with SP 10 is required.

- In order to profit both from bug-fixes and further improvement,

Page 5: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 5 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

we recommend to use the content edition ST-SER 701_2010_1either with the highest possible support package (see SAP Note569116) or (even more convenient) by activating the "SAPservice content update" (See SAP Note 1143775).

- For ST 400, note that the possibility to perform the SQL Tuningwith the dedicated "Guided SQL Tuning - Session" (as describedin the second option in section 2.2) is available only ifST-SER 2001_2010_1 Support Package 2 is installed or if thecontent update is used. In that latter case, in addition to usethe content update, SAP Note 1317901 (for ST 400, SP 16 - 24)or 1491227 (for higher SP) has to be taken into account: Inpoint 1 of those note, it is described how to "register a newservice": this step needs to be done also to have the "GuidedSQL Tuning - Session" available: After implementing thecorrections from the corresponding SAP Note, transactionAGS_UPDATE needs to be called. After pressing "Register NewService" the service with the Package ID "GSS_SQL" has to bemarked.

- While as of ST 400 SP 22, no additional steps are required (aslong as Customizing is implemented with transactionSOLMAN_SETUP), in other case, the Business Configuration ("BC")set SOLMAN40_ISTR_ADDFUNC_007 needs to be activated withtransaction SCPR20 (see SAP Note 903528)

- For ST 400 SP > 23 and SP < 27: Implement SAP Note 1517658,1550309

o Customizing:

- If the session is to be performed for a DB2 UDB LUW system withST-PI 2008_1_[46C-710] SP < 5 or on a Solution Manager systemwith ST-SER 701_2010_1 SP < 12, a valid database connection tothe database has to be maintained (see SAP Note 1267189 fordetails). This database connection should be assigned to themanaged system with transaction SMSY (or LMDB): search for therelated database, choose the "Other Attributes" tab, and enterthe remote database connection as the value for the "RemoteDatabase Connection" attribute (Note: if the Solution Manageris running on ST 7.1, trying to edit those values in SMSY willopen a window from the LMDB. The attribute "Remote DatabaseConnection" can be maintained in the tab "Custom Attribute" ofthis window.)

o Solution:

- The system to be analyzed has to be assigned to the solution inwhich the service is created.

o EarlyWatch Alert:

- The EarlyWatch alert report helps to motivate performing theSQL Tuning Service and provides background information aboutother issues on the system to be investigated. It is thereforehighly recommended to have the EarlyWatch Alert activated forthat system (see SAP Note 1257308 for details about "setup" and"troubleshooting" of the EarlyWatch Alert).

Page 6: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 6 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

o Authorizations:

- The user performing the session in the Solution Manager needsthe authorization to use transaction solman_workcenter, toaccess the Work Center "SAP Engagement and Service Delivery"and to create and process a self service within this WorkCenter. This could be achieved by assigning the roleSAP_SOLMAN_ONSITE_COMP (See SAP Note 872800) to the user.

3.2 Prerequisites Managed System

o General

- Currently, the "SQL Tuning Service" supports only ABAP basedsystems running Oracle or DB2 UDB for Linux, Unix and Windows.

o Software:

- The managed system needs ST-PI 2008_1_[46C-710] or higher.

- For Oracle: If SP 4 is installed, SAP Note 1564508 needs to beapplied.

- For DB2 UDB LUW: the managed system needs SAP Basis release >=7.0.

- For DB2 UDB LUW: the database release has to be 9.5 or higher.

o Authorizations:

- The person performing the "SQL Tuning Service" has to have theauthorization to access the managed system and to usetransaction sdccn and st04. The needs are met when the user iscreated with the "Minimum Authorization Profile for RemoteService" as described in SAP Note 1405975.

- In the preparation step, the possibility is offered to collectcurrent data from the solution manage system. Depending on theauthorizations of the user of the "read" connection, thecollection of the data might be started immediately or onlywith some delay. If a delay is observed, it needs to be ensuredthe user used in the "Read" RFC connection has the necessaryauthorization. This could be achieved either by re-creating theuser with an updated profile based on SAP Note 1572183.Alternatively, the profile S_SDCC_SERVN (see SAP Note 763561)could be assigned manually to the user used for the readconnection.

Page 7: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 7 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

3.3 Non-Technical Prerequisites

o Skill-set of the person performing the "SQL TuningService":

- The person performing the service should be familiar with thetechnical monitoring tools of ABAP based SAP Systems.

- Basic knowledge on databases and SQL Statement tuning isessential in order to use the tool in an efficient way. Note:SAP Note 766349 can provide a first introduction into "OracleSQL optimization".

4 Frequently Asked Questions

o Is the "SQL Tuning Service" available only for Oracleand DB2 UDB LUW ?

While currently, only Oracle and DB2 UDB LUW are supported, it isplanned to enable the service to support other databases in thefuture.

o Is there an "SQL Tuning Service" available for JAVA?

No. Currently, even in an SAP delivered service, the statementanalysis is done without tool-support. Especially the "businessbackground" cannot be determined in a straightforward way as incase of an ABAP based system. On the other hand, currently, thereis only limited demand for such services. Therefore, for the timebeing, there are no plans to develop tools to support the analysisin an SAP delivered service. Consequently, it is currently notpossible to offer such a service as a Self Service which would haveeven higher demands on the usability and robustness than a SAPdelivered service.

Header Data

Release Status: Released for CustomerReleased on: 01/16/2012 14:16:29Master Language: EnglishPriority: Recommendations/additional infoCategory: FAQPrimary Component: SV-SMG-SER SAP Support Services

Valid Releases

Software Component Release FromRelease

ToRelease

andSubsequent

ST-SER 701 701_2008_2

701_2010_1

X

Page 8: 1601951 SelfSer Sqltuning Faq Prereq v3

02/14/2013 Page 8 of 8

SAP Note 1601951 - Self Service 'SQL Statement Tuning' -Prerequisites and FAQ

Related Notes

Number Short Text

1625795 DB2 UDB (LUW) SQL check rating strategy for EarlyWatch Alert

1609155 Guided Self Services

1572183 Authorizations for SAP Solution Manager RFC users

1564508 /SDF/RSORADLD_NEW: No statements during autom. download

1550309 DSWP: Questionnaire related error

1517658 SD: Incorrect error message while opening self service

1491227 Adjustments to service content update from ST 700 SP 23

1405975 Minimum Authorization Profile for Remote Service Delivery

1317901 Service content update

1267189 DBA Cockpit: DB2 for LUW as Remote Database

1257308 FAQ: Using EarlyWatch Alert

1143775 SAP Service Content Update

903528 Solution Manager issue management and service plan: BC sets

872800 Roles for SAP Solution Manager: SAP service provider

766349 FAQ: Oracle SQL optimization

763561 Service Data Control Center (SDCCN) - FAQ

569116 Release strategy for Solution Manager Service Tools (ST-SER)

551646 Oracle SQL check rating strategy for EarlyWatch Alert