Translate

Program runs very long: Performance analysis

A program runs for an exceptionally long time. How can you determine which database access takes too long.

Due to inadequate programming, a database acess can take an extremely long time. There can be various causes: multi-nested SELECT, not using indices effectively, missing or non-selective specifications in the WHERE clause, for-all-entries with empty table, no specifications in the selections screen (incorrect handling of variants), and so on.

Solution

    1. Determine whether the system is slow in total or only the particular program (see Note 15374). For the analysis and solution of general performance problems and for the support of the system administration you should carry out the EarlyWatch service in your system regularly.

    2. Determine which program is affected exactly. (Transaction profile -- see Note 15374). Transaction ST03 can be used for the identification of long-running transactions. With this transaction, the runtime statistics can displayed. Choose the button 'Choose for Analysis', select the computer, select the period; select the workprocess type via the buttons 'Dialog', 'Background' and display the runtimes via 'Top-Time' or 'Transaction Profile'. Potential causes of the problem with extensive database accesses typically have have a DB portion of >80% from the entire runtime.

    3. Creating the SQL trace:

        a) Activate the SQL TRACE immediately before executing the respective transaction. For this, call Transaction ST05 in a new mode. For Releases <= 4.0B, then choose the button TRACE ON and enter the user name for which you want to create a trace. As of Release 4.5A, enter the user name under 'Trace on with filter'.

                       As of Release 4.0A: With the radio buttons 'Trace Mode' you can log the response times via RFCs and Enque locks. We recommend to record this information in the trace.

                       Notes:
Make sure that the program to be examined runs on the same application server on which you started the ST05.
Ensure that you only measure one program at a time. That is, the traced user may have occupied only one workprocess on the application server.
During the first execution of a program, data bank accesses are carried out to fill R/3-internal buffers. A trace for the performance measurement can only be used with the second execution.

        b) After this, restart the transaction to be measured on the old window. When it is finished, switch off the SQL trace again by choosing the button 'Trace Off' and then select 'LIST TRACE'.

                       AS of Release 4.0A: Display all Trace Modes (activate all buttons). In the trace, choose the button 'More Info' or 'extended List', in order to display important details and time stamps and calling programs.

        c) In the displayed listing, you can now analyze all SQL statements with their particular DB delay time - column DURATION. The values are issued in the unit microseconds.

                       You can download the trace with Okay Code% PC. Use 'Not converted' as file format, since this text format can be read easiest and reprocessed, if necessary.

                       You can identify the calling program by doubleclicking on the particular line on the program or choosing the button 'ABAP display'. Note down the program name, the line number, changed by, since this information is required for further processing.

                       With the button 'Explain SQL' you receive an overview on how the database carried out the SQL query. You should also save this information since this information is essential for further analysis.
Under ORACLE: Click the table name(s). Also save the information on the indices defined on this table.

    4. Calls of runtime statistics (statistical records):
    In addition to the SQL trace we recommend to display the statistics records.
    Execute Transaction STAT on the same application server. Enter the name of the user you traced and enter the approximate time interval. On the statistics records, you can see the entire execution time, that is, not only the database time but also other portions which determine the runtime. Example (1) The CPU time which was needed on the application server and (2) times for loading and generating. If one of these response time portions is higher than the database time, generally no SQL problem exists but there are high execution times in the ABAP program (in case (1)) or there are problems with program or table buffers (in case (2)).
    Store this information since it is essential for further analysis.


Important: long access times are by no means always caused by unfavorable programming. There may be other reasons such as corrupt indexes, database tables blocked by other users, incorrect parameter setting of the database, bottleneck situation on the hard disks.

If you identified a long-running SQL query:
Do not carelessly change indexes. In particular, indices of the SAP standard should not be changed without SAP consultation.
If it is a long-running statement in the SAP standard system, open a message to SAP and enter the above-mentioned information in the message (program part, execution plan, index definitions, runtime statistics (statistical record)).
If the problem occurs due to program changes made by you, ask your consultant to solve the problem or request an EarlyWatch express (see Note 61781), in order to receive additional support by SAP.

No comments:

Labels

sap hana hana database aws s4 hana hana db s4hana conversion steps sap hana azure bw4hana hana migration s4hana migration sap cloud migration steps sap hana migration steps sap hana migration to azure s4hana sap fiori fiori performance fiori erp s4 hana fiori sap fiori app sap fiori client sap fiori launchpad sap s4 hana fiori cisco ecc AI SAP AI abap dumps hana sap S/4HANA S/4HANA Conversion best sap ui5 & fiori training configuration database fiori tutorial on webide free sap ui5 & fiori training s/4 hana sap dumps sap fiori tutorial sap ui5 sap ui5 & fiori sap ui5 & fiori tutorial sara ui5cn 2367245 - Troubleshooting performance issues with SAP BPA Amazon free tier for SAP AWS setup Experience CALL_FUNCTION_NOT_FOUND CCMS Configuration and Use Create New Data Class in SAP (Oracle) Critical top SAP Abap dumps DHCP Clients Not Receiving IP Addresses Download Stack.xml HAN-DB HAN-DB-ENG High CPU Usage Due to Excessive Process Switching How To How to Start and Stop SAP Hana Tenant Database How to change SAP Hana Sql Output results are limited to 5000 Records How to perform SAP Dual Stack Split - Netweaver Inactive Objects in SAP Intercompany transactions in SAP AP / AR : Cross Company Code Transaction Interface Flapping Due to Duplex Mismatch KBA LOAD_PROGRAM_LOST MSSQL shrinking transaction log file Migrating to SAP hana database NAT Overload Causing Internet Access Failure Note 500235 - Network Diagnosis with NIPING OSPF Adjacency Not Forming PRINCE2 Foundation Sample Questions Preparing for S/4HANA Conversion and the MUST know items Push to Download Basket S/4HANA Migration Cockpit S/4JANA SAP BI Support Data Load Errors and Solutions SAP BI/BW Landscape SAP BPA SAP Basis SAP Basis Automation SAP Business Objects SAP CPS SAP Certification SAP FI Certification SAP FI Certification Sample Questions SAP HANA Admin - Cockpit SAP HANA DB Engines SAP HANA Database SAP HANA terminate session connection disconnect cancel kill hang stuck SAP Hana DB restore SAP Hana Numeric Error Codes SAP Landscape SAP Language installation SAP MM and Purchase Order Tables SAP Maintenance Planner SAP Note 500235 SAP R/3 Glossary SAP Readiness Check SAP S/4HANA 1709 Installation Files SAP S/4HANA 2023 SAP S/4HANA 2023 Installation SAP S/4HANA 2023 running SAP S/4HANA Installation SAP Scheduling SAP Solman 7.2 CHARM: SAP Support Package Stack Strategy SAP Support package SAP Upgrade SAP support stack upgrade SP stacks STORAGE_PARAMETERS_WRONG_SET SUSE/SLES/Kernel versions Setup of S/4hana 2023 TSV_TNEW_PAGE_ALLOC_FAILED TSV_TNEW_PAGE_ALLOC_FAILED error Transaction ID Unable to download an SAP Note Unix/Linux Command That Are Helpful For SAP Basis Upgrading SAP Kernel Without Downtime Upgrading windows server 2008 to windows server 2019 What is OSS Notes? SAP SNOTE Tutorial accounting agile ale idoc ale/edi archive FI documents audit auditing auditor aws aws cloud basic type bluefield approach ccms ccmsidb charm copilot datavard dbacockpit download sap note download snote edi idoc electronic data interchange enable sap archiving objects erpprep ffid firefighter fraud functional hana admin how to apply sap security note https://www.erpprep.com/ idoc install install sap fiori installation interfaces intermediate document internal control license key linux version materials management messsage niping test order type port prince2 agile prince2 agile practitioner purchasing quick info s4 hana sap abap dumps sap abbreviations sap activate certification sap activate project manager sap authorization sap aws sap brownfield sap ccms sap ccms configuration sap erp sap error sap grc sap greenfield sap internet demo system sap license sap maintenance certificate sap material management sap meaning sap mm sap mm consultant sap monthly security note sap netweaver sap network diagnostic sap niping sap note sap oss sap patch day sap performance sap performance issue sap purchase order sap s/4hana sap sales and distribution sap sap otc sap sd sap sd certification training sap sd course sap sd jobs sap sd module sap sd online training sap sd training sap sd tutorial sap sd tutorial for beginners sap security sap security note sap snote sap snote tutorial sap solution manager sap sql segregation of duties separation of duties sles slicense smc snote snote in sap system sod conflict solution manager solution maneger stop start hana database suse linux techie trex two step upgrade required waterfall