ABAP How To on SQL Trace Analysis



Similar documents
Creating Transaction and Screen Variants

Step by Step Guide for Language Translation Tool

Quick Viewer: SAP Report Generating Tool

Step by Step Guide How to Copy Flat File from Other Application Server to BI and Load through Info Package

Deploying Crystal Reports on Top of a SAP BI Query

Web Dynpro ABAP: ALV and Table in Popup Window

Reverse Transport Mechanism in SAP BI

Display Options in Transaction SE16

Embedding Crystal Reports inside ECC ALV Reports

Restricting Search Operators in any Search View

Creating Content Using SO10 Objects and Text Symbols

Deleting the User Personalization done on Enterprise Portal

SAP BW - Excel Pivot Chart and Pivot Table report (Excel)

Workflow Troubleshooting and Monitoring in SAP ECC 6.0

Creating Web Service from Function Modules/BAPIs & Integrating with SAP Interactive Forms

ALE Settings, for Communication between a BW System and an SAP System

LSMW: Upload Master Data using Batch Input Recording

SPDD & SPAU Adjustments Handbook

Web Dynpro: Multiple ALV Grids and Layouts in ALV

Creation and Configuration of Business Partners in SAP CRM

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Deleting the Requests from the PSA and Change Log Tables in Business Intelligence

Step by Step guide of Report-to- Report Interface in BW Reporting

Exposing RFC as Web Service and Consuming Web Service in Interactive Forms in ABAP

How to Assign Transport Request for Language Translation?

Release Strategy Enhancement in Purchase Order

SAP List Viewer (ALV): Classic

SAP CRM 7.0 E2C Setup: CRM via Toolset

ABAP Proxy Interfacing

How to Modify, Create and Delete Table Entries from SE16

Maintenance Bills of Material (CS-BD/PM-EQM-BM)

Step By Step Procedure to Create Logical File Path and Logical File Name

SAP Workflow in Plain English

Understanding BW Non Cumulative Concept as Applicable in Inventory Management Data Model

PLSAP CONNECTOR FOR TALEND USER MANUAL

How to Generate Stack Xml for Ehp4 and Above Upgrade

Query OLAP Cache Optimization in SAP BW

Table of Contents. Passing Data across Components through Component Controller between Two Value Nodes

Currency Conversion using Variables in SAP BI -Reporting

SAP NetWeaver Developer Studio 7.30 Installation Guide

ABAP Debugging Tips and Tricks

Creating New Unit of Measure in SAP BW

SAP GRC Access Control: Background jobs for risk analysis and remediation (formerly Virsa Compliance Calibrator)

SAP FI - Automatic Payment Program (Configuration and Run)

Creating and Scheduling Publications for Dynamic Recipients on SAP Business Objects Enterprise

Step by Step Procedure to Block and Debug a CIF Queue Flowing from R/3 to APO System

BC407 Reporting: QuickViewer, InfoSet Query and SAP Query

BC450 ABAP Performance: Analysis and Optimization

Salesforce.com Integration Using SAP PI: A Case Study

Microsoft Dynamics GP. Audit Trails

How to Integrate CRM 2007 WebClient UI with SAP NetWeaver Portal

Sending an Image File Through XI in a File-to-Mail Scenario

SDN Contribution Beginners guide to CRM Interaction Center (IC) Winclient setup

Process Controlled Workflow SRM 7.0 (Using BRF)

SAP HANA SPS 09 - What s New? Administration & Monitoring

StreamServe . User Guide SP2 Rev A

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PI

The Payroll Process HELP.PYINT. Release 4.6C

Different Types of Alerts for Process Chains. Table of Content

PUBLIC. How to Use in SAP Business One. Solutions from SAP. SAP Business One 2005 A SP01

Compounding in Infoobject and Analyzing the Infoobject in a Query

Configuration and Utilization of the OLAP Cache to Improve the Query Response Time

SAP CRM Campaign Automation

Standard SAP Configuration of SMS through HTTP with Third Party SMS Gateway

ABAP SQL Monitor Implementation Guide and Best Practices

Extend the SAP FIORI app HCM Timesheet Approval

A Step-by-Step guide on SMTP Configuration and File to Mail Scenario Using Process Integration Scenario in PI 7.1

Microsoft Dynamics GP. Cash Flow Management

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Methodology to Implement SAP Process Integration

Data Integration using Integration Gateway. SAP Mobile Platform 3.0 SP02

SAP CRM 7.0 for Newbies: (Part 1) Simple BOL Object Creation for CRM Webclient UI

Data Extraction and Retraction in BPC-BI

Business Portal for Microsoft Dynamics GP. Project Time and Expense Administrator s Guide Release 10.0

Extractor in R/3 and Delta Queue

Create Automatic Mail Notification/ Alert for Process Chain Monitoring

Sales Rush Sales Order Processing S01- Lean Baseline Package. SAP Lean Baseline Package Version: V1.500 Country: UK Language: EN Date: February 2006

SAP CRM-BW Adapter an Overview

Tutorial: Mobile Business Object Development. SAP Mobile Platform 2.3 SP02

Microsoft Dynamics GP Audit Trails

SAPScript. A Standard Text is a like our normal documents. In Standard Text, you can create standard documents like letters, articles etc

Web Application Designer for Beginners

Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc.

Step by Step Guide to Extract Batch Master Data via Generic and Classification Datasource to BW

Invoice Collaboration: Self Billing Invoice

Working with SAP BI 7.0 Data Transfer Process (DTP)

Microsoft Dynamics GP. Pay Steps for Human Resources Release 9.0

CA Clarity PPM. Project Management User Guide. v

Payments HELP.PYINT. Release 4.6C

First step to Understand a Payroll Schema

InfiniteInsight 6.5 sp4

Response Time Analysis of Web Templates

Salesforce Integration Using PI: How to Perform Query and Other DML Operations Using the Enterprise WSDL

Configuration of Enterprise Services using SICF and SOA Manager

Splitting the Custom Container & Display more than one ALV

Microsoft Dynamics GP. Collections Management

Using SAP Crystal Reports with SAP Sybase SQL Anywhere

Merge PDF files in ABAP

BW Performance Monitoring

Step by Step Procedures to Load Master Data (Attribute and Text) from FlatFile in BI 7.0

Transcription:

Applies To: ABAP Summary SQL trace is a performance analysis tool that shows how open SQL statements are converted into native SQL statements. The following document discusses the performance measure utility of SAP SQL Trace Analysis (Transaction code ST05). By: Prabaharan Gnanasekaran Company and Title: Wipro Technologies Date: 20 Jan. 2004 Performing an SQL Trace Step 1: Access transaction ST05. From the initial screen, click the check box for SQL trace, under the trace requests, click Trace on. Step 2: Run the program containing the SQL query that needs to be analyzed in the SE38 editor. Step 3: Come back to ST05 screen, undertrace requests, click Trace off. Step 4: Click List trace to view the trace of the current statement. 2005 SAP AG 1

Screen shot of the initial ST05 screen 2005 SAP AG 2

After clicking list trace 2005 SAP AG 3

Basic List Trace The basic list trace shows the sequence of database operations that are taking place while a query is processed, it includes prepare, fetch, open, reopen, execute. In addition the basic list trace also gives the duration execution for each of the operations with color legend. Summarizing the basic trace list (menu path: Goto Summary) A basic trace list can be summarized to see the summation of execution times of similar database operations. Use menu path: Goto Summary. The above screen shot depicts the summed up execution time. The summary option lists the summed up execution time of all the queries that the SQL trace has captured at its runtime, but the identification of a particular query can be done using the PID Process ID which is displayed as the first column of the above screen shot. For example, 896 is the process ID for one of the SQL statements. 2005 SAP AG 4

Summary of a particular trace To get the total execution time, specifically for a particular SQL Statement, select all the PID corresponding to it and click summarize in the application toolbar. This leads to a compressed data of SQL trace as above. Color legends indicating the processes in a trace 1 Use the menu path: Goto -> Show color legend to know about the color specification in the trace. 2005 SAP AG 5

Color legends indicating the processes in a trace 2 The above screen shot indicates that the query execution time has exceeded its threshold with the link pink color. A change in object name is indicated with the change in color to yellow. These colors thereby indicate whether the query is well written and also the current status of the database server. Extended list 2005 SAP AG 6

(From basic trace list: click extended list button in application toolbar to view the extended list).the extended list shows the cursor id declared for the SQL statement, the connection type also. Cursors: A cursor is a handle or name for an area in memory in which a parsed statement and other information for processing the statement are kept; such an area is also called a private SQL area. Although most Oracle users rely on the automatic cursor handling of the Oracle utilities, the programmatic interfaces offer application designers more control over cursors. In application development, a cursor is a named resource available to a program and can be used specifically for the parsing of SQL statements embedded within the application. Identical select statements Use the menu path: Goto Identical Selects to view a comprehensive list of identical select statements executed during the trace and the number of times they were executed. Identical select statements are grouped based on the where clause. Note that identical select statements have similar execution plan used for their processing thereby saving time of execution and provide increased performance, too. 2005 SAP AG 7

Identical select statements displayed The above screen shot shows the list of identical select statements and the number of time they got executed. Database Operations Measured by SQL Trace The SQL Trace analysis helps in measuring the execution time of the following data base operations that are performed when executing an SQL statement. 1) DECLARE: This operation declares a new cursor and assigns the SQL statement to that cursor created. 2) PREPARE: This operation converts the SQL statement into native SQL and frames out an execution plan for that statement. 3) OPEN: This operation opens the declared cursor and passes the parameters for database access. 4) FETCH: This operation passes one or more data records fetched to the database interface of the R/3 system. 5) REOPEN: Once a new select statement is brought in then this operation opens the cursor previously declared for previous select statement and performs new parameter passing to the database. 6) EXEC: Passes the parameters for the database statement, and executes the statements that change data in the database (such as UPDATE, DELETE, or INSERT). Disclaimer & Liability Notice This document may discuss sample coding, which does not include official interfaces and therefore is not supported. Changes made based on this information are not supported and can be overwritten during an upgrade. 2005 SAP AG 8

SAP will not be held liable for any damages caused by using or misusing of the code and methods suggested here, and anyone using these methods, is doing it under his/her own responsibility. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of the technical article, including any liability resulting from incompatibility between the content of the technical article and the materials and services offered by SAP. You agree that you will not hold SAP responsible or liable with respect to the content of the Technical Article or seek to do so. Copyright 2005 SAP AG, Inc. All Rights Reserved. SAP, mysap, mysap.com, xapps, xapp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product, service names, trademarks and registered trademarks mentioned are the trademarks of their respective owners. 2005 SAP AG 9