https://raw.githubusercontent.com/ajmaradiaga/feeds/main/scmt/topics/NW-ABAP-Monitoring-Tools-blog-posts.xml SAP Community - NW ABAP Monitoring Tools 2024-05-20T11:11:15.400884+00:00 python-feedgen NW ABAP Monitoring Tools blog posts in SAP Community https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-abap-system-on-aws-using-cloudwatch-part-ii/ba-p/13517389 Monitoring of ABAP System on AWS Using CloudWatch – Part II 2021-04-11T09:38:07+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 <STRONG>This is in continuation of my previous blog post <A href="https://blogs.sap.com/2021/04/11/monitoring-of-abap-system-on-aws-using-cloudwatch-part-i/" target="_blank" rel="noopener noreferrer">Monitoring of ABAP System on AWS Using CloudWatch – Part I</A></STRONG><BR /> <H1 id="toc-hId-829420700">4. DEPLOYMENT OF LAMBDA FUNCTION</H1><BR /> <H2 id="toc-hId-761989914">4.1 Using Serverless Application Repository</H2><BR /> Go to <STRONG>Serverless Application Repository</STRONG> from <STRONG>AWS Console</STRONG> and then go to <STRONG>Available applications</STRONG> →&nbsp;<STRONG>Public Applications</STRONG> and search for <STRONG>sap-monitor</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-21.png" /></P><BR /> Fill out all the required details for the connectivity to the SAP system which has following<BR /> <UL><BR /> <LI><STRONG>Application Name</STRONG>: This is the stack name of the application created via AWS Cloud Formation</LI><BR /> <LI><STRONG>SAPSIDParameter</STRONG>: SAP System ID</LI><BR /> <LI><STRONG>LayerVersionParameter</STRONG>: need to provide sapjco Lambda Layer Version</LI><BR /> <LI><STRONG>SecurityGroupParameter</STRONG>: Need to provide Security Group IDs which needs to be assigned to the Lambda Function</LI><BR /> <LI><STRONG>SubnetParameter</STRONG>: Need to provide Subnet IDs which will provide Internal IP address for the Lambda execution</LI><BR /> <LI><STRONG>SAPClientParameter</STRONG>: Need to Provide Client Number of SAP</LI><BR /> <LI><STRONG>SAPHostParameter</STRONG>: Need to provide hostname/IP-Address of Primary Application Server</LI><BR /> <LI><STRONG>SAPInstanceIDParameter</STRONG>: Need to provide the SAP Instance Number</LI><BR /> <LI><STRONG>SAPRFC0UserParameter</STRONG>: Need to provide RFC User for Lambda Function</LI><BR /> <LI><STRONG>SAPRFC1PasswordParameter</STRONG>: Need to provide the password the RFC user</LI><BR /> <LI><STRONG style="font-size: 1rem">ScheduleParameter</STRONG><SPAN style="font-size: 1rem">: This will schedule /SDF/MON job automatically into the system</SPAN></LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-22.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-23.png" /></P><BR /> This will start the deployment at AWS Cloud formation of the Lambda functions with the parameters provided<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-24.png" /></P><BR /> Below screen will appear when the deployment gets finished<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-25.png" /></P><BR /> We can see the deployed Lambda function in <STRONG>AWS Console</STRONG>.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-26.png" /></P><BR /> <BR /> <H2 id="toc-hId-565476409">4.2 Using AWS CloudFormation</H2><BR /> It could happen that the application in Serverless Application Repository is not available for some of the regions then in that case we can also use <STRONG>AWS Cloud Formation</STRONG> template to deploy the same<BR /> <BR /> Go to <STRONG>AWS Cloud Formation</STRONG> from the <STRONG>AWS console</STRONG> → Go to <STRONG>Create Stack</STRONG> and then click on <STRONG>With new resources (standard)</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-27.png" /></P><BR /> Manually upload the below Cloud Formation template<BR /> <PRE class="language-markup"><CODE>AWSTemplateFormatVersion: '2010-09-09'<BR /> Transform: AWS::Serverless-2016-10-31<BR /> Description: SAP NetWeaver ABAP Monitoring sap-monitor-&lt;SID&gt;<BR /> Globals:<BR /> Function:<BR /> Timeout: 60<BR /> Metadata:<BR /> AWS::ServerlessRepo::Application:<BR /> Name: sap-monitor<BR /> Description: Amazon CloudWatch Monitoring for SAP NetWeaver ABAP-based environments.<BR /> Author: mtoerpe<BR /> SpdxLicenseId: Apache-2.0<BR /> LicenseUrl: s3://sap-monitor/34400b68072d710fecd0a2940a0d1658<BR /> ReadmeUrl: s3://sap-monitor/cb03873fab47b4d2e631b2ecfdd66ff3<BR /> Labels:<BR /> - sap<BR /> - netweaver<BR /> - monitoring<BR /> - cloudwatch<BR /> HomePageUrl: <A href="https://github.com/aws-samples/amazon-cloudwatch-monitor-for-sap-netweaver" target="test_blank" rel="nofollow noopener noreferrer">https://github.com/aws-samples/amazon-cloudwatch-monitor-for-sap-netweaver</A><BR /> SemanticVersion: 1.0.5<BR /> SourceCodeUrl: <A href="https://github.com/aws-samples/amazon-cloudwatch-monitor-for-sap-netweaver" target="test_blank" rel="nofollow noopener noreferrer">https://github.com/aws-samples/amazon-cloudwatch-monitor-for-sap-netweaver</A><BR /> AWS::CloudFormation::Interface:<BR /> ParameterGroups:<BR /> - Label:<BR /> default: Network Configuration<BR /> Parameters:<BR /> - SubnetParameter<BR /> - SecurityGroupParameter<BR /> - Label:<BR /> default: SAP Configuration<BR /> Parameters:<BR /> - SAPSIDParameter<BR /> - SAPHostParameter<BR /> - SAPInstanceIDParameter<BR /> - SAPClientParameter<BR /> - SAPRFC0UserParameter<BR /> - SAPRFC1PasswordParameter<BR /> ParameterLabels:<BR /> SubnetParameter:<BR /> default: Which VPC Subnet(s) should this be deployed to?<BR /> SecurityGroupParameter:<BR /> default: Which Security Groups should be applied?<BR /> Parameters:<BR /> SubnetParameter:<BR /> Type: List&lt;AWS::EC2::Subnet::Id&gt;<BR /> Description: Provide Subnet(s) IDs, separate by comma<BR /> SecurityGroupParameter:<BR /> Type: List&lt;AWS::EC2::SecurityGroup::Id&gt;<BR /> Description: Provide Security Group(s) IDs, separate by comma<BR /> LayerVersionParameter:<BR /> Type: String<BR /> Description: Provide &lt;sapjco&gt; Lambda layer version<BR /> Default: '1'<BR /> ScheduleParameter:<BR /> Type: Number<BR /> Description: Schedule /SDF/SMON job automatically (true = 1, false = 0)<BR /> Default: 1<BR /> MinValue: 0<BR /> MaxValue: 1<BR /> SAPSIDParameter:<BR /> Type: String<BR /> Description: Provide SAP System ID (used as namespace/identification only)<BR /> MinLength: 3<BR /> MaxLength: 3<BR /> SAPHostParameter:<BR /> Type: String<BR /> Description: Provide Hostname/IP-Address of Primary Application Server<BR /> SAPInstanceIDParameter:<BR /> Type: String<BR /> Description: Provide SAP Instance Number<BR /> MinLength: 2<BR /> MaxLength: 2<BR /> SAPClientParameter:<BR /> Type: String<BR /> Description: Provide SAP Client<BR /> Default: '000'<BR /> MinLength: 3<BR /> MaxLength: 3<BR /> SAPRFC0UserParameter:<BR /> Type: String<BR /> Description: Provide RFC User<BR /> SAPRFC1PasswordParameter:<BR /> Type: String<BR /> Description: Provide RFC Password<BR /> NoEcho: true<BR /> Resources:<BR /> SecretsManager:<BR /> Type: AWS::SecretsManager::Secret<BR /> Properties:<BR /> Name:<BR /> Fn::Sub:<BR /> - sap-monitor-${SID}<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> Description:<BR /> Fn::Sub:<BR /> - Secret for SAP Monitoring &lt;${SID}&gt;<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> SecretString:<BR /> Fn::Sub:<BR /> - '{ "name":"${SID}", "host":"${HOST}", "sys_id":"${INSTANCEID}", "client":"${CLIENT}",<BR /> "user":"${USER}", "password": "${PASSWORD}", "language":"en", "/SDF/SMON_DESC":"AWSCW",<BR /> "/SDF/SMON_SCHEDULE":${SCHED} }'<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> HOST:<BR /> Ref: SAPHostParameter<BR /> INSTANCEID:<BR /> Ref: SAPInstanceIDParameter<BR /> CLIENT:<BR /> Ref: SAPClientParameter<BR /> USER:<BR /> Ref: SAPRFC0UserParameter<BR /> PASSWORD:<BR /> Ref: SAPRFC1PasswordParameter<BR /> SCHED:<BR /> Ref: ScheduleParameter<BR /> Tags:<BR /> - Key: AppName<BR /> Value: SAPMONITOR<BR /> ScheduledRule:<BR /> Type: AWS::Events::Rule<BR /> Properties:<BR /> Name:<BR /> Fn::Sub:<BR /> - sap-monitor-${SID}<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> Description:<BR /> Fn::Sub:<BR /> - Scheduler for SAP Monitoring &lt;${SID}&gt;<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> ScheduleExpression: rate(1 minute)<BR /> State: DISABLED<BR /> Targets:<BR /> - Arn:<BR /> Fn::GetAtt:<BR /> - CWLambdaFunction<BR /> - Arn<BR /> Id: latest<BR /> PermissionForEventsToInvokeLambda:<BR /> Type: AWS::Lambda::Permission<BR /> Properties:<BR /> FunctionName:<BR /> Fn::GetAtt:<BR /> - CWLambdaFunction<BR /> - Arn<BR /> Action: lambda:InvokeFunction<BR /> Principal: events.amazonaws.com<BR /> SourceArn:<BR /> Fn::GetAtt:<BR /> - ScheduledRule<BR /> - Arn<BR /> CWLambdaFunction:<BR /> Type: AWS::Serverless::Function<BR /> Properties:<BR /> CodeUri: s3://sap-monitor/c716c19711241c175058825388cbeae2<BR /> Layers:<BR /> - Fn::Sub:<BR /> - arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:sapjco:${LLY}<BR /> - LLY:<BR /> Ref: LayerVersionParameter<BR /> Handler: init::handleRequest<BR /> FunctionName:<BR /> Fn::Sub:<BR /> - sap-monitor-${SID}<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> Description:<BR /> Fn::Sub:<BR /> - SAP Monitoring for &lt;${SID}&gt;<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> Runtime: java11<BR /> MemorySize: 512<BR /> Timeout: 30<BR /> VpcConfig:<BR /> SecurityGroupIds:<BR /> Ref: SecurityGroupParameter<BR /> SubnetIds:<BR /> Ref: SubnetParameter<BR /> Environment:<BR /> Variables:<BR /> SECRET:<BR /> Fn::Sub:<BR /> - sap-monitor-${SID}<BR /> - SID:<BR /> Ref: SAPSIDParameter<BR /> Policies:<BR /> - Version: '2012-10-17'<BR /> Statement:<BR /> - Effect: Allow<BR /> Action:<BR /> - secretsmanager:GetSecretValue<BR /> Resource:<BR /> Ref: SecretsManager<BR /> - Effect: Allow<BR /> Action:<BR /> - cloudwatch:PutMetricData<BR /> Resource: '*'<BR /> Tags:<BR /> AppName: SAPMONITOR<BR /> Outputs:<BR /> CWLambdaFunction:<BR /> Description: SAP Monitor Lambda Function ARN<BR /> Value:<BR /> Fn::GetAtt:<BR /> - CWLambdaFunction<BR /> - Arn</CODE></PRE><BR /> Upon uploading the above template then click on <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-28.png" /></P><BR /> Specify the <STRONG>Stack Name</STRONG> for the execution<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-29.png" /></P><BR /> Specify all the required parameters for execution and then click <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-30.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-31.png" /></P><BR /> Specify the <STRONG>IAM Role</STRONG> that is required for cloud formation stack execution<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-32.png" /></P><BR /> Specify the advanced options for <STRONG>Stack Policy</STRONG> and <STRONG>Rollback Configuration</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-33.png" /></P><BR /> Specify <STRONG>Notification Options</STRONG> and <STRONG>Stack creation options</STRONG>(if required) and then click <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-34.png" /></P><BR /> Review the settings and then click <STRONG>Create Stack</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-35.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-36.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-37.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-38.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-39.png" /></P><BR /> This will create and execute the stack, and below screen will appear after successful finish of the Stack<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-40.png" /></P><BR /> <BR /> <H1 id="toc-hId-239880185">5. TESTING DEPLOYMENT</H1><BR /> As our lambda function is in place to monitor our ABAP system, we need to test the lambda function that if Lambda function is getting though the SAP System<BR /> <H2 id="toc-hId-172449399">5.1 Lambda Execution Configuration</H2><BR /> We need to check the configuration that will be used for the Lambda execution which should be as per our environment<BR /> <H3 id="toc-hId-105018613">5.1.1 Memory</H3><BR /> We need to configure optimized memory that is allowed for Lambda function to use during the execution. Default is <STRONG>512 MB</STRONG> and must be changed as per the requirement and test cases<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-41.png" /></P><BR /> <BR /> <H3 id="toc-hId--91494892">5.1.2 Timeout</H3><BR /> We need to configure optimized timeout value after which the Lambda function will be forcefully stopped. Default is <STRONG>30 seconds</STRONG> and must be changed as per the requirement and test cases<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-43.png" /></P><BR /> <BR /> <H3 id="toc-hId--288008397">5.1.3 VPC</H3><BR /> We need to configure the required value for the VPC of the Lambda function as execution will happen using the configured network settings. VPC, Subnets and Security groups needs to be assigned as per the infrastructure<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-44.png" /></P><BR /> <BR /> <H2 id="toc-hId--613604621">5.2 Lambda Test Event</H2><BR /> First, we need to configure the Test Event for Lambda function which we can feed for lambda execution<BR /> <BR /> Go to <STRONG>Lambda</STRONG> from <STRONG>AWS Console</STRONG> and then click on the newly created function<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-45.png" /></P><BR /> Click on <STRONG>Test</STRONG> and then put below text and click on <STRONG>Invoke</STRONG><BR /> <PRE class="language-markup"><CODE>{<BR /> “refresh”:true<BR /> }</CODE></PRE><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-46.png" /></P><BR /> After a successful execution below screen will appear<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-47.png" /></P><BR /> <BR /> <H2 id="toc-hId--810118126">5.3 Checking Metrics</H2><BR /> After successful execution we need to be sure that Statistical data has been fetched and stored by <STRONG>AWS CloudWatch</STRONG> from the SAP system.<BR /> <BR /> To check the same, go to <STRONG>CloudWatch</STRONG> from <STRONG>AWS Console</STRONG> and then click on <STRONG>Metrics</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-48.png" /></P><BR /> Then we must see the metric for SAP System under <STRONG>Custom namespace</STRONG> →&nbsp;<STRONG>sap-monitor</STRONG> →&nbsp;<STRONG>by SID</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-49.png" /></P><BR /> This confirms that test is successful.<BR /> <BR /> <STRONG>This is end of Part – II, in next part <A href="https://blogs.sap.com/2021/04/11/monitoring-of-abap-system-on-aws-using-cloudwatch-part-iii/" target="_blank" rel="noopener noreferrer">Monitoring of ABAP System on AWS Using CloudWatch – Part III</A> of this article you can find more information about Post Configuration, Dashboard, Notifications and Logs of Monitoring ABAP Systems via AWS.</STRONG> 2021-04-11T09:38:07+02:00 https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-abap-system-on-aws-using-cloudwatch-part-iii/ba-p/13517276 Monitoring of ABAP System on AWS Using CloudWatch – Part III 2021-04-11T10:00:40+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 <STRONG>This is in continuation of my previous blog post <A href="https://blogs.sap.com/2021/04/11/monitoring-of-abap-system-on-aws-using-cloudwatch-part-ii/" target="_blank" rel="noopener noreferrer">Monitoring of ABAP System on AWS Using CloudWatch – Part II</A></STRONG><BR /> <H1 id="toc-hId-829419705">6. POST-CONFIGRUATION</H1><BR /> As a part of post configuration, we must do the below steps for regular execution<BR /> <H2 id="toc-hId-761988919">6.1 Enable Scheduler</H2><BR /> We must enable the scheduler so that AWS Lambda function can be triggered after regular interval of time to fetch the required data for CloudWatch<BR /> <BR /> To do the same, go to <STRONG>Amazon EventBridge</STRONG> →&nbsp;<STRONG>Event</STRONG> and click on <STRONG>Rules</STRONG>. We can find sap-monitor’s Rule already configured.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-50.png" /></P><BR /> Select the <STRONG>Rule</STRONG> and then click on <STRONG>Enable</STRONG>, confirm the action to Enable the Rule<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-51.png" /></P><BR /> Once the Rule is enabled, then as per the schedule Lambda Function will fetch the data from SAP.<BR /> <H1 id="toc-hId-436392695">7. DASHBOARD</H1><BR /> For monitoring multiple metrics at the same time, we can create and configure the our own dashboard using <STRONG>AWS CloudWatch</STRONG>.<BR /> <H2 id="toc-hId-368961909">7.1 Creation of Dashboard</H2><BR /> To-do the same, go to <STRONG>AWS CloudWatch</STRONG> from <STRONG>AWS Console</STRONG> and then click on <STRONG>Create Dashboard</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-52.png" /></P><BR /> Then we need to specify the name of the Dashboard which will be created and click <STRONG>Create Dashboard</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-53.png" /></P><BR /> Dashboard has been created for Monitoring of the system.<BR /> <H2 id="toc-hId-172448404">7.2 Adding Widgets</H2><BR /> Once the dashboard has been created then we need to add different Widgets as per the requirement. To do the same, we need to go to the newly created Dashboard and click on <STRONG>Add Widget</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-54.png" /></P><BR /> Then we need to specify the data source that will be used to create widgets which is <STRONG>Metrics</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-55.png" /></P><BR /> Then we need to select the <STRONG>Metric Name</STRONG> that needs to be displayed on the CloudWatch Dashboard and click on <STRONG>Create Widget</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-56.png" /></P><BR /> We can now see the Graphed Metrics on the Dashboard<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-57.png" /></P><BR /> Similarly, we can select more widgets to pin the graphical metrics on the CloudWatch Dashboard as below<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-58.png" /></P><BR /> We must <STRONG>save</STRONG> the dashboard so that widgets can be saved and can be utilized for quicker view.<BR /> <H1 id="toc-hId--153147820">8. NOTIFICATION</H1><BR /> We can also specify the settings by which a notification can be sent as per the requirement.<BR /> <H2 id="toc-hId--220578606">8.1 Setting Up Alarms</H2><BR /> We can setup alarms for sending any type of notification as per the requirement, to do so we need to go to <STRONG>CloudWatch</STRONG> →&nbsp;<STRONG>Alarms</STRONG> and click on <STRONG>Create alarm</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-59.png" /></P><BR /> Then we need to Specify the metric and conditions to trigger the notification, for that we need to click on <STRONG>Select Metric</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-60.png" /></P><BR /> Specify the Metric for which we need to generate the Alarm and then click on <STRONG>Select metric</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-61.png" /></P><BR /> Then we need to specify the <STRONG>time period</STRONG> and <STRONG>statistics</STRONG> for which alarm needs to be set. Here we need time period of <STRONG>5 mins</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-62.png" /></P><BR /> Then we need to specify the condition on which alarm needs to be raised by the CloudWatch. Here we have defined the threshold value to <STRONG>60</STRONG> and click <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-63.png" /></P><BR /> Then we need to specify the configuration actions when Alarm get a catch. Here we have specified the <STRONG>Amazon SNS topic</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-64.png" /></P><BR /> We can also specify the <STRONG>Auto scaling group</STRONG>, <STRONG>EC2 action</STRONG> any <STRONG>systems manager Ops Center</STRONG> action, if required and then click on <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-65.png" /></P><BR /> <P style="overflow: hidden;margin-bottom: 0px">Then we need to specify the <STRONG>name and description</STRONG> of the Alarm and click <STRONG>Next</STRONG></P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-66.png" /></P><BR /> Then we need to review the specified parameter and create the alarm<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-67.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-68.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-69.png" /></P><BR /> Below screen will appear after successful creation of Alarm, but state will be <STRONG>Insufficient Data</STRONG> till the first recording of data<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-70.png" /></P><BR /> After the first recording of the statistics from the CloudWatch, the status should change to <STRONG>OK</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-71.png" /></P><BR /> We can also see the Data collection in graphical manner for Alarm<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-72.png" /></P><BR /> When there is any breach in the threshold specified in the alarm settings then it gets recorded in <STRONG>AWS EventBridge</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-73.png" /></P><BR /> And information of this breach has been sent via email to the stakeholders as per the SNS configuration<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-74.png" /></P><BR /> <BR /> <H1 id="toc-hId--546174830">9. CONSIDERATIONS</H1><BR /> For using this solution in live customer environment, we have below points which needs to be considered<BR /> <H2 id="toc-hId--613605616">9.1 Performance</H2><BR /> From performance point of view, this solution uses two ways to connect to SAP System Regularity and collect insights: -<BR /> <UL><BR /> <LI><STRONG>One</STRONG> Minute interval for /SDF/MON data with a 30 second granularity which is scheduled daily on demand. According to SAP, CPU and memory overhead on the SAP system caused by /SDF/SMON is negligible and can safely be run in production. <A href="https://wiki.scn.sap.com/wiki/display/CPP/All+about+SMON#AllaboutSMON-SMONOverheadandSpaceRequirements" target="_blank" rel="noopener noreferrer">Link</A> can be referred for further details</LI><BR /> <LI><STRONG style="font-size: 1rem">Five</STRONG><SPAN style="font-size: 1rem"> Minute interval for ST03 “Last Minute Load”. SAP statistical records (STAD) and related aggregation (ST03) are usually enabled by default, if it’s not enabled then need to check SAP note <A href="https://launchpad.support.sap.com/#/notes/2369736" target="_blank" rel="noopener noreferrer">2369736</A>. They are the foundation of any SAP monitoring, especially for SAP GoingLive Check, SAP EarlyWatch Alert and SAP Solution Manager.</SPAN></LI><BR /> </UL><BR /> <H2 id="toc-hId--810119121">9.2 Cost</H2><BR /> There no addition cost for using this service, but one need to pay for the underlining AWS services which is getting used, such as AWS Lambda, CloudWatch, AWS SNS etc. For a single SAP system with two application servers, the estimated cost is <STRONG>16 USD per month per SID</STRONG> without considering any free tiers. These are estimated cost which is depend on various factors, please check <A href="https://calculator.aws/#/estimate?id=3590591b3364c8911c6755e278f3473cfd7881b5" target="_blank" rel="nofollow noopener noreferrer">link</A> for calculation details<BR /> <BR /> To limit the stored log data and reduce the cost in the long run, make sure to also reduce the retention period for <STRONG>/aws/lambda/sap-monitor-&lt;SID&gt;</STRONG> to one week. For more details on this please refer <A href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention" target="_blank" rel="nofollow noopener noreferrer">link</A>.<BR /> <H2 id="toc-hId--659378269">9.3 Capture Metric</H2><BR /> A full list of currently captured metrics and their importance can be found below:<BR /> <PRE class="language-perl"><CODE>Generic (1 - per SID):<BR /> "PING" = SAP Monitor RFC Execution Time (/SDF/SMON) "TOTAL_APP_SERVERS" = Number of active SAP Application Servers<BR /> <BR /> /SDF/SMON (14 - per Instance), granularity 1 min:<BR /> "ACT_WPS" = Number of Active Work Processes<BR /> "ACT_DIA" = Number of Active Dialog Work Processes<BR /> "TRFC_FREE" = Number of Available Work Processes for RFCs<BR /> "SESSIONS" = Number of Sessions<BR /> "USERS" = Number of Logins<BR /> "UPDQ" = Update Queue Length<BR /> "ENQQ" = Enqueue Queue Length<BR /> "DIAQ" = Dialog Queue Length<BR /> "PRIVWPNO" = Number of Work Processes in Priv Modes<BR /> "DIAAVG20" = Average Load last 20s<BR /> "DIAAVG60" = Average Load last 60s<BR /> "FREE_MEM_PERC" = Free Memory in % of RAM<BR /> "USR_TOTAL" = CPU Utilization (User) in %<BR /> "SYS_TOTAL" = CPU Utilization (System) in %<BR /> <BR /> SWNC_GET_WORKLOAD_SNAPSHOT = st03 Last Minute Load (12 - per SID), granularity 5 min<BR /> <BR /> Currently enabled for Tasktypes DIA &amp; RFC:<BR /> <BR /> "ST03_AVG_SNAP" = Average Response Time per Step in ms (ideally &lt; 1s)<BR /> "ST03CPU_TIME_PERC_SNAP" = Average CPU Time in % as part of average response time (ideally ca. 40%)<BR /> "ST03DB_TIME_PERC_SNAP" = Average DB Time in % as part of average response time (ideally ca. 40%)<BR /> "ST03AVG_DB_DIR_SNAP" = Average Database Request Time per Direct reads in ms (ideally max. 10ms)<BR /> "ST03AVG_DB_SEQ_AVG_SNAP" = Average Database Request Time per Sequential reads in ms (ideally max. 10ms)<BR /> "ST03_AVG_DB_CHG_AVG_SNAP" = Average Database Request Time per Changes in ms (ideally max. 10ms)</CODE></PRE><BR /> If we also like to monitor other OS-related metrics such as free hard disk space, then we can also deploy the <A href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html" target="_blank" rel="nofollow noopener noreferrer">CloudWatch Agent</A> on top.<BR /> <H1 id="toc-hId--562488767">10. LOGS</H1><BR /> <H2 id="toc-hId--1052405279">10.1 CloudFormation</H2><BR /> As the deployment triggers Cloud Formation stack internally, hence we can navigate to <STRONG>CloudFormation</STRONG> →&nbsp;<STRONG>Stacks</STRONG> →&nbsp;<STRONG>Events</STRONG> which can provide details of the steps which were carried out during the execution<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-75.png" /></P><BR /> <BR /> <H2 id="toc-hId--1248918784">10.2 CloudWatch</H2><BR /> We also have detailed logs which we can see from <STRONG>AWS Cloudwatch</STRONG>, for which need to navigate to proper log groups from CloudWatch<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/04/Screenshot-2021-04-08-204656-76.png" /></P><BR /> &nbsp;<BR /> <BR /> Now SAP System installed on AWS EC2 is getting monitored using AWS Services.<BR /> <BR /> <STRONG>BEST OF LUCK!!</STRONG><BR /> <H1 id="toc-hId--1152029282">11. CONCLUSION:</H1><BR /> In this 3 parts of article, we have discussed how we can <STRONG>&nbsp;Deploy, Test, Post Configuration, Dashboard of Monitoring ABAP Systems via AWS.</STRONG><BR /> <BR /> &nbsp;<BR /> <BR /> THANK YOU.. 2021-04-11T10:00:40+02:00 https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-sap-systems-using-azure-monitors-part-i/ba-p/13513475 Monitoring of SAP Systems Using Azure Monitors - Part I 2021-05-10T07:04:19+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 This Article is referenced from the approach announced by Microsoft in this <A href="https://azure.microsoft.com/en-in/blog/azure-monitor-for-sap-solutions-is-now-in-preview/" target="_blank" rel="nofollow noopener noreferrer">blog</A>. Microsoft has also provided <A href="https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/azure-monitor-overview" target="_blank" rel="nofollow noopener noreferrer">documentation</A> on this to help customers on Azure to enhance the monitoring of the SAP systems on Azure.<BR /> <BR /> In this Article we will discuss about the Monitoring Service "<STRONG>Azure Monitor for SAP Solutions</STRONG>" delivered by Microsoft and how we can take benefit from this service.<BR /> <BR /> Azure Monitor for SAP Solutions is an Azure-native monitoring product for customers, running their SAP landscapes on <A href="https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/hana-get-started" data-linktype="relative-path" target="_blank" rel="nofollow noopener noreferrer">Azure Virtual Machines</A>&nbsp;and&nbsp;<A href="https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/hana-overview-architecture" data-linktype="relative-path" target="_blank" rel="nofollow noopener noreferrer">Azure Large Instances</A>. With Azure Monitor for SAP Solutions, we can collect telemetry data from Azure infrastructure and databases in one central location and visually the telemetry data. SAP has provided several notes which support SAP products on Azure:-<BR /> <UL><BR /> <LI><A class="sapThemeBrand-asColor" title="" href="https://launchpad.support.sap.com/#/solutions/r/?type=note&amp;route=notes&amp;pos=4&amp;p=%7B%22note%22%3A%222015553%22%7D&amp;searchTerm=Azure&amp;filters=[]&amp;sorter=score" target="_blank" rel="noopener noreferrer">2015553 - SAP on Microsoft&nbsp;<B>Azure</B>: Support prerequisites</A></LI><BR /> <LI><A class="sapThemeBrand-asColor" title="" href="https://launchpad.support.sap.com/#/solutions/r/?type=note&amp;route=notes&amp;pos=37&amp;p=%7B%22note%22%3A%221928533%22%7D&amp;searchTerm=Azure%20HANA&amp;filters=[]&amp;sorter=score" target="_blank" rel="noopener noreferrer">1928533 - SAP Applications on&nbsp;<B>Azure</B>: Supported Products and&nbsp;<B>Azure</B>&nbsp;VM types</A></LI><BR /> </UL><BR /> We can monitor different components of an SAP landscape such as OS, High-availability cluster, SAP HANA , SAP NetWeaver and etc. Currently, Azure Monitor for SAP Solutions is under public preview and there is high probability of changes in coming days on this service, kindly refer to Microsoft <A href="https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/azure-monitor-overview" target="_blank" rel="nofollow noopener noreferrer">documentation</A> in advance<BR /> <H1 id="toc-hId-829302462">1. AZURE SERVICES</H1><BR /> Below are services that will be used by Azure to deliver the solution<BR /> <H2 id="toc-hId-761871676">1.1 Azure Monitors</H2><BR /> Azure Monitor for SAP Solutions uses the power of existing Azure Monitor capabilities which contains Log Analytics and Workbooks to provide more monitoring capabilities. It read the SAP data available in the Log Analytics and make data available for the workbooks to show it in a graphical Manner.<BR /> <H2 id="toc-hId-565358171">1.2 Log Analytics Workspace</H2><BR /> A Log Analytics workspace is a unique environment for Azure Monitor log data. Each workspace has its own data repository and configuration, and data sources and solutions are configured to store their data in a workspace. All the data which is extracted from SAP Solutions will be stored in this space.<BR /> <H2 id="toc-hId-368844666">1.3 WorkBooks</H2><BR /> Workbooks can query data from multiple sources within Azure. In Workbooks we can transform this data to provide insights into the availability, performance, usage, and overall health of the underlying components. For instance, analyzing performance logs from virtual machines to identify high CPU or low memory instances and displaying the results as a grid in an interactive report. Workbook will use the data from the Log Analytics Workspace and then transforms into Text, charts, Grids, Tiles, Trees, Graphs etc...<BR /> <H2 id="toc-hId-172331161">1.4 Key Vault</H2><BR /> Azure Key Vault is a cloud service for securely storing and accessing secrets. A secret is anything that we want to tightly control access to, such as API keys, passwords, certificates, or cryptographic keys. Vaults support storing software and HSM-backed keys, secrets, and certificates. All the secrets for the SAP systems will be stored in the Key Vault which will be used by the providers to access SAP solutions for collecting the data.<BR /> <H2 id="toc-hId--24182344">1.5 Managed Identities</H2><BR /> Managed identities eliminate the need for services to manage credentials. Managed identities provide an identity for applications to use when connecting to resources that support Azure Active Directory (Azure AD) authentication. Applications may use the managed identity to obtain Azure AD tokens. Managed Identities allow provides to use AD Authentications for retrieving the SAP system secrets from the Key Vaults<BR /> <H2 id="toc-hId--220695849">1.6 Azure Queue Storage</H2><BR /> Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere via authenticated calls using HTTP or HTTPS. A single queue message can be up to 64 KB in size, and a queue can contain millions of messages, up to the total capacity limit of a storage account. Queue storage is often used to create a backlog of work to process asynchronously. Queue Storage will be used by the providers to store the messages which came while connecting to the SAP Solutions.<BR /> <H2 id="toc-hId--417209354">1.7 Azure Virtual Machine</H2><BR /> Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. VM will be deployed by the Azure Monitors. This is a Standard_B2ms VM. Responsibility of this VM is to host the Monitoring Payload.<BR /> <H1 id="toc-hId--742805578">2. ARCHITECTURE OVERVIEW</H1><BR /> The following diagram explains about the collection of telemetry by Azure Monitor for SAP Solutions from SAP HANA database. The architecture is agnostic to whether SAP HANA is deployed on Azure Virtual Machines or Azure Large Instances.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428.png" /></P><BR /> <BR /> <H2 id="toc-hId--810236364">2.1 Architectural Components</H2><BR /> <UL><BR /> <LI><STRONG>Azure portal</STRONG> – We can go to marketplace within Azure portal and discover using Azure Monitor for SAP Solutions</LI><BR /> <LI><STRONG>Azure Monitor for SAP Solutions resource</STRONG> – this is a landing place for customers to view monitoring telemetry</LI><BR /> <LI><STRONG>Managed resource group</STRONG> – This will be deployed automatically as part of the Azure Monitor for SAP Solutions resource deployment. Resources which are deployed and their purpose are:<BR /> <UL><BR /> <LI><STRONG>Azure Virtual Machine</STRONG>: This is a Collector VM with size Standard_B2ms. The main purpose of this VM is to host the Monitoring Payload. In the above diagram, the monitoring payload contains the logic to connect to SAP HANA database over SQL port.</LI><BR /> <LI><STRONG>Azure Key Vault</STRONG>: This resource is deployed to securely hold SAP HANA database credentials and to store information about providers.</LI><BR /> <LI><STRONG>Log Analytics Workspace</STRONG>: This is the destination where the telemetry data resides.<BR /> <UL><BR /> <LI>Visualization is built on top of telemetry in Log Analytics using Azure Workbooks.</LI><BR /> <LI>We can use their existing workspace within the same subscription as SAP monitor resource by choosing this option at the time of deployment.</LI><BR /> <LI>We can use Kusto query language (KQL) to run queries against the raw tables inside Log Analytics workspace.</LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> <H2 id="toc-hId--659495512">2.2 Architectural Highlights</H2><BR /> <UL><BR /> <LI><STRONG>Multi-instance</STRONG> - We can create monitor for multiple instances of a given component type (for example, HANA DB, HA cluster, Microsoft SQL server, SAP NetWeaver) across multiple SAP SIDs within a VNET with a single resource of Azure Monitor for SAP Solutions.</LI><BR /> <LI><STRONG>Multi-provider</STRONG> - The above architecture diagram shows the SAP HANA provider as an example. Similarly, we can configure more providers for corresponding components (for example, HANA DB, HA cluster, Microsoft SQL server, SAP NetWeaver) to collect data from those components.</LI><BR /> <LI><STRONG>Open source</STRONG> - The source code of Azure Monitor for SAP Solutions is available in GitHub. We can refer to the provider code and learn more about the product, contribute or share feedback.</LI><BR /> <LI><STRONG>Extensible query framework</STRONG> - We can request specific telemetry data to be added to Azure Monitor for SAP Solutions.</LI><BR /> </UL><BR /> <H1 id="toc-hId--562606010">3. SOLUTION OVERVIEW</H1><BR /> With Azure Monitor for SAP Solutions, we can collect telemetry data from Azure infrastructure and databases in one central location and visually see telemetry data for faster troubleshooting. Azure Monitor for SAP Solutions is an Azure-native monitoring product for customers, running their SAP landscapes on Azure.<BR /> <H2 id="toc-hId--1052522522">3.1 Support</H2><BR /> <H3 id="toc-hId--1542439034">3.1.1 Infrastructure</H3><BR /> <UL><BR /> <LI>Azure Virtual Machine</LI><BR /> <LI>Azure Large Instance</LI><BR /> </UL><BR /> <H3 id="toc-hId--1738952539">3.1.2 Databases</H3><BR /> <UL><BR /> <LI>SAP HANA Database<BR /> <UL><BR /> <LI>Version<BR /> <UL><BR /> <LI>HANA 1.0 SPS 12 Rev. 120 or higher</LI><BR /> <LI>HANA 2.0 SPS03 or higher</LI><BR /> </UL><BR /> </LI><BR /> <LI>Topology<BR /> <UL><BR /> <LI>Single node (scale-up) and multi-node (scale-out)</LI><BR /> <LI>Single database container (HANA 1.0 SPS 12) and multiple database containers (HANA 1.0 SPS 12 or HANA 2.0)</LI><BR /> <LI>Auto host failover (n+1) and HSR</LI><BR /> </UL><BR /> </LI><BR /> <LI>Microsoft SQL Server<BR /> <UL><BR /> <LI>Version<BR /> <UL><BR /> <LI>SQL Server 2012 SP4 or higher</LI><BR /> </UL><BR /> </LI><BR /> <LI>Topology<BR /> <UL><BR /> <LI>Default or named standalone instances in a virtual machine</LI><BR /> <LI>Clustered instances or instances in an AlwaysOn configuration when either using the virtual name of the clustered resource or the AlwaysOn listener name. Currently no cluster or AlwaysOn specific metrics are collected</LI><BR /> <LI>Azure SQL Database (PAAS) is currently not supported</LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> <H3 id="toc-hId--1935466044">3.1.3 Application</H3><BR /> <UL><BR /> <LI>SAP NetWeaver<BR /> <UL><BR /> <LI>Version<BR /> <UL><BR /> <LI>SAP NetWeaver 7.0 or higher</LI><BR /> </UL><BR /> </LI><BR /> <LI>Configurations<BR /> <UL><BR /> <LI>ABAP</LI><BR /> <LI>JAVA</LI><BR /> <LI>Dual-Stack SAP NetWeaver Application Server</LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> <H2 id="toc-hId--1838576542">3.2 Data Collection</H2><BR /> Data collection in Azure Monitor for SAP Solutions depends on the providers that are configured. The following data is being collected<BR /> <H3 id="toc-hId-1966474242">3.2.1 SAP NetWeaver</H3><BR /> <UL><BR /> <LI>SAP system and application server availability including instance process availability of Dispatcher, ICM, Gateway, Message Server, Enqueue Server, IGS Watchdog</LI><BR /> <LI>Work process utilization statistics and trends</LI><BR /> <LI>Enqueue Lock statistics and trends</LI><BR /> <LI>Queue Utilization statistics and trends</LI><BR /> </UL><BR /> <H3 id="toc-hId-1769960737">3.2.2 SAP HANA Database</H3><BR /> <UL><BR /> <LI>CPU, memory, disk, and network utilization</LI><BR /> <LI>HANA System Replication (HSR)</LI><BR /> <LI>HANA backup</LI><BR /> <LI>HANA host status</LI><BR /> <LI>Index server and Name server roles</LI><BR /> </UL><BR /> <H3 id="toc-hId-1573447232">3.2.3 Linux Operating System</H3><BR /> <UL><BR /> <LI>CPU utilization, fork's count, running and blocked processes.</LI><BR /> <LI>Memory utilization and distribution among utilized, cached, buffered.</LI><BR /> <LI>Swap utilization, Paging, and swap rate.</LI><BR /> <LI>Filesystems utilization, Number of bytes read and written per block device.</LI><BR /> <LI>Read/write latency per block device.</LI><BR /> <LI>Ongoing I/O count, Persistent memory read/write bytes.</LI><BR /> <LI>Network packets in/out, Network bytes in/out</LI><BR /> </UL><BR /> <H3 id="toc-hId-1545117418">3.2.4 Pacemaker High Availability Cluster</H3><BR /> <UL><BR /> <LI>Node, resource, and SBD device status</LI><BR /> <LI>Pacemaker location constraints</LI><BR /> <LI>Quorum votes and ring status</LI><BR /> </UL><BR /> <H3 id="toc-hId-1348603913">3.2.5 Microsoft SQL Server</H3><BR /> <UL><BR /> <LI>CPU, memory, disk utilization</LI><BR /> <LI>Hostname, SQL Instance name, SAP System ID</LI><BR /> <LI>Batch Requests, Compilations, and page Life Expectancy over time</LI><BR /> <LI>Top 10 most expensive SQL statements over time</LI><BR /> <LI>Top 12 largest table in the SAP system</LI><BR /> <LI>Problems recorded in the SQL Server Error log</LI><BR /> <LI>Blocking processes and SQL Wait Statistics over time</LI><BR /> </UL><BR /> <H2 id="toc-hId-1445493415">3.3 Regions</H2><BR /> As Azure released it for public preview, this service will be available in East US 2, West US 2, East US and West Europe<BR /> <H2 id="toc-hId-1248979910">3.4 Pricing</H2><BR /> Azure Monitor for SAP Solutions is a free product (no license fee). We are responsible for paying the cost for the underlying components in the managed resource group such as below: -<BR /> <UL><BR /> <LI>Azure Virtual Machine and disk associated with it</LI><BR /> <LI>Azure Key Vault</LI><BR /> <LI>Log Analytics workspace</LI><BR /> <LI>Azure Managed Identity</LI><BR /> <LI>Storage Account</LI><BR /> </UL><BR /> <H2 id="toc-hId-1052466405">3.5 SLA</H2><BR /> These are released for public previews are excluded from service level agreements.<BR /> <H1 id="toc-hId-1149355907">4. PREREQUISITE</H1><BR /> For taking advantage of the above architecture below are some of the pre-requisite<BR /> <H2 id="toc-hId-659439395">4.1 Authorization</H2><BR /> Configuring user must have access for the below: -<BR /> <UL><BR /> <LI>Creation of Azure Virtual Machines</LI><BR /> <LI>Creation and Deletion of secrets from Azure Key Vault</LI><BR /> <LI>Creation of Managed Identity</LI><BR /> <LI>Creation and assignment of Network Interface to the VM</LI><BR /> <LI>Creation of Network Security Groups</LI><BR /> <LI>Creation of Azure Storage account</LI><BR /> <LI>Creation of Log Analytics Workspace</LI><BR /> </UL><BR /> <H2 id="toc-hId-462925890">4.2 Namespace Registration</H2><BR /> Below Namespace should be registered beforehand to perform an uninterrupted configuration: -<BR /> <H3 id="toc-hId--26990622">4.2.1 Managed Identities</H3><BR /> We must register our subscription for using Managed Identities, to check the same we need to go to <STRONG>Subscription</STRONG> →&nbsp;<STRONG>Resource Providers</STRONG> and then search for <STRONG>ManagedIdentity</STRONG>. We must register <STRONG>Microsoft.ManagedIdentity</STRONG> to our Subscription<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-1.png" /></P><BR /> <BR /> <H3 id="toc-hId--223504127">4.2.2 Operational Insights</H3><BR /> We must register our subscription for using Operational Insights, to check the same we need to go to <STRONG>Subscription</STRONG> →&nbsp;<STRONG>Resource Providers</STRONG> and then search for <STRONG>OperationalInsights</STRONG>. We must register <STRONG>Microsoft.OperationalInsights</STRONG> to our Subscription<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-2.png" /></P><BR /> <STRONG>This is end of Part – I, in next part <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-ii/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors - Part II</A> of this article you can find more information about Deployment and Configuration of Azure Monitors for SAP Solutions.</STRONG> 2021-05-10T07:04:19+02:00 https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-sap-systems-using-azure-monitors-part-ii/ba-p/13514280 Monitoring of SAP Systems Using Azure Monitors – Part II 2021-05-10T07:08:12+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 <STRONG>This is in continuation of my previous Article <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-i/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors – Part I</A></STRONG><BR /> <H1 id="toc-hId-829330357">6. DEPLOYMENT AND CONFIGRUATION</H1><BR /> <H2 id="toc-hId-761899571">6.1 Configuring Azure Monitors</H2><BR /> Go to Search for <STRONG>Azure Monitors for SAP Solutions</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-3.png" /></P><BR /> Click on <STRONG>New</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-4.png" /></P><BR /> Fill up all the requested details and <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-5.png" /></P><BR /> We can add the providers later, hence click on <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-6.png" /></P><BR /> Specify the Tags, if any and click <STRONG>Next</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-7.png" /></P><BR /> Review the settings and click on Review + Create<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-8.png" /></P><BR /> This will be initializing the deployment<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-9.png" /></P><BR /> Wait for the deployment to complete and then click on <STRONG>Go to resource</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-10.png" /></P><BR /> <P style="overflow: hidden;margin-bottom: 0px">Now we can see the deployed Azure Monitors for SAP Solutions deployed</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-11.png" /></P><BR /> <BR /> <H2 id="toc-hId-565386066">5.2 Creating Key Vault</H2><BR /> As we need to securely store the secrets for accessing the SAP systems, for that we need to create Key Vault. To do so, Search for <STRONG>Key Vault </STRONG>and then click on<STRONG> Add</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-12.png" /></P><BR /> Fill out all the requested fields and then click on <STRONG>Next: Access Policy</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-13.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-14.png" /></P><BR /> Enable the access and click <STRONG>Next: Networking</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-15.png" /></P><BR /> Select the required network and then click on <STRONG>Next: Tags</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-16.png" /></P><BR /> Specify the tags if required and then click <STRONG>Next: Review + Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-17.png" /></P><BR /> Review all the settings and then click on <STRONG>Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-18.png" /></P><BR /> Wait for the deployment to get finished<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-19.png" /></P><BR /> Add the secret to Key vault and click on <STRONG>Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-20.png" /></P><BR /> Wait for the secret to save inside the key vault<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-21.png" /></P><BR /> <BR /> <H2 id="toc-hId-368872561">5.3 Adding Providers</H2><BR /> A provider contains the connection information for the corresponding component and helps to collect telemetry data from that component. One Azure Monitor for SAP Solutions resource can be configured with multiple providers of the same provider type or multiple providers of multiple provider types.<BR /> <BR /> We can choose to configure different provider types to enable data collection from corresponding component in their SAP landscape.<BR /> <BR /> We can also choose to configure multiple providers of a specific provider type to reuse the same SAP monitor resource and associated managed group.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-22.png" /></P><BR /> It is recommended to configure at least one provider from the available provider types at the time of deploying the SAP Monitor resource. By configuring a provider, we can initiate data collection from the corresponding component for which the provider is configured.<BR /> <BR /> If we don't configure any providers at the time of deploying SAP monitor resource, although the SAP monitor resource will be successfully deployed, no telemetry data will be collected.<BR /> <H3 id="toc-hId-301441775">5.3.1 Configuring SAP HANA</H3><BR /> We can configure one or more providers of provider type SAP HANA to enable data collection from SAP HANA database. The SAP HANA provider connects to the SAP HANA database over SQL port, pulls telemetry data from the database, and pushes it to the Log Analytics workspace in the subscription. The SAP HANA provider collects data every 1 minute from the SAP HANA database.<BR /> <BR /> To add provider, we need to go to <STRONG>Providers</STRONG> in deployed Azure Monitor resource and click on <STRONG>Add</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-23.png" /></P><BR /> Select Type as <STRONG>SAP HANA</STRONG> and further details will be asked<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-24.png" /></P><BR /> Fill all the below connectivity details<BR /> <UL><BR /> <LI>Input the <STRONG>Private IP</STRONG> for the HANA server.</LI><BR /> <LI>Input the name of the <STRONG>Database tenant</STRONG> you want to use. We can choose any tenant however, we are using SYSTEMDB here as it enables a wider array of monitoring areas.</LI><BR /> <LI>Input the <STRONG>SQL port</STRONG> number associated with your HANA database. The port number should be in the format of [3] + [instance#] + [13]. For example, 31013.</LI><BR /> <LI>Input the <STRONG>Database username</STRONG> you want to use. Ensure that database user has the monitoring and catalog read roles assigned.</LI><BR /> </UL><BR /> Select for key vault which contains the secret for accessing HANA<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-25.png" /></P><BR /> Select the <STRONG>Key Vault</STRONG> and then click on <STRONG>Secret</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-26.png" /></P><BR /> Now click on <STRONG>Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-27.png" /></P><BR /> Wait for the connection to be Successful<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-28.png" /></P><BR /> <BR /> <H3 id="toc-hId-104928270">5.3.2 Linux Operating System</H3><BR /> We can configure one or more providers of provider type OS (Linux) to enable data collection from BareMetal or VM Node. The OS (Linux) provider connects to BareMetal or VM Nodes, using Node_Exporter endpoint, pulls telemetry data from the Nodes and pushes it to Log Analytics workspace in the customer subscription. OS (Linux) provider collects data every 60 seconds for most of the metrics from Nodes.<BR /> <H4 id="toc-hId-37497484">5.3.2.1 Installing Node Explorer</H4><BR /> To install Node Explorer we need to go to page <A href="https://prometheus.io/download/" target="_blank" rel="nofollow noopener noreferrer">https://prometheus.io/download/</A> and download the required package<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-29.png" /></P><BR /> Transfer the package to OS and then extract the package<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-30.png" /></P><BR /> Navigate to the location of the extraction and start the Node Explorer<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-31.png" /></P><BR /> We can see the telemetry data populated on 9100 port<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-32.png" /></P><BR /> <BR /> <H4 id="toc-hId--159016021">5.3.2.2 Adding OS Provider to Azure Monitor</H4><BR /> To configure the OS (Linux) Provider, we need to add provide with following details and then click on Create<BR /> <UL><BR /> <LI><STRONG>Name </STRONG>– A name for this provider. It should be unique for this Azure Monitor for SAP solutions instance.</LI><BR /> <LI><STRONG style="font-size: 1rem">Node Exporter Endpoint</STRONG><SPAN style="font-size: 1rem"> – Usually it should be <A href="http://&lt;hostname&gt;:9100/metrics" target="test_blank" rel="nofollow noopener noreferrer">http://&lt;hostname&gt;:9100/metrics</A></SPAN></LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-33.png" /></P><BR /> Wait for the connection to be established.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-34.png" /></P><BR /> <BR /> <H3 id="toc-hId--484612245">5.3.3 Configuring SAP NetWeaver</H3><BR /> We can configure one or more providers of provider type SAP NetWeaver to enable data collection from SAP NetWeaver. NetWeaver provider leverages the existing SAPControl webservice interface to retrieve the appropriate telemetry information.<BR /> <BR /> For the current release, below are the standard out-of-box SOAP web methods invoked by Azure Monitor.<BR /> <TABLE style="border-collapse: collapse;width: 100%" border="1"><BR /> <TBODY><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px"><STRONG>Web Method</STRONG></TD><BR /> <TD style="width: 8.36%;height: 13px"><STRONG>ABAP</STRONG></TD><BR /> <TD style="width: 7.88%;height: 13px"><STRONG>JAVA</STRONG></TD><BR /> <TD style="width: 58.76%;height: 13px"><STRONG>Metrics</STRONG></TD><BR /> </TR><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px">GetSystemInstanceList</TD><BR /> <TD style="width: 8.36%;height: 13px">X</TD><BR /> <TD style="width: 7.88%;height: 13px">X</TD><BR /> <TD style="width: 58.76%;height: 13px">Instance Availability, Message Server, Gateway, ICM, ABAP Availability</TD><BR /> </TR><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px">GetProcessList</TD><BR /> <TD style="width: 8.36%;height: 13px">X</TD><BR /> <TD style="width: 7.88%;height: 13px">X</TD><BR /> <TD style="width: 58.76%;height: 13px">If instance List is RED, we can get what Process causing that server to be RED</TD><BR /> </TR><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px">GetQueueStatistics</TD><BR /> <TD style="width: 8.36%;height: 13px">X</TD><BR /> <TD style="width: 7.88%;height: 13px">X</TD><BR /> <TD style="width: 58.76%;height: 13px">Queue Statistics (DIA/BATCH/UPD)</TD><BR /> </TR><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px">ABAPGetWPTable</TD><BR /> <TD style="width: 8.36%;height: 13px">X</TD><BR /> <TD style="width: 7.88%;height: 13px">-</TD><BR /> <TD style="width: 58.76%;height: 13px">Work Process Utilization</TD><BR /> </TR><BR /> <TR style="height: 13px"><BR /> <TD style="width: 25%;height: 13px">EnqGetStatistics</TD><BR /> <TD style="width: 8.36%;height: 13px">X</TD><BR /> <TD style="width: 7.88%;height: 13px">X</TD><BR /> <TD style="width: 58.76%;height: 13px">Locks</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> To add provider, we need to go to <STRONG>Provider</STRONG> and then click on <STRONG>Add</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-35.png" /></P><BR /> Fill out the requested details: -<BR /> <UL><BR /> <LI>Input the <STRONG>hostname</STRONG> of the SAP system and Subdomain (if applicable)</LI><BR /> <LI>Enter the <STRONG>Instance number</STRONG> corresponding to the hostname entered</LI><BR /> <LI>Enter the <STRONG>System ID</STRONG> (SID)</LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-36.png" /></P><BR /> Wait for the provider to get successful connection to the system<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-37.png" /></P><BR /> <BR /> <H3 id="toc-hId--681125750">5.3.4 Configuring High-Availability Pacemaker Cluster</H3><BR /> We can configure one or more providers of provider type High-availability cluster to enable data collection from Pacemaker cluster within the SAP landscape. The High-availability cluster provider connects to Pacemaker, using ha_cluster_exporter endpoint, pulls telemetry data from the database and pushes it to Log Analytics workspace in the customer subscription. High-availability cluster provider collects data every 60 seconds from Pacemaker.<BR /> <H4 id="toc-hId--1246273631">5.3.4.1 Installing HA Cluster Explorer</H4><BR /> Install ha_cluster_exporter in each node within the Pacemaker cluster.<BR /> <BR /> Clone the github repository to the machine<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-38.png" /></P><BR /> Use Zypper command to install the HA Cluster Explorer<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-39.png" /></P><BR /> Run the explorer in background so that data collection can be done<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-40.png" /></P><BR /> <BR /> <H4 id="toc-hId--1442787136">5.3.4.2 Adding HA Pacemaker Cluster to Azure Monitor</H4><BR /> Configure a High-availability cluster provider for each node within the Pacemaker cluster.<BR /> <BR /> Fill the following information and then click <STRONG>Create</STRONG><BR /> <UL><BR /> <LI><STRONG>Name</STRONG> – A name for this provider. It should be unique for this Azure Monitor for SAP solutions instance.</LI><BR /> <LI><STRONG>Prometheus Endpoint</STRONG> – <A href="http://&lt;servername" target="test_blank" rel="nofollow noopener noreferrer">http://&lt;servername</A> or ip address&gt;:9664/metrics.</LI><BR /> <LI><STRONG>SID</STRONG> – Use the SAP SID.</LI><BR /> <LI><STRONG>Cluster name</STRONG> – The cluster name used when creating the cluster. The cluster name can be found in the cluster property <EM>cluster-name</EM>.</LI><BR /> <LI><STRONG>Hostname</STRONG> – The Linux hostname of the VM.</LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-41.png" /></P><BR /> Wait for the provider for creating a successful connection to Cluster<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-42.png" /></P><BR /> <BR /> <H3 id="toc-hId--1345897634">5.3.5 Configuring Microsoft SQL Server</H3><BR /> We can configure one or more providers of provider type Microsoft SQL Server to enable data collection from SQL Server on Virtual Machines. SQL Server provider connects to Microsoft SQL Server over the SQL port, pulls telemetry data from the database, and pushes it to the Log Analytics workspace in the customer subscription. The SQL Server must be configured for SQL authentication and a SQL Server login, with the SAP DB as the default database for the provider, must be created. SQL Server provider collects data between every 60 seconds up to every hour from SQL server.<BR /> <H4 id="toc-hId--1835814146">5.3.5.1 Creation of User</H4><BR /> To connect to MSSQL server, a user must be created at the database level so that providers from Azure Monitor can connect to MSSQL Server using this user. User must have all the required authorizations and role to extract the required telemetry data.<BR /> <BR /> We can run the below MS script in SQL Server Management Studio to create a user with the appropriate permissions needed to configure the provider<BR /> <PRE class="language-sql"><CODE>USE [&lt;Database to monitor&gt;]<BR /> DROP USER [&lt;user name&gt;]<BR /> GO<BR /> USE [master]<BR /> DROP USER [&lt;user name&gt;]<BR /> DROP LOGIN [&lt;user name&gt;]<BR /> GO<BR /> CREATE LOGIN [&lt;user name&gt;] WITH PASSWORD=N'&lt;password&gt;', DEFAULT_DATABASE=[&lt;Database to monitor&gt;], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF<BR /> CREATE USER &lt;user name&gt; FOR LOGIN &lt;user name&gt;<BR /> ALTER ROLE [db_datareader] ADD MEMBER [&lt;user name&gt;]<BR /> ALTER ROLE [db_denydatawriter] ADD MEMBER [&lt;user name&gt;]<BR /> GRANT CONNECT TO &lt;user name&gt;<BR /> GRANT VIEW SERVER STATE TO &lt;user name&gt;<BR /> GRANT VIEW SERVER STATE TO &lt;user name&gt;<BR /> GRANT VIEW ANY DEFINITION TO &lt;user name&gt;<BR /> GRANT EXEC ON xp_readerrorlog TO &lt;user name&gt;<BR /> GO<BR /> USE [&lt;Database to monitor&gt;]<BR /> CREATE USER [&lt;user name&gt;] FOR LOGIN [&lt;user name&gt;]<BR /> ALTER ROLE [db_datareader] ADD MEMBER [&lt;user name&gt;]<BR /> ALTER ROLE [db_denydatawriter] ADD MEMBER [&lt;user name&gt;]<BR /> GO</CODE></PRE><BR /> <H4 id="toc-hId--2032327651">5.3.5.2 Adding MSSQL Provider to Azure Monitor</H4><BR /> After selecting the Add Provider we need to select Microsoft SQL Server from the drop-down menu. And then fill out all the requested details so that Provider can connect to MSSQL Server<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-43.png" /></P><BR /> Wait for the connection to be successful.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-44.png" /></P><BR /> <STRONG>This is end of Part – II, in next part <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-iii/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors – Part III</A> of this article you can find more information about Dashboards, Workbooks and Displaying Graphs using Azure Monitors for SAP Solutions.</STRONG> 2021-05-10T07:08:12+02:00 https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-sap-systems-using-azure-monitors-part-iii/ba-p/13516335 Monitoring of SAP Systems Using Azure Monitors – Part III 2021-05-10T07:11:11+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 <STRONG>This is in continuation of my previous Article <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-ii/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors – Part II</A></STRONG><BR /> <H1 id="toc-hId-829390750">6. WORKBOOKS</H1><BR /> Workbooks provide a flexible canvas for data analysis and the creation of rich visual reports within the Azure portal. They allow you to tap into multiple data sources from across Azure and combine them into unified interactive experiences.<BR /> <H2 id="toc-hId-761959964">6.1 SAP HANA</H2><BR /> For checking the Workbook for SAP HANA, we can select <STRONG>SAP HANA</STRONG> under the <STRONG>Monitoring</STRONG> TAB and then select the Monitored SAP HANA instances which we need to display<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-45.png" /></P><BR /> This will first display the Overview of the SAP HANA Instances in which we can see an overview for Highest CPU and Memory touched so far<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-46.png" /></P><BR /> We can also see further details to the CPU, Memory, Disk and Network in and out along with the services running on the HANA Server<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-47.png" /></P><BR /> We can see detailed CPU utilization timeline under the Utilization Tab<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-48.png" /></P><BR /> In same tab we can have the detailed CPU utilization with MAX touched so far<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-49.png" /></P><BR /> On selecting the Memory button, we can see the Memory timeline for the Server.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-50.png" /></P><BR /> In the same tab, we can see the detailed utilization of the Memory on HANA and MAX touched so far<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-51.png" /></P><BR /> In Backup tab, we can see all the successful backups of Database as well as Log area.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-52.png" /></P><BR /> In same tab, we can see the Backup size and duration in a graphical view to check the trend of the backups<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-53.png" /></P><BR /> Going forward in same tab we can also see more detailing about each backup happened for the Hana<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-54.png" /></P><BR /> Under Replication Tab, we can also see the graph contains the details about replication tier for HANA Database<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-55.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-56.png" /></P><BR /> In same tab we can see further statistics of the replication of SYSTEMDB as well as its associated tenants<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-57.png" /></P><BR /> <BR /> <H2 id="toc-hId-565446459">6.2 Linux Operating System</H2><BR /> For checking the Workbook of Linux Operating System, we can select the <STRONG>OS(Linux)</STRONG> under the <STRONG>Monitoring</STRONG> Tab<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-58.png" /></P><BR /> In the same tab we can see the Average CPU Usage per mode in graphical view<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-59.png" /></P><BR /> Go further to the same tab we can also see overview Average Memory Usage, file system occupied space and Network in and out of the VM<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-60.png" /></P><BR /> In CPU Tab, we can see the details about CPU usage and timeline.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-61.png" /></P><BR /> In the same tab we can see the Process and Forks details with count<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-62.png" /></P><BR /> In Memory Tab, we can see the Memory timeline usage and distribution<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-63.png" /></P><BR /> In same tab we can see the usage and timeline for the SWAP which is getting used<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-64.png" /></P><BR /> Going further in the same tab, we can see the details about the page and swap rate<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-65.png" /></P><BR /> In disk tab, we can see the mount points and respective details<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-081428-66.png" /></P><BR /> In the same tab, we can see Read/Write Bytes and time along with the Output I/O<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281.png" /></P><BR /> In Network Tab, we can see the inbound/outbound traffic, Network Packets and Network Bytes transferred<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-1.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-2.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-3.png" /></P><BR /> <BR /> <H2 id="toc-hId-368932954">6.3 SAP NetWeaver</H2><BR /> To check the workbook of SAP NetWeaver, we need to go to <STRONG>SAP NetWeaver</STRONG> Blade under <STRONG>Monitoring</STRONG> Tab<BR /> <BR /> Under <STRONG>Overview</STRONG> tab we can find the availability graph of the system. We can also group the same by SID<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-4.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-5.png" /></P><BR /> We can also group the availability by application server<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-6.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-7.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-8.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-9.png" /></P><BR /> In Queue Statistics tab we can see the details about the dispatcher queues<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-10.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-11.png" /></P><BR /> <BR /> <H2 id="toc-hId-172419449">6.4 High-Availability Pacemaker Cluster</H2><BR /> To see the Workbook for HA Pacemaker Cluster, we need to go to the <STRONG>High-Availability Cluster(pacemaker) cluster</STRONG> blade under the <STRONG>Monitoring</STRONG> tab<BR /> <BR /> In this we can see the cluster availability status in a graphical view<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-12.png" /></P><BR /> In the same tab, we can see the Node status and Resource Status which is attached to the Pacemaker Cluster<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-13.png" /></P><BR /> Going further to the same tab we can see the status of the primary node over time and resources under the primary node<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-14.png" /></P><BR /> Same way, we can see the status of the secondary node over time and resources attached to the Secondary node<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-15.png" /></P><BR /> <BR /> <H2 id="toc-hId--24094056">6.5 Microsoft SQL Server</H2><BR /> To see the Workbook of Microsoft SQL Server, we need to go to the <STRONG>Microsoft SQL Server</STRONG> blade under tab <STRONG>Monitoring</STRONG><BR /> <BR /> We can see the Batch request per sec, Compilations and Re-Compilations per second, CPU Usage and Latencies of the Microsoft SQL Server<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-16.png" /></P><BR /> In the same tab we can also see the hit ration and page life in a graphical view<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-17.png" /></P><BR /> Under Statistics Tab, we can see Memory overview as well as top 10 waits statistics<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-18.png" /></P><BR /> We can also see the top 10 SQL Statements and Top 12 Largest Tables in the SQL Server<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-19.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-20.png" /></P><BR /> Under Backup Tab, we can see the backup duration and sizes in the graphical view<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-21.png" /></P><BR /> <STRONG>This is end of Part – III, in next part <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-iv/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors – Part IV</A> of this article you can find more information about Alerts, Notifications and Troubleshooting Logs for Azure Monitors for SAP Solutions.</STRONG> 2021-05-10T07:11:11+02:00 https://community.sap.com/t5/technology-blogs-by-members/monitoring-of-sap-systems-using-azure-monitors-part-iv/ba-p/13517022 Monitoring of SAP Systems Using Azure Monitors – Part IV 2021-05-10T07:14:32+02:00 jaskisin https://community.sap.com/t5/user/viewprofilepage/user-id/659718 <STRONG>This is in continuation of my previous Article <A href="https://blogs.sap.com/2021/05/10/monitoring-of-sap-systems-using-azure-monitors-part-iii/" target="_blank" rel="noopener noreferrer">Monitoring of SAP Systems Using Azure Monitors – Part III</A></STRONG><BR /> <H1 id="toc-hId-829417624">7. ALERTS</H1><BR /> We can also setup alerts on the data that is being stored in the Log Analytics, we can design the alert as per our thresholds and requirements<BR /> <H2 id="toc-hId-761986838">7.1 Create Action Group</H2><BR /> For sending any notification we first need to create action group in azure Monitor, to do so we need to go to <STRONG>Monitor</STRONG> →&nbsp;<STRONG>Alerts</STRONG> →&nbsp;<STRONG>Manage Actions</STRONG> and then click on <STRONG>New Action Group</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-22.png" /></P><BR /> Fill out all the requested details and then click on <STRONG>Next: Notifications</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-23.png" /></P><BR /> Fill out all important details such as Name, Notification type, email id etc.… and then click on <STRONG>Next: Action</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-24.png" /></P><BR /> Fill the details about the Actions if any and then click on <STRONG>Next: Tags</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-25.png" /></P><BR /> Specify the Tags if any and then click on <STRONG>Next: Review + Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-26.png" /></P><BR /> Review all the settings of the Action Group and click on <STRONG>Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-27.png" /></P><BR /> Wait for the deployment to finish<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-28.png" /></P><BR /> <BR /> <H2 id="toc-hId-565473333">7.2 Setting Up Notification</H2><BR /> For settings up alert, we first go to Azure <STRONG>Monitor</STRONG> →&nbsp;<STRONG>Alert</STRONG> and click on <STRONG>New Alert Rule</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-29.png" /></P><BR /> Select the resource to Log Analytics Workspace in which the telemetry data is getting stored<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-30.png" /></P><BR /> We also need to specify the Condition by clicking <STRONG>Add Condition</STRONG> and then click on <STRONG>Custom log search</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-31.png" /></P><BR /> Specify the query which needs to be executed for triggering alert, here we are only using the query to check if system is up and running fine.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-32.png" /></P><BR /> Specify the condition after which email will be triggered and click <STRONG>Done</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-33.png" /></P><BR /> Condition will be added to the Alert<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-34.png" /></P><BR /> Now add action group to which email will be triggered<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-35.png" /></P><BR /> Specify the other requested details and click on <STRONG>Create</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-36.png" /></P><BR /> Wait for the Rules to create which we can see in the <STRONG>Alert Rules</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-37.png" /></P><BR /> So, Once Log Analytics receive GRAY from the sapcontrol as below<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-38.png" /></P><BR /> Alert will catch this anomaly and display it on <STRONG>Alert Dashboard</STRONG><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-39.png" /></P><BR /> Further details about Alert can be checked by clicking on this.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-40.png" /><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-41.png" /></P><BR /> Below is the sample email sent with details about the alert<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-42.png" /></P><BR /> <BR /> <H1 id="toc-hId-239877109">8. LOGS</H1><BR /> <H2 id="toc-hId-172446323">8.1 Log Analytics Workspace</H2><BR /> We can see and check the telemetry data which is been extracted by the providers<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-43.png" /></P><BR /> <BR /> <H2 id="toc-hId--24067182">8.2 Azure Monitor Activity Log</H2><BR /> We can also check the deployment logs about the providers in the Activity log of Azure Monitor<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-44.png" /></P><BR /> <BR /> <H2 id="toc-hId--220580687">8.3 Extraction Log</H2><BR /> We also see the extraction log of each call to system in the queue of Storage account.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/05/Screenshot-2021-05-04-0814281-45.png" /></P><BR /> Now SAP System installed on Azure is getting monitored using Azure Monitors for SAP Solutions.<BR /> <BR /> <STRONG>BEST OF LUCK!!</STRONG><BR /> <H1 id="toc-hId--546176911">9. CONCLUSION:</H1><BR /> In this 4 parts of article, we have discussed how we can <STRONG>&nbsp;Deploy, Configure, Workbooks, Alerts, Notifications and Troubleshooting logs for Azure Monitors for SAP Solutions.</STRONG><BR /> <BR /> &nbsp;<BR /> <BR /> THANK YOU..<BR /> <BR /> &nbsp; 2021-05-10T07:14:32+02:00 https://community.sap.com/t5/technology-blogs-by-sap/do-you-know-the-deadlock-monitor/ba-p/13411122 Do you know the Deadlock Monitor? 2021-08-26T09:27:50+02:00 gudmundur_karlsson https://community.sap.com/t5/user/viewprofilepage/user-id/569476 <H1 id="toc-hId-800610688">Purpose</H1><BR /> Deadlocks can occur in any SQL Server multiuser application. The occurrences of deadlocks are a problem of the application. It is not a SQL Server problem. SQL Server and SAP provide tools to detect, monitor and analyze the deadlocks. But in the end the solution must lie with the application development and process management.<BR /> <BR /> Sometimes the deadlocks are handled properly by the application and sometimes not. Unexpected deadlocks can occur if performance problems cause transactions to hold locks longer than expected, or if wrong query plans are used, or if ad hoc statements interfere with the system. There are many reasons why deadlocks could cause system problems so it's vital to have a good tool to analyze them.<BR /> <BR /> Below you can learn how to use the DBACOCKPIT -&gt; Diagnostics -&gt; <STRONG>Deadlock Monitor</STRONG> action in SAP NetWeaver which is available when SAP NetWeaver is running on SQL Server or a remote DBACOCKPIT connection to SQL Server is set up for monitoring.<BR /> <H1 id="toc-hId-604097183">Setup</H1><BR /> The Deadlock Monitor is always available for the local system. If the DBACOCKPIT is used to monitor a remote SQL Server, some features may not be available.<BR /> <H1 id="toc-hId-407583678">Using the Deadlock Monitor</H1><BR /> When you enter the Deadlock Monitor action for the local system, you will see two tabs:<BR /> <BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2019/03/Capture.jpg" /><BR /> <H2 id="toc-hId-340152892">Deadlocks Reported by ABAP Stack</H2><BR /> The first tab is the old deadlock monitor. It is based on the MSSDEADLCK table. This table exists in the SAP NetWeaver dictionary and it is filled by DBSL (the DB interface of SQL Server) when SAP NetWeaver encounters deadlocks. This feature only tracks deadlocks generated by the SAP NetWeaver kernel. If deadlocks were encountered by any other software, they will not appear here.<BR /> <BR /> The SAP NetWeaver system running on the schema to be monitored records the deadlocks in table MSSDEADLCK and it also deletes the records after one month using an SM37 job (report RSMSSDCN).<BR /> <BR /> In this context only two features possible: <EM>Table detail</EM> and <EM>ABAP code</EM>. Those commands are available in the ALV toolbar. The table detail button navigates you to the table detail action for the table listed in the selected deadlock line. The table detail button is always enabled. The ABAP code button is only available when monitoring the local system. It opens an ABAP editor for the OPEN SQL statement where the error occurred.<BR /> <BR /> &nbsp;<BR /> <H2 id="toc-hId-143639387">Deadlocks Recorded in X-Events</H2><BR /> There are two generations of this screen. the first is a simple list of deadlocks recorded in the SQL Server Systemhealth (syshealth) X-events session. The second is a more sophisticated summary list, with the original detailed list below.<BR /> <H3 id="toc-hId-76208601">First Release</H3><BR /> First we will describe the earlier version:<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/06/single_deadlock-1.png" height="97" width="819" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">Deadlock List</P><BR /> This shows that a deadlock has occurred, and it shows the "victim" of the deadlock, i.e. the session that was selected by SQL Server to trigger an error and reset the transaction. It also shows the "survivor" of the deadlock, i.e. the other process which was involved but was not affected by the deadlock. Using the toolbar buttons, you can view the details of the tables involved (owner object and waiter object), examine the ABAP code of either the victim or the survivor, and view the full XML graph in a browser. If SSMS (the SQL Server Management Studio) is installed on the local PC, the deadlock can be opened in SSMS showing a graphical view of the deadlock chain.<BR /> <BR /> When you press the "Owner object detail" button, the DBACOCKPIT action "Single Table Analysis" is invoked. The same action can be called for the "Waiter object detail" which is the object that the process is trying to lock but has to wait because the resource is locked by another process.<BR /> <H3 id="toc-hId--120304904">New Version</H3><BR /> The newer version is called "Deadlocks from X-Events Session". Instead of a simple list, the screen now has three sections:<BR /> <UL><BR /> <LI>Deadlock Summary<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/08/deadlock_summary.png" height="67" width="664" /></LI><BR /> <LI>Inputbuffer of the session which encountered the deadlock<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/08/inputbuffer.png" /></LI><BR /> <LI>Deadlock Details. This is the same list as the one described in the earlier version.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/08/deadlock_details.png" /></LI><BR /> </UL><BR /> This new screen has several advantages over the old one. The top summary view is a grouping of the most common deadlocks that have occurred on the system, with the most common at the top. The list is ordered by the victim flag (victims at the top, survivors on the bottom) and the number of occurrences of that particular deadlock.<BR /> <BR /> The reason this list was provided is that with the old simple list it was very difficult in some cases to determine which deadlock occurred most often in order to focus on the most problematic type of deadlock.<BR /> <BR /> The middle section shows the full SQL statement. If the deadlock entry above is a victim of a deadlock, then it is the statement that failed, otherwise it is the statement that was executing in the surviving process when the deadlock occurred.<BR /> <BR /> The bottom section is the same as before, but when you click on the "Details for selected deadlock" button in the summary list, this detail list will only show you the occurrences for that deadlock. This can be reverted by clicking on "All Deadlocks" in the detail list.<BR /> <H3 id="toc-hId--316818409">The X-Events Session</H3><BR /> The older version of the X-Events tab used the SQL Server Systemhealth (syshealth) session. The new version introduces a new separate X-Events session named "SAP_Deadlocks". After the support package of the new version is applied to a system, a new SQL Server "Extended Events" session appears in the SQL Server Management Studio under Management -&gt; Extended Events -&gt; Sessions. This new session is more efficient because it records only deadlock events and nothing else. The data is also kept longer than in the syshealth session, since only deadlocks are recorded.<BR /> <BR /> The old screen sometimes took a long time to read data from the syshealth session because the syshealth session grows very large on busy systems. The new screen should always appear much faster.<BR /> <H1 id="toc-hId--771497352">Usage Scenarios</H1><BR /> The starting point for understanding deadlocks, how and why they occur and how they can be tracked and analyzed is SAP Note <A href="https://launchpad.support.sap.com/#/notes/32129" target="_blank" rel="noopener noreferrer">32129</A>. This note refers to other notes which provide detailed information about various aspects of handling deadlocks in SAP systems running on SQL Server. This information can sometimes be overwhelming, so we provide only a brief overview here.<BR /> <BR /> Some reasons for deadlocks (not a complete list):<BR /> <OL><BR /> <LI><STRONG>Missing index to support a DML statement</STRONG><BR /> This can cause the statement (UPDATE, DELETE) to lock many more rows in the table than are actually modified in the end. Usually there are scans and searches that lock a lot of rows. In this case, use the SQL DML statement WHERE condition to determine whether there is a fitting index. Use the object detail buttons to jump to single table analysis to view the existing indexes.</LI><BR /> <LI><STRONG>Application does not serialize execution of critical changes</STRONG><BR /> This allows parallel execution, which can result in deadlocks. It is important to try to understand the application context in which the deadlock occurred. Use the "ABAP code" button to jump to the Open SQL statement and examine the surrounding code. Try to understand how the two processes interfered with each other, why they were running simultaneously (parallel jobs etc.) and how this can be avoided either by scheduling jobs at a different time or with a different data set, or by modifying the code to synchronize access to a critical path.</LI><BR /> <LI><STRONG>Long running statements</STRONG><BR /> This can be a SELECT or any other statement. If a statement is slow due to system performance and the transaction remains open for a longer period, the system is at risk of deadlock. This is a common scenario. Long running statements are inefficient and consume a lot of resources and time, but they can cause even worse problems if they occur within a transaction which has already acquired some locks. This drastically increases the likelihood of deadlocks in some cases. So, resolving performance issues (adding indexes, hints, altering the Open SQL statement, etc.) can often magically reduce the occurrences of deadlocks in a process.</LI><BR /> <LI><STRONG>Application does not commit often enough</STRONG><BR /> If there is a long running batch job that runs mass modifications within a single transaction, this leads to many open locks. This can then interfere with normal short user transactions that modify the same tables.<BR /> To monitor this, SAP has provided a new feature in DBACOCKPIT: Performance -&gt; History -&gt; <STRONG>Open Transaction History</STRONG>. This feature is available in the same support packages as the newer Deadlock Monitor user interface. We will not go into detail on this feature here. This will be covered in a separate blog post. A link will be added here soon.<BR /> Open transactions need to be avoided for two reasons. First to avoid holding locks too long, which increases the likelihood of deadlocks, and second because a long transaction consumes excessive log space and may cause the database to run out of log space.<BR /> To solve this problem, the application must be analyzed to either increase the frequency of COMMITs or use a smaller data set.</LI><BR /> <LI><STRONG>Different access order</STRONG><BR /> In this case, the application modifies the data in more than one process, each of which uses a different access order. Or different indexes are used in different DML statements for the same table. Sometimes there is an ABAP internal table that contains a number of rows, and the content of the table is not consistently ordered the same way when the concurrent processes scan the table and execute modifications (perhaps in multiple tables) for each row.<BR /> In some cases, the solution can be as simple as adding a "sort" statement in ABAP to make the access more consistent.</LI><BR /> </OL><BR /> To summarize: The Deadlock Monitor can be used to determine the various reasons for deadlocks and then one or more of the following actions can be taken:<BR /> <OL><BR /> <LI>Add an index to get a better access plan for queries (to shorten a transaction) and/or DML operations (to have a smaller footprint).</LI><BR /> <LI>Optimize queries using database hints or update statistics on tables. SQL Server automatically updates statistics on tables, but in rare cases, manual updating of statistics is required.</LI><BR /> <LI>Recommend code changes in Z customer code or open an SAP case if the problem occurs in SAP code.</LI><BR /> </OL><BR /> If this is not sufficient and a more detailed analysis is needed, we recommend three blogs by Clas Hortien from Microsoft Germany:<BR /> <OL><BR /> <LI>Deadlock Analysis (basic)</LI><BR /> <LI>Deadlock Analysis (advanced)</LI><BR /> <LI>Deadlock Analysis (examples)</LI><BR /> </OL><BR /> These blogs are tailored for SAP workload, but mainly describe native SQL Server tools. The blogs can be accessed <A href="https://techcommunity.microsoft.com/t5/running-sap-applications-on-the/bg-p/SAPApplications/label-name/deadlock" target="_blank" rel="nofollow noopener noreferrer">here</A>.<BR /> <BR /> &nbsp;<BR /> <H1 id="toc-hId--968010857">Release Information</H1><BR /> The older version of the deadlock monitor, with the deadlocks recorded in ABAP stack and X-events have been part of DBACOCKPIT for many years. However, the new features (summary list, inputbuffer) were delivered in mid-2021.&nbsp; The SP levels of the new feature are as follows:<BR /> <BR /> SAP NetWeaver 756 SP01<BR /> SAP NetWeaver 755 SP03<BR /> SAP NetWeaver 754 SP05<BR /> SAP NetWeaver 753 SP07<BR /> SAP NetWeaver 752 SP10<BR /> SAP NetWeaver 751 SP13<BR /> SAP NetWeaver 750 SP23<BR /> SAP NetWeaver 740 SP27<BR /> SAP NetWeaver 731 SP30<BR /> <BR /> The new features are not supported in earlier releases than SAP NetWeaver 7.30 EhP1 (SAP_BASIS 731).<BR /> <BR /> &nbsp;<BR /> <H1 id="toc-hId--394784279">Conclusion</H1><BR /> I hope this overview of the Deadlock Monitor, and how to use it to address various types of deadlock issues, proves helpful to you. If you have further questions about the Monitor, or about a deadlock problem you are encountering, I encourage you to ask your questions in our SAP Community using this <A href="https://answers.sap.com/questions/ask.html?primaryTagId=891349005586930604519575996418053" target="_blank" rel="noopener noreferrer">link</A>.<BR /> <BR /> If you want to read more about SAP on SQL server then I invite you to view our topic area <A href="https://community.sap.com/topics/sql-server" target="_blank">here</A>. 2021-08-26T09:27:50+02:00 https://community.sap.com/t5/technology-blogs-by-sap/why-is-my-sql-server-database-log-growing-out-of-control-risking-system/ba-p/13496636 Why is my SQL Server database log growing out of control risking system standstill? 2021-11-18T23:09:42+01:00 gudmundur_karlsson https://community.sap.com/t5/user/viewprofilepage/user-id/569476 <H1 id="toc-hId-808152651">Purpose</H1><BR /> It is very important to monitor the transaction log size of SQL Server. If SQL Server runs out of log space the system will come to a standstill. The log space is released when a log backup is performed. But the space is only made available up to the starting point of the longest running open transaction. That means that if transactions are held open for a long time, the log will grow out of control. We have seen cases where transactions were held open for days in some SAP background jobs which resulted eventually in a full log and system standstill.<BR /> <BR /> If transactions are open for a long time, and they also hold many locks on database objects, then un-necessary blocking can occur resulting in unexplained bad performance. This also increases the risk of deadlocks in the system.<BR /> <BR /> Until now the only indicator in DBACOCKPIT that a transaction has been open too long has been the DB02 main screen (DBACOCKPIT -&gt; Space -&gt; Overview). The middle section of the screen looks like this:<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/08/DB02.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">DB02</P><BR /> What is new is the "History" button. That is the topic of this blog post. This button takes you to the new DBACOCKPIT action where you can view a history of long running transactions and examine the details of not only the processes which held a transaction for a longer time, but also the locks which were held by the session and blocked other sessions.<BR /> <BR /> The screen is also available under DBACOCKPIT -&gt; Performance -&gt; History -&gt; Open Transaction History<BR /> <H1 id="toc-hId-611639146">Setup</H1><BR /> The Open Transaction History is always available for the local system if it's running on SQL Server, or if the DBACOCKPIT is used to monitor a remote SQL Server.<BR /> <BR /> The action is supported for SQL Server 2005 and higher.<BR /> <H1 id="toc-hId-415125641">Using the Open Transaction History</H1><BR /> The DBACOCKPIT action is available under Performance -&gt; History -&gt; Open Transaction History.&nbsp; The initial screen looks like this:<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/08/OpenTransactionHistory.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">Open Transaction History</P><BR /> The top part of the screen shows a list of sessions which held a transaction open for more than 1 minute. The system checks this once every 20 minutes. The list shows when the data was collected, the session ID and which application program was using the session. The start time of the transaction and the duration in minutes so far at the collection time is also shown.<BR /> <BR /> There is a column in the list which contains the first part of the SQL statement which was the last one executed on the session when the data was collected (the inputbuffer). Usually this statement is much longer than the area provided on the list. You can view the full statement by selecting the row and clicking on the "Details for selected row" button. Double-clicking on the line has the same effect. This will cause the full statement to appear in an edit control in the middle part of the screen.<BR /> <BR /> The list also shows some attributes of the session such as the CPU time and number of reads. Also the current log size and the allocated space within the log at the time of collection are shown.<BR /> <BR /> The toolbar of the ALV control has a couple of useful buttons: "ABAP Code" and "Table Detail". The system tries to determine the ABAP report name and location and also the primary table name to allow navigation to either view the ABAP code in an editor or view the table definition. The "ABAP Code" button is disabled when monitoring remote servers.<BR /> <H2 id="toc-hId-347694855">Active Request</H2><BR /> When a session is checked there may be a SQL statement currently running on the session or it may be inactive. This is indicated by the column "Active request". If there is no active request it means that at the time the session was just waiting for the next SQL statement to be issued and no activity was occurring in that session on SQL Server. There can be many reasons for this. The ABAP program may be executing a long running calculation, it may be waiting in a remote function call (RFC), waiting for an enqueue object or working on executing SQL statements on another connection. If there is no active statement then the statement shown in the inputbuffer edit control is just the last statement executed prior to the data collection time, it wasn't being executed at the time.<BR /> <BR /> If there was an active request then the columns to the right contain information about the request. CPU and I/O numbers will show how many resources were consumed by the request, what the wait type was and how long the wait had been.<BR /> <BR /> If there was an active request on the session which was saved in the history, then the button "Show Active Request" in the toolbar will navigate to the statement analysis screen to examine the statement and the query plan of the request that was active.<BR /> <H2 id="toc-hId-151181350">Locks</H2><BR /> The lower third of the screen shows a list of sessions which were blocked by the selected top level session which was determined to have been running the longest. If there was a hierarchy of blocked processes then the "SQL statement text" column will show which sessions were blocked in the hierarchy by showing arrows of different lengths indicating the depth of the session in the blocking hierarchy. This display is similar to the Performance -&gt; Locks screen which shows currently blocked sessions.<BR /> <BR /> For each of the sessions which were blocked the statement is shown and the button "SQL Statement" allows you to view the full statement and the full query plan in the statement monitor. This also allows navigation to the ABAP code and all the other statement analysis features such as viewing table and indexing details.<BR /> <H1 id="toc-hId--174414874">Usage Scenarios</H1><BR /> Long running transactions can cause two different types of problems on the database server:<BR /> <OL><BR /> <LI>Allocated log space grows out of control. If the log runs out of space then no changes can be made in the database anymore.</LI><BR /> <LI>Blocking locks which are held too long can cause performance bottlenecks and in some cases deadlocks can occur. This can happen even on systems which have more than sufficient CPU and I/O resources.</LI><BR /> </OL><BR /> It is important to monitor the allocated log space over time and make sure there is always plenty of space available on the disk. In DBACOCKPIT go to Space -&gt; History -&gt; Database Size History and check the "Allocated log space (MB)" column. You will see that the log space allocated is reduced when log backups occur and then gradually increases until the next backup. Always make sure that the peak usage is well within the total available log space on the disk. If the allocated space in the log behaves erratically with extreme peaks, then it's an indication that transactions are held too long. In that case use the Open Transaction History screen to find the longest running transactions that have been caught by the history job. Use ALV features to sort the data according to the number of minutes the transaction was held open. Make a note of when these transactions start, which jobs open the transactions and whether there are performance problems or other artificial delays which could cause a transaction to remain open for an extended period.<BR /> <BR /> Sometimes excessive blocking can cause performance problems. If users complain that some of their transaction are intermittently very slow, whereas most other transactions are fast, that's an indication that excessive blocking is occurring. In that case you can use DBACOCKPIT -&gt; Performance -&gt; SQL Statements and sort the data by "Wait ratio: elapsed/CPU time". There you will see statements which run for a long time, but don't use much CPU time, i.e. they are blocked. In addition you can visit the Open Transaction History screen and see if the "Blocking" column is checked. Then double click on those lines where "Blocking" is indicated. On the bottom ALV list you will be able to see all the sessions which were blocked by that statement. You may see a long list of blocking and blocked sessions. You can see which work process was used, whether it was a dialog or batch process. When you click on the "SQL Statement" button in the toolbar you can see which ABAP report was used and which table was used. This may help you determine how and why the job or frontend process was blocked and possibly how to avoid such a situation.<BR /> <H1 id="toc-hId--370928379">Release Information</H1><BR /> This DBACOCKPIT feature was delivered with the following SAP_BASIS support packages:<BR /> <BR /> 756 SP01<BR /> 755 SP03<BR /> 754 SP05<BR /> 753 SP07<BR /> 752 SP10<BR /> 751 SP13<BR /> 750 SP23<BR /> 740 SP27<BR /> 731 SP30<BR /> <BR /> The new feature is not supported in releases earlier than NetWeaver 7.30 SP1 (SAP_BASIS 731).<BR /> <H1 id="toc-hId--567441884">Conclusion</H1><BR /> I hope this overview of the Open Transaction History monitor proves helpful to you. If you have further questions about the Monitor, or about a long running open transaction you are observing in your system, I encourage you to ask your questions in our SAP Community using this <A href="https://answers.sap.com/questions/ask.html?primaryTagId=891349005586930604519575996418053" target="_blank" rel="noopener noreferrer">link</A>.<BR /> <BR /> If you want to read more about SAP on SQL server then I invite you to view our topic area&nbsp;<A href="https://community.sap.com/topics/sql-server" target="_blank">here</A>. 2021-11-18T23:09:42+01:00 https://community.sap.com/t5/technology-blogs-by-sap/odata-calls-statistics-in-st03/ba-p/13516095 OData Calls Statistics in ST03 2021-11-29T16:26:18+01:00 dmitry_sharshatkin https://community.sap.com/t5/user/viewprofilepage/user-id/186675 ST03/ST03N – SAP Workload Monitor, contains performance statistics for different task types, including HTTP(s) calls.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/11/st03_1-1.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">ST03 - Workload Overview</P><BR /> When you try to identify the top HTTP(s) calls, influencing your system, you can probably see the following picture.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/11/st03_2.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">ST03 - Transaction Profile</P><BR /> There will be a report SAPMHTTP on top of the list, consuming most of the total response time, and then some ABAP WebDynpro Applications (starting with symbol: &lt;{&gt;) and BSP Applications / WebUI Components (with names as is or starting with BSPWD*).<BR /> <BR /> But you won’t see any OData calls because this statistic is hidden behind the report SAPMHTTP.<BR /> <BR /> This is default configuration and it’s done so in order to limit the number of aggregated records, so that the data set is not getting too big, which may lead to ABAP memory dumps.<BR /> <BR /> If you want to see the performance statistics for HTTP / OData calls, you need to adjust some settings.<BR /> <BR /> First execute report <EM><STRONG>SWNC_CONFIG_URL</STRONG></EM> and chose the rule for aggregating HTTP calls. Select either “Break-Down by URL” or “Break-Down by URL and Page”.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/11/rep_1.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">Report SWNC_CONFIG_URL</P><BR /> If you configure this way, the Odata calls will be aggregated with complete URL, like “/sap/opu/odata/sap/ZMY_ODATA_SRV/MyEntitySet”.<BR /> <BR /> You can leave them as is, or you can also remove or replace unnecessary prefix “/sap/opu/odata/sap” with a special symbol or characters. This setting is done in the report <EM><STRONG>SWNC_CONFIG_PATH</STRONG></EM>.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/11/rep_2.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">Report SWNC_CONFIG_PATH</P><BR /> Press F1 (“Help”) to get more help regarding the settings.<BR /> <BR /> Alternatively refer to the SAP Note: <A href="https://launchpad.support.sap.com/#/notes/1631033" target="_blank" rel="noopener noreferrer">1631033</A> – “Normalization of background job names for statistics data”.<BR /> <BR /> After all these settings you will be capable to see more detailed performance statistics per HTTP(s) / OData calls.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/11/st03_3.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">ST03 - Aggregation of HTTP Calls</P><BR /> <STRONG>Note:</STRONG> But bear in mind that the change of configuration may lead to ABAP memory dumps.<BR /> <BR /> Please check the following blog post: <A href="https://blogs.sap.com/2015/05/06/sapcollectorforperfmonitor-dumps-with-exporttoomuchdata-or-tsvtnewpageallocfailed/" target="_blank" rel="noopener noreferrer">https://blogs.sap.com/2015/05/06/sapcollectorforperfmonitor-dumps-with-exporttoomuchdata-or-tsvtnewpageallocfailed/</A><BR /> <BR /> P.S. If something is not working, don't report here! Please, raise SAP incident instead.<BR /> <BR /> BR, Dima<BR /> <BR /> &nbsp; 2021-11-29T16:26:18+01:00 https://community.sap.com/t5/technology-blogs-by-sap/measure-your-application-s-performance-and-resource-consumption-evaluate/ba-p/13509690 Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS 2021-12-23T13:26:34+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 Imagine that you have designed and implemented this great app your users have been waiting for. But if it is too slow, they will not like it. System administrators will hate it if its resource consumption is too high. How do you know ahead of time that your app offers great functions and also runs fast and lean? You <STRONG>use transaction <CODE>STATS</CODE> to evaluate statistics records</STRONG> associated with your application's executions.<BR /> <BR /> In this blog post I explain how you obtain statistics records with high quality and how you analyze them with transaction <CODE>STATS</CODE>. In the best case, such an analysis proves that your app combines excellent single user performance with low resource consumption and is scalable. In all other situations, the analysis will indicate the bottleneck where optimizations shall be applied.<BR /> <BR /> As owner and developer of transaction <CODE>STATS</CODE> I am more than happy to share <STRONG>tips and tricks</STRONG> that will help you to <STRONG>efficiently work with the tool</STRONG> and to <STRONG>obtain insights into your application's performance</STRONG>.<BR /> You can use <CODE>STATS</CODE> since SAP NetWeaver 7.40. I am continuously improving it and this blog post presents the tool’s state for SAP NetWeaver 7.57 as of late December 2021.<BR /> <H1 id="toc-hId-828559666">What are Statistics Records?</H1><BR /> Statistics records are logs of activities performed in SAP NetWeaver Application Server for ABAP or on the ABAP platform. During the execution of any task by a work process in an ABAP instance, the SAP kernel collects header information to identify the task, and captures various measurements, like the task’s response time and total memory consumption. When the task ends, the gathered data is combined into a statistics record.&nbsp; These records are stored chronologically in a file in the application server instance’s file system. Collecting statistics records is a technical feature of the ABAP runtime environment and requires no manual effort.<BR /> <BR /> The measurements in these records provide useful insights into the performance and resource consumption of the application whose execution triggered the records’ capture. Especially helpful is the breakdown of the response times of the associated tasks into DB requests, ABAP processing, remote communication, or other contributors.<BR /> <BR /> The value of your performance analysis depends on the quality of the underlying measurements. While the collection of data into the statistics records is performed autonomously by the SAP kernel, <STRONG>you need some preparation</STRONG> to ensure that the captured information accurately reflects the performance of the application.<BR /> <OL><BR /> <LI>Ensure that the test system you will use for the measurements is configured and customized correctly.</LI><BR /> <LI>Verify that&nbsp;the test system is not under high load from concurrently running processes during your measurements</LI><BR /> <LI>Carefully define the test scenario to be executed by your application. It must adequately represent the application’s behavior in production.</LI><BR /> <LI>Provide a set of test data that is representative of your productive data. Only then will the business scenario execution resemble everyday use.</LI><BR /> <LI>Execute the scenario a few times to fill the buffers and caches of all the involved components (e.g., DB cache, application server’s table buffer, web browser cache). Otherwise, your measurements will not be reproducible, but will be impaired by one-off effects that load data into these buffers and caches. It is then much harder to draw reliable conclusions.</LI><BR /> </OL><BR /> After this preparation, you execute the measurement run, during which the SAP kernel writes the statistics records that you will use for the analysis.<BR /> <H1 id="toc-hId-632046161">How Do You Analyze&nbsp;Statistics Records?</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px;text-align: left">To display the statistics records of your measurement run, you call transaction <CODE>STATS</CODE>. Its start screen (Fig. 1) consists of four areas, where <STRONG>you specify criteria for the subset of statistics records</STRONG> you want to view and analyze.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/12/2021-12-20_08-38-12.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 1</EM>:</STRONG> <EM>On the <CODE>STATS</CODE> start screen, you define filter conditions for the subset of statistics records you want to analyze, specify from where the records are retrieved, and select the layout of the data display.</EM></P><BR /> <P style="overflow: hidden;margin-bottom: 0px;text-align: left">In the topmost area, you determine the <EM>Monitoring Interval</EM>. By default, it extends 10 minutes into the past and 1 minute into the future. Records written during this period are displayed if they fulfill the conditions specified in the other areas of the start screen. Adjust this interval based on the start and end times of your measurement run so that <CODE>STATS</CODE> shows as few unrelated records as possible.</P><BR /> <P style="text-align: left">In the <EM>Record Filter</EM> area, you define additional criteria that the records must meet—for example, client, user, or lower thresholds for measurement data, such as response time or memory consumption. Be as specific and restrictive as possible, so that only records relevant for your investigation will be displayed.</P><BR /> <P style="text-align: left">By default, statistics records are read from all application instances of the system. In the <EM>Configuration</EM> section, you can change this to the local instance, or to any subset of instances within the current system. Restricting the statistics records retrieval to the instance (or instances) where the application was executed shortens the runtime of <CODE>STATS</CODE>. The option <EM>Include Statistics Records </EM><EM>from Memory</EM> is selected by default, so that <CODE>STATS</CODE> will also process records that have not yet been flushed from the memory buffer into the file system.</P><BR /> Under <EM>Display Layout</EM>, select the domain you want to focus on and how the associated subset of key performance indicators (KPIs)—the captured data—will be arranged in the tabular display of statistics records. The <EM>Main KPIs</EM> layouts provide an initial overview with the most important data and is a good starting point.<BR /> <H1 id="toc-hId-435532656">What do You Learn from Statistics Records?</H1><BR /> <P style="text-align: left">Fig. 2 shows the statistics record display based on the settings specified in the <CODE>STATS</CODE> start screen (Fig. 1).<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/12/2021-12-21_07-12-31.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 2</EM>:</STRONG> Statistics records matching the criteria specified on the <CODE>STATS</CODE> start screen.<BR /> The list shows statistics records that correspond to the creation of a sales order with SAP GUI transaction <CODE>VA01</CODE>.</P><BR /> The table lists the selected statistics records in chronological order and contains their main KPIs. The header columns—shown with a blue background—uniquely link each record to the corresponding task that was executed by the work process. The data columns contain the KPIs and indicate the performance and resource consumption of the tasks. Measurements for times and durations are given in milliseconds (ms). Memory consumptions and data transfers are measured in kilobytes (KB).<BR /> <BR /> The table of statistics records is displayed within an ALV grid control and inherits all functions of this SAP GUI tool: You can sort or filter records; rearrange, include, or exclude columns; calculate totals and subtotals; or export the entire list. You can also switch to another display layout or modify the currently used layout. To access these and other standard functions, expand the toolbar by clicking on the <EM>Show Standard ALV Functions</EM> button (the black triangle that points to the right).<BR /> <BR /> The measurements most relevant for assessing performance and resource consumption are the task’s <EM>Response Time</EM> and <EM>Total Memory Consumption</EM>. The <EM>Response Time</EM> measurement starts on the application server instance when the request enters the dispatcher queue and ends when the response is returned. It does not include navigation or rendering times on the front end, or network times for data transfers between the front end and the back end. It is strictly <STRONG>server</STRONG> <EM>Response Time</EM>. (Exception: For SAP GUI transactions that use GUI controls, the RFC-based communication with them occurs in roundtrips. Their total time is measured as <EM>GUI Time</EM> and included in the <EM>Response Time</EM>. Parts of <EM>GUI Time</EM> may be contained in <EM>Roll Wait Time</EM>, the remainder will contribute to <EM>Processing Time</EM>.) The end-to-end response time experienced by your application’s users may be significantly longer than the server <EM>Response Time</EM>. The most important contributors to server <EM>Response Time</EM> are <EM>Processing Time</EM> (mostly the time it takes for the task’s ABAP statements to be handled in the work process) and <EM>DB Request Time</EM> (the time that elapses while database requests triggered by the application are processed). In most cases, <EM>Total Memory Consumption</EM> is identical to the <EM>Extended Memory Consumption</EM>, but <EM>Paging Memory</EM>&nbsp;or <EM>Heap Memory</EM> may also contribute to the total.<BR /> <BR /> From this list of statistics records, using criteria appropriate to your investigation, <STRONG>you find and inspect statistics records</STRONG> for tasks that are too slow or require too many resources.<BR /> <P style="text-align: left">Since even the most basic statistics record contains too much data to include in a tabular display, <CODE>STATS</CODE> gives you access to all measurements—most notably the breakdowns of the total server <EM>Response Time</EM> and the <EM>DB Request Time</EM>, and the individual contributions to <EM>Total Memory Consumption</EM>—of a selected record by double-clicking any of its columns. This leads you to an itemized view of the record’s measurements in a pop-up window (Fig. 3).<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2021/12/2021-12-20_08-44-52.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 3</EM>:</STRONG> Pop-up window with all available measurements for a statistics record, subdivided into semantic categories on separate tabs.</P><BR /> At the top, it identifies the statistics record via its header data. With the up and down triangles to the left of the header data you can navigate from record to record within this pop-up. The available technical data is grouped into categories, such as <EM>Time</EM>, <EM>DB</EM>, or <EM>Memory and Data</EM>. Use the tabs to switch between categories. Tabs for categories without data for the current statistics record are inactive and grayed out. Documentation is available by single-clicking the field name.<BR /> <BR /> To assess the data captured in a statistics record, consider the purpose that the corresponding task serves.<BR /> OLTP (Online Transaction Processing) applications usually spend about 25% of their server <EM>Response Time</EM> as <EM>DB Request Time</EM> and the remainder as <EM>Processing Time</EM> on the application server. For tasks that invoke synchronous RFCs or communication with SAP GUI controls on the front end, associated <EM>Roll Wait Time</EM> may also contribute significantly to server <EM>Response Time</EM>. For OLTP applications, the expected end-to-end response time is about 1,000 ms and the typical order of magnitude for <EM>Total Memory Consumption</EM> is 10,000 KB. Records that show significant upward deviations may indicate a performance problem in your application. You should analyze them carefully and use dedicated analysis tools such as transactions <CODE>ST05</CODE> (Performance Trace) or <CODE>SAT</CODE> (Runtime Analysis).<BR /> In comparison, OLAP (Online Analytical Processing) applications typically create more load on the database (absolute as well as relative) and may consume more memory on the application server. Users of OLAP applications may have slightly relaxed demands of their end-to-end response times.<BR /> <H1 id="toc-hId-239019151">Conclusions</H1><BR /> You want to <STRONG>optimize the performance of your applications</STRONG> and you want to <STRONG>ensure their linear scalability</STRONG>. For this you need <STRONG>reliable data</STRONG> that <STRONG>indicates the software’s response times and resource consumption</STRONG>. For ABAP-based applications, this data is contained in the <STRONG>statistics records</STRONG> that the SAP kernel captures automatically for every task handled by a work process. Using this information, you can identify critical steps in an application, determine which component is the bottleneck, and define the best approach for optimization.<BR /> <BR /> The <STRONG>Performance Monitor (transaction <CODE>STATS</CODE>) </STRONG>is a tool for <STRONG>selecting, displaying, and analyzing statistics records</STRONG>. It helps developers and operators find the best balance between fast response times, large data throughput, high concurrency, and low hardware cost. The tool is easy and convenient to use and comes with a feature-rich user interface framework so that you can focus on the data and its interpretation.<BR /> <H1 id="toc-hId-42505646">Outlook</H1><BR /> As a developer, and in the interest of your application's users, you are primarily interested in short end-to-end response times, but <CODE>STATS</CODE> focusses very much on server <EM>Response Time</EM>. Especially for modern browser-based or mobile applications, front-end and network times dominate the total duration of many user interaction steps, but their contributions are not contained in the statistics records.<BR /> <BR /> Additionally, one of your interactions with the application may trigger multiple HTTP round trips into the ABAP back end. All associated statistics records must be considered for a complete account of the resource consumption, but their attribution is not always straightforward.<BR /> <BR /> To fill these gaps, SAP's UI frameworks (especially SAPUI5 underlying SAP Fiori applications) collect relevant data on the front end and subsequently send it in front-end statistics records to the ABAP back end. There these front-end statistics records can be combined with the corresponding main statistics records.<BR /> <BR /> I will describe the front-end statistics records in a sequel to this blog post. I will also introduce and explain transaction <CODE>STATS_FE</CODE> as the tool to display and analyze them.<BR /> <H1 id="toc-hId--154007859">References</H1><BR /> Parts of this blog post are taken from my SAPinsider article on transaction <CODE>STATS</CODE>:<BR /> <A href="https://sapinsider.org/identifying-performance-problems-in-abap-applications/" target="_blank" rel="nofollow noopener noreferrer">Identifying Performance Problems in ABAP Applications</A><BR /> <BR /> Details on the collection and interpretation of statistics records are explained in SAP Notes:<BR /> <A href="https://launchpad.support.sap.com/#/notes/579462" target="_blank" rel="noopener noreferrer">579462 - Runtime parameter of the statistics collection</A><BR /> <A href="https://launchpad.support.sap.com/#/notes/8963" target="_blank" rel="noopener noreferrer">8963 - Definition of SAP response time/processing time/CPU time</A><BR /> <A href="https://launchpad.support.sap.com/#/notes/1063061" target="_blank" rel="noopener noreferrer">1063061 - Information about response time in STAD/ST03</A><BR /> <A href="https://launchpad.support.sap.com/#/notes/364625" target="_blank" rel="noopener noreferrer">364625 - Interpretation of response time in 4.6</A><BR /> <A href="https://launchpad.support.sap.com/#/notes/552845" target="_blank" rel="noopener noreferrer">552845 - FAQ: RFC Statistics in Transactions ST03/ST03N and STAD</A><BR /> <BR /> <CODE>STATS</CODE> is the successor of transaction <CODE>STAD</CODE>. As both tools work with the very same statistics records, the following two blog posts are still relevant:<BR /> <A href="https://blogs.sap.com/2007/01/12/statistical-records-part-1-inside-stad/" target="_blank" rel="noopener noreferrer">Statistical Records Part 1: Inside STAD</A><BR /> <A href="https://blogs.sap.com/2007/02/15/statistical-records-part-2-rfc-statistics/" target="_blank" rel="noopener noreferrer">Statistical Records Part 2: RFC Statistics</A> 2021-12-23T13:26:34+01:00 https://community.sap.com/t5/technology-blogs-by-sap/use-transaction-stats-fe-to-analyze-the-performance-of-your-web-application/ba-p/13539702 Use Transaction STATS_FE to Analyze the Performance of your Web Application 2022-01-27T11:40:54+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 As a business application developer, you need to ensure that your apps run with optimal performance. While this holds for all types of applications, in this blog post I am specifically looking at web apps, and in particular I am focusing on SAP S/4HANA applications using web-based access.<BR /> <BR /> Your <STRONG>app's users demand short end-to-end response times</STRONG> to work efficiently. For each user interaction of your web application, you can break down its end-to-end response time into three main contributors:<BR /> <OL><BR /> <LI>Front end (web browser or native mobile)</LI><BR /> <LI>Network</LI><BR /> <LI>Back end (for SAP S/4HANA web applications this is further subdivided into the ABAP business logic and the SAP HANA database persistency)</LI><BR /> </OL><BR /> You need reliable measurements on these components to assess a dialog step's duration. (Some user interactions may be handled exclusively on the front end. These front-end-only steps do not have any contributions from network and back end.) Most user interactions in Online Transaction Processing (OLTP) applications have their end-to-end response times dominated by the front end plus the network contributions.<BR /> <BR /> Another relevant aspect of your web application's performance is its back-end resource consumption. Here the challenge is that one user interaction triggers an unpredictable number of HTTP roundtrips into the back end. They must be identified and aggregated to get dependable data on consumed hardware resources like CPU time or main memory.<BR /> <BR /> In my previous blog post <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">Measure your Application’s Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A> I have described the statistics records collected by the ABAP kernel and I have explained how you use my transaction <CODE>STATS</CODE> to display and interpret the relevant statistics records. I have also mentioned some limitations of the statistics records, especially that they focus on server response time and that they correspond to individual tasks executed in the ABAP back end.<BR /> <BR /> In this blog post I explain how front-end statistics records fill these gaps and how my <STRONG>transaction <CODE>STATS_FE</CODE> gives you a complete end-to-end picture of the performance and scalability of your web application</STRONG>. You can use <CODE>STATS_FE</CODE> since SAP NetWeaver 7.56. I am continuously improving it and this blog post presents the tool’s state for SAP NetWeaver 7.57 as of late January 2022.<BR /> <H1 id="toc-hId-831330913">What are Front-End Statistics Records?</H1><BR /> SAP's most important UI frameworks (SAP GUI for HTML, SAPUI5, and Web Dynpro ABAP) have been equipped to take performance-related measurements on front-end devices. Client-specific performance information is collected per user interaction. Even some---but not all---of the previously mentioned front-end-only steps (user interactions without associated HTTP requests) trigger the logging of front-end statistics. At the end of a user interaction the gathered data is assembled into a front-end statistics records which will subsequently be sent into the ABAP back end.<BR /> <BR /> The available meta data<BR /> <UL><BR /> <LI>identify the application and the user interaction step,</LI><BR /> <LI>indicate the front end's operating system, and the HTML browser with its version,</LI><BR /> <LI>specify the UI framework,</LI><BR /> <LI>establish the relation with the back-end statistics records that correspond to the HTTP requests.<BR /> (In my <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">blog post on <CODE>STATS</CODE></A>, they were simply called statistics records. From now on I will use the more precise terms back-end or main statistics record.)</LI><BR /> </UL><BR /> Time durations are available for<BR /> <UL><BR /> <LI>end-to-end response time<BR /> difference between the start and end times of the user interaction, as determined by the UI framework</LI><BR /> <LI>client navigation time<BR /> sum of all HTTP request’s navigation times, corrected for overlaps</LI><BR /> <LI>client round trip time<BR /> sum of all client-side HTTP request durations, corrected for overlaps</LI><BR /> <LI>client processing time<BR /> calculated as end-to-end response time – client navigation time – client round trip time</LI><BR /> <LI>back-end request time<BR /> sum of all client-side HTTP request durations, measured on the front end</LI><BR /> <LI>server response time<BR /> sum of all server-side HTTP request durations, measured on the back end and sent to the front end with the HTTP response</LI><BR /> <LI>network time<BR /> sum of all differences (client-side HTTP request durations – server-side HTTP request durations)</LI><BR /> </UL><BR /> KPIs related to data transfer include<BR /> <UL><BR /> <LI>number of HTTP requests</LI><BR /> <LI>amount of data sent</LI><BR /> <LI>amount of data received</LI><BR /> <LI>a flag to indicate whether HTTP requests were compressed</LI><BR /> </UL><BR /> As I have stressed in my <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">previous post</A> the "value of your performance analysis depends on the quality of the underlying measurements. While the collection of data into the statistics records is performed autonomously by the SAP kernel, <STRONG>you need some preparation</STRONG> to ensure that the captured information accurately reflects the performance of the application." This continues to hold, and you should take the same preparatory steps as mentioned there.<BR /> <H1 id="toc-hId-634817408">How Do You Analyze Front-End Statistics Records?</H1><BR /> To view the front-end statistics records related to an execution of your web application <STRONG>you run SAP GUI transaction <CODE>STATS_FE</CODE></STRONG> in the ABAP system that acts as the back end for your web application's execution. On the start screen (Fig. 1) <STRONG>you specify criteria for the subset of front-end statistics records</STRONG> you want to analyze. The filter criteria are subdivided into four areas.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2022/01/STATS_FE_StartScreen.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 1:</EM></STRONG> On the <CODE>STATS_FE</CODE> start screen, you define filter conditions for the subset of front-end statistics records you want to analyze, specify from where the records are retrieved, and select the layout of the data display.</P><BR /> You determine the <STRONG><EM>Monitoring Interval</EM></STRONG> in the topmost area. By default, it extends 10 minutes into the past and 1 minute into the future. Records written during this period are displayed if they fulfill the conditions specified in the other areas of the start screen. You want <CODE>STATS_FE</CODE> to show as few unrelated records as possible. Therefore, you adjust this interval based on the start and end times of your application's execution.<BR /> <BR /> You define additional criteria that the records must meet in the&nbsp;<STRONG><EM>Record Filter</EM></STRONG> area. Be as specific and restrictive as possible, so that only records relevant for your investigation will be displayed. Particularly helpful are client and user. If you want to focus on expensive user interactions in your web application, you can specify lower thresholds for measurement data, such as end-to-end response time or number of network roundtrips. The other conditions support advanced analyses and comparisons.<BR /> <BR /> By default, statistics records are read from all application server instances of the system. In the <STRONG><EM>Configuration</EM></STRONG> section, you can change this to the local instance, or to any subset of instances within the current system. Restricting the statistics records retrieval to the instance (or instances) where the application was executed shortens the runtime of <CODE>STATS_FE</CODE>. The option <EM>Include Statistics Records&nbsp;</EM><EM>from Memory</EM> is selected by default, so that <CODE>STATS_FE</CODE> will also process records that have not yet been flushed from the memory buffer into the file system.<BR /> <BR /> Under&nbsp;<STRONG><EM>Display Layout</EM></STRONG>, select how the associated subset of key performance indicators (KPIs)—the captured data—will be arranged in the tabular display of front-end statistics records. The pre-selected layout shows all KPIs from the front-end statistics records and the most important aggregated KPIs of the associated back-end statistics records.<BR /> <H1 id="toc-hId-438303903">What do You Learn from Front-End Statistics Records?</H1><BR /> Fig. 2 shows the list of front-end statistics records based on the settings specified in the <CODE>STATS_FE</CODE> start screen (Fig. 1).<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2022/01/STATS_FE_RecordDisplay.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 2:</EM></STRONG> Front-end statistics records matching the criteria specified on the <CODE>STATS_FE</CODE> start screen (Fig. 1). The list shows front-end statistics records that correspond to the creation of a sales order with SAP S/4HANA application F3893.</P><BR /> The table displays the selected front-end statistics records in chronological order and contains their main KPIs. The header columns—shown with a blue background—uniquely link each record to the corresponding user interaction. The data columns contain the KPIs that indicate the performance of the user interactions. These columns are subdivided into two groups: Those with a gray background show the performance-related measurements taken on the front end. They are the true front-end statistics records. The columns with the yellow background cover the most important aggregated KPIs of the associated back-end statistics records.<BR /> Measurements for times and durations are given in milliseconds (ms). Memory consumptions and data transfers are measured in kilobytes (KB).<BR /> <BR /> The table of statistics records is displayed within an ALV grid control and inherits all functions of this SAP GUI tool. To access them, expand the toolbar by clicking on the <EM>Show Standard ALV Functions</EM>&nbsp;button (the black triangle that points to the right).<BR /> <BR /> The <EM>End-to-End Response Time</EM> is split into <EM>Client Navigation Time</EM>,&nbsp;<EM>Client Round Trip Time</EM>, and <EM>Client Processing Time</EM>. This breakdown tells you if a slow user interaction suffers from technical problems to start the first HTTP request, in which case <EM>Client Navigation Time</EM> would be high. A large <EM>Client Processing Time</EM> typically indicates that the interpretation or rendering of the HTTP requests takes too long. Slow HTTP requests show up as high <EM>Client Round Trip Time</EM>. This KPI takes into account if HTTP requests overlap. The related KPI <EM>Server Request Time</EM> does not apply such a correction, but simply adds the individual request's durations. HTTP requests can be slow because their processing in the back end takes too much time, or because the network communication is too slow. This latter case is indicated by a high <EM>Total Network Time</EM>.<BR /> For most dialog steps in SAP S/4HANA applications, users expect an <EM>End-to-End Response Time</EM> below 1 s. To reliably achieve this, <EM>Client Navigation Time </EM>plus <EM>Client Processing Time </EM>shall be below 300 ms, and <EM>Total Network Time</EM> in a wide area network must not exceed 350 ms. The remaining 350 ms are available for back-end processing.<BR /> <BR /> Further data on the communication between front end and back end, are the <EM>Network Roundtrips, </EM>and the transferred amount of data, split into <EM>Sent Data </EM>and <EM>Received Data</EM>. The <EM>Compressed</EM> flag is blank if there is at least one uncompressed response body with size above 1 KB.<BR /> To achieve an <EM>End-to-End Response Time</EM> less than 1 s a user interaction must not trigger more than two non-overlapping synchronous roundtrips, and ideally does not transfer more than 10 kB of data.<BR /> <BR /> For each front-end statistics record, <CODE>STATS_FE</CODE> finds the associated main statistics records and aggregates their most important KPIs: Durations are summed; for memory consumptions, the maximum is determined. The values (together with the number of detected main records in column <EM>Count of Main Records</EM>) are displayed with a yellow background. With these measurements you can assess the user interaction's overall resource consumption in the back end.<BR /> As a rule of thumb, a simple dialog step (expected <EM>End-to-End Response Time</EM> below 1 s) shall use less than 350 ms <EM>ABAP CPU Time</EM> and less than 150 ms <EM>HANA CPU Time</EM>.<BR /> <BR /> You might expect that <EM>Network Roundtrips </EM>always equals <EM>Count of Main Records</EM>, but the front-end statistics may include requests that have been handled by the browser cache, or requests that were sent to other back ends than the one where you run <CODE>STATS_FE</CODE>, or requests that serve generic purposes not directly relevant to the application's business objective. On the other hand, the back end may internally trigger tasks (e.g., RFCs, UPDATEs) resulting in separate main statistics records. Therefore, deviations in both directions are possible. Front-end statistics for which <EM>Network Roundtrips</EM> equals zero indicate front-end-only steps.<BR /> <BR /> Based on this list of front-end statistics records <STRONG>you identify and focus on user interactions that do not meet expectations</STRONG>---either because they are too slow or because they require too many resources.<BR /> <BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2022/01/STATS_FE_MainRecordDisplay.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 3:</EM></STRONG> Main statistics records associated with the seventh front-end statistics record from Fig. 2.</P><BR /> Double-clicking an entry in the list of front-end statistics records takes you to transaction <CODE>STATS</CODE> and there displays the main statistics records associated with the user interaction (Fig. 3). You analyze this set of back-end statistics records as describe in my <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">STATS blog post</A> to understand the back end performance and resource consumption of all activities that were triggered by the user interaction represented by the chosen front-end statistics record and that were handled by the ABAP system where you currently work with transactions <CODE>STATS_FE</CODE> and <CODE>STATS</CODE>.<BR /> <H1 id="toc-hId-241790398">Conclusions</H1><BR /> Front-end statistics records contain performance-related data for user interactions on front-end devices. They are collected by SAP's most frequently used UI frameworks and then sent into the ABAP back end. There you can use the <STRONG>Front End Performance Monitor (transaction <CODE>STATS_FE</CODE>)</STRONG> to <STRONG>select, display, and analyze the front-end statistics records related to your application</STRONG>. As developer or operator, you use this tool to assess the contributions to the end-to-end response time of user interactions in web applications whose performance you want to ensure. The integration of the main statistics records and the coupling with transaction <CODE>STATS</CODE> enables the simultaneous evaluation of the resource consumption in the back end.<BR /> <BR /> <CODE>STATS_FE</CODE> supports a <STRONG>holistic end-to-end view on the performance, resource consumption, and scalability of web applications</STRONG>. Starting with the set of front-end statistics records of a complete business process, you obtain the overall resource consumption, and you identify the critical user interactions. Focusing on them you understand which component (front end, network, or back end) is the bottle neck. If you conclude that this is the back end, a drill-down into the associated main statistics records will get you even closer to the root cause.<BR /> <H1 id="toc-hId-45276893">Disclaimer</H1><BR /> The statistics records (front-end as well as back-end) constitute measurements and therefore can have neither absolute precision nor absolute accuracy. To improve reliability and confidence in the data, reduce the impact of variability with an increased sample size (i.e., take averages of multiple measurements), and detect conceivable bias by comparing with data from other tools.<BR /> <H1 id="toc-hId--151236612">References</H1><BR /> You find an introduction to statistics records and transaction <CODE>STATS</CODE> in my blog post <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">Measure your Application’s Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A>.<BR /> <BR /> I have published an SAPinsider article on transaction <CODE>STATS</CODE>:<BR /> <A href="https://sapinsider.org/identifying-performance-problems-in-abap-applications/" target="_blank" rel="noopener nofollow noreferrer">Identifying Performance Problems in ABAP Applications</A> 2022-01-27T11:40:54+01:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-basic-use/ba-p/13554382 ST05: Basic Use 2023-02-24T12:24:31+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 This is the first blog post in a series of posts that cover my SAP GUI transaction <CODE>ST05</CODE>. Here, I show the straightforward use of the tool to get you started for ad hoc performance analyses of your business applications.<BR /> <P style="overflow: hidden;margin-bottom: 0px">If you have not yet done so, please read the introductory post <A href="https://blogs.sap.com/?p=1688270" target="_blank" rel="noopener noreferrer">Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources</A>. There, I explain how my transactions <CODE>STATS</CODE> and <CODE>STATS_FE</CODE> help you to detect performance bugs in your applications. That post also introduces <CODE>ST05</CODE> as an essential analysis tool to find root causes for applications that are too slow or consume too many resources. In particular, it captures and logs communications and data transfers between the ABAP work process and external components. By default, these transmissions are not recorded to avoid the associated overhead.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">You start the <EM>Performance Trace</EM> (sometimes also called <EM>Performance Analysis</EM>) with transaction code <CODE>ST05</CODE>. On its start screen, in area <EM>Select Trace Type</EM> (Fig. 1), mark the options that correspond to the types of communication you need to analyze. This choice shall correspond to the critical interfaces identified by previous measurements of the application under investigation, e.g., with transactions <CODE>STATS</CODE> or <CODE>STATS_FE</CODE>.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/02/ST05_BasicUse_StartScreen_TraceOff.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG><EM>Figure 1</EM>:</STRONG> In area <STRONG>Select Trace Type</STRONG> on the <CODE>ST05</CODE> start screen, you mark the relevant trace types. Determine whether the ABAP call hierarchy shall be recorded in section <STRONG>Configure Trace</STRONG>. Then switch on tracing on the local application server instance by clicking <STRONG>Activate Trace</STRONG>. The <STRONG><EM>Trace State</EM></STRONG> panel displays the current settings.</P><BR /> <P style="text-align: left"><CODE>ST05</CODE> supports <SPAN data-usefontface="false" data-contrast="none">seven communication interfaces across which the ABAP work process can exchange information with external components. They are listed in Table 1.<BR /> </SPAN></P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse;border-style: none" border="0" cellpadding="0"><CAPTION><STRONG>Table 1:</STRONG> Trace types covered by <CODE>ST05</CODE>.</CAPTION><BR /> <TBODY><BR /> <TR><BR /> <TD style="width: 16.56%">SQL<BR /> Buffer<BR /> <SPAN data-usefontface="false" data-contrast="none">Enqueue<BR /> </SPAN><SPAN data-usefontface="false" data-contrast="none">RFC<BR /> </SPAN><SPAN data-usefontface="false" data-contrast="none">HTTP<BR /> </SPAN><SPAN data-usefontface="false" data-contrast="none">APC<BR /> </SPAN><SPAN data-usefontface="false" data-contrast="none">AMC&nbsp;</SPAN></TD><BR /> <TD style="width: 83.44%">DB accesses<BR /> <SPAN data-usefontface="false" data-contrast="none">calls to buffered objects handled by the application server’s buffers<BR /> set or release SAP business locks (enqueues)<BR /> remote function calls<BR /> HTTP(S) communication<BR /> WebSocket communication<BR /> message exchange via publish/subscribe channels</SPAN></TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> <P style="text-align: left">The most common trace type (pre-selected by default) is the <EM>SQL Trace</EM>. It addresses communication with the database server. A more appropriate name would be <EM>DB Trace</EM>, because only SQL statements sent to the database will be recorded. To capture SQL statements handled by the table buffer in the ABAP application server instance you must mark option <EM>Buffer Trace</EM>.<BR /> In the <EM>Configure Trace</EM> area you can decide whether relevant communication activities shall be recorded together with their triggering ABAP call hierarchy (<EM>Stack Trace</EM> = <CODE>On</CODE>). During subsequent trace analysis, this is especially helpful for events encapsulated within and called via generic technical frameworks. As a developer of a specific business application's coding you can do little to improve the immediate invocation of the event, but you are obliged to optimize your call to the framework. This call's source code is accessible by the ABAP call stack. If you set <EM>Stack Trace</EM> = <CODE>Off</CODE>&nbsp;(default in customer systems), only the immediate caller will be recorded.</P><BR /> To start tracing, click button <EM>Activate Trace</EM>. This switches on the trace recording only on the local ABAP application server instance, and exclusively for the current user. <SPAN class="TextRun BCX0 SCXP20094057" lang="EN-US" lang="EN-US" data-usefontface="false" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP20094057">Activities on other instances or by other users are not traced. </SPAN></SPAN>Area <EM>Trace State</EM> indicates the date and time of the last change, and the name of the user who did the change (Fig. 2). It also shows the active trace types and the name of the user whose activities are traced. (With the current method to activate tracing, this is your user's name.)<BR /> <SPAN data-usefontface="false" data-contrast="none">If recording is already active on the instance, you cannot start another recording. You must wait until the other user ends the recording.</SPAN><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/02/ST05_BasicUse_StartScreen_TraceOn.png" /></P><BR /> <P class="image_caption" style="font-style: italic;text-align: left"><STRONG><EM>Figure 2</EM>:</STRONG> On the <CODE>ST05</CODE> start screen, the <STRONG>Trace State</STRONG> area indicates the current situation on the local application server instance. When the process under investigation has finished, <STRONG>Deactivate Trace</STRONG>. Then click <STRONG>Display Trace</STRONG> to work on the records.</P><BR /> Execute the process in the normal way. You must ensure that it runs for the same back-end user who activated tracing, and that it gets executed on the application server instance where you have switched on the recording.<BR /> <P style="overflow: hidden;margin-bottom: 0px">Once the application has completed, return to the <CODE>ST05</CODE> start screen (Fig. 2). Switch off the recording by clicking <EM>Deactivate Trace</EM>. To start the analysis, click button <EM>Display Trace</EM>. This takes you to the <EM>Filter Conditions for Trace Records </EM>(Fig. 3). There you can specify restrictions on the subset of captured trace records to be examined. The appropriate filter conditions are pre-populated as much as possible with values that correspond to the previous activate - deactivate cycle. This applies in particular to the <EM>Trace Types</EM>, and to the <EM>Trace Period</EM>, which starts at the time of the last trace activation and ends at the time of the last trace deactivation.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/02/ST05_BasicUse_FilterConditions.png" /></P><BR /> <P class="image_caption" style="font-style: italic;text-align: left"><STRONG><EM>Figure 3</EM>:</STRONG> Define filter conditions for trace records to be displayed and analyzed. Entries in areas <STRONG>Trace Types</STRONG> and <STRONG>Trace Period</STRONG> are prefilled with data matching the previous trace recording. With entries in section <STRONG>Trace Filter</STRONG>, you can concentrate on a subset of the trace with specific properties.</P><BR /> In the <EM>Configuration</EM> area, you may overrule the default to work on trace records only from the <EM>Local</EM> application server instance. Alternatives are all <EM>Active</EM> instances, or an <EM>Individual</EM> subset of all application server instances. (Recall that the click on <EM>Activate Trace</EM> records only on the local instance.) Due to load balancing, after a new logon you might be working on another application server instance. If you know the instance where your trace was recorded, choose it from the <EM>Instance Selection</EM> popup that comes up after clicking <EM>Individual</EM>.<BR /> The option <EM>Max. Number of Records</EM> guards against traces with an unexpectedly large number of records. A popup will indicate when the given number of records has been read and processed. You can then decide whether you want to continue or abort. The default value is 5000 records. The system will remember your most recent value. You may also set your personal default with user profile parameter <CODE>ST05_MAX_REC_NUMBER</CODE>.<BR /> <BR /> In area <EM>Trace Filter</EM> you may set restrictions (Tab. 2) to focus your attention on particular details. This is helpful in exceptional cases, but rarely used. Ensure that you do not suppress important information by applying a filter that is too restrictive. Also be aware that it might interfere with displaying the ABAP call stack.<BR /> <TABLE style="height: 202px;width: 100%;border-collapse: collapse;border-style: solid" border="0"><BR /> <TBODY><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun BCX0 SCXP166778655" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP166778655">Trace Types </SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP74790722 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP74790722 BCX0">Select the trace types you want to analyze.</SPAN></SPAN><SPAN class="EOP SCXP74790722 BCX0">​</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 10px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM>Trace Period</EM></TD><BR /> <TD style="width: 69.6%;height: 10px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP230032492 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP230032492 BCX0">After recording a trace, the default time interval extends from the time when the trace recording was started until it was ended.<BR /> For previously recorded traces, specify the time interval manually.</SPAN></SPAN><SPAN class="EOP SCXP230032492 BCX0">​</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0">Client </SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0">Client where the traced activity was executed.</SPAN></SPAN><SPAN class="EOP SCXP148981702 BCX0">​</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0">User Name</SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"> <SPAN class="TextRun SCXP72417636 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP72417636 BCX0">Name of the user who executed the traced activity.</SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 10px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0">Object Name</SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 10px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"> <SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0">Name of the object that was accessed.<BR /> (SQL, BUF: table or view; ENQ: lock object;<BR /> RFC: function; <SPAN data-contrast="none">HTTP, APC: path; AMC: channel ID)</SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="vertical-align: top;width: 31%;border-style: solid;text-align: left;height: 14px"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun BCX0 SCXP139324481" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP139324481">Duration [Microsecs]</SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;vertical-align: top;border-style: solid;text-align: left;height: 14px"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP212781920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP212781920 BCX0">Elapsed execution time of the operation in microseconds (µs).</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">Executed Operation </SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">Operation that was executed.</SPAN></SPAN><SPAN class="EOP SCXP61426920 BCX0">​</SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">Database Connection Name</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Database connection that was used to access the data.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">Database Connection ID</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Database connection ID used to process the statement.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR><BR /> <TD style="vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">Work Process Type</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Type of the work process that executed the traced activity.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">Work Process ID</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Number of the work process that executed the traced activity.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">Transaction ID</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">GUID that designates an SAP LUW.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">EPP Root Context ID</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">The extended passport (EPP) correlates requests in complex business processes throughout the system landscape.<BR /> The root context ID identifies the initial context.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">EPP Connection ID</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">The connection ID distinguishes involved remote destinations.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 31%;border-style: solid;text-align: left"><EM><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><I><SPAN data-contrast="none">EPP Connection Counter</SPAN></I></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></EM></TD><BR /> <TD style="width: 69.6%;height: 14px;vertical-align: top;border-style: solid;text-align: left"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">The connection counter enumerates multiple calls that reuse a connection.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> </TBODY><BR /> <CAPTION><EM><STRONG>Table 2:</STRONG> Filter conditions for the display of trace records.</EM></CAPTION></TABLE><BR /> <P style="overflow: hidden;margin-bottom: 0px">When you execute, the available trace records that meet the filter conditions are retrieved, handled, and displayed in an ALV grid control. The standard trace display (Fig. 4) is a chronologically sorted list of main records, each corresponding to one execution of an ABAP statement. (The processing of the statements in your application’s ABAP source code may involve several contributing operations that are captured as individual, detailed records in a trace. For the list of <EM>Trace Main Records</EM>, <CODE>ST05</CODE> attempts to aggregate all these detailed records so that ideally there is a one-to-one correspondence between list entries and implemented ABAP statements. Individual records that cannot be aggregated are collected into dummy main records with the S<EM>tatement</EM> set to <I>OTHER (&lt;</I><I>trace_type</I><I>&gt;) </I>and empty <EM>Start Time</EM>.) All types of trace records are shown in one common table, using only those fields that are relevant for the respective record's type, and leaving the others empty.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/02/ST05_BasicUse_MainRecords.png" /></P><BR /> <P class="image_caption" style="font-style: italic;text-align: left"><STRONG>Figure 4:</STRONG> In the ALV list of <STRONG>Trace Main Records</STRONG>, each entry reflects one execution of an ABAP statement calling an external resource, or the processing of an incoming request.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">Table 3 documents the fields that are visible by default.</P><BR /> <BR /> <TABLE style="height: 447px;width: 100%;border-collapse: collapse;border-style: solid" border="1"><BR /> <TBODY><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 10px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Start Time</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 10px;vertical-align: top;border-style: solid">S<SPAN data-contrast="none">tart time of the event in the user’s time zone.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Duration</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Elapsed execution time of the event in microseconds (µs).<BR /> (Measured by the ABAP work process.)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><EM>CPU Time</EM></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid">CPU time <SPAN data-contrast="none">in microseconds (µs)</SPAN> used during the statement's execution.<BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records on SAP HANA.</SPAN></SPAN>)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><EM>Memory</EM></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid">Maximum memory consumption in kilobytes (kB) during the statement's execution.<BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records on SAP HANA.</SPAN></SPAN><SPAN class="EOP SCXP8895558 BCX0">​</SPAN>)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Records</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Number of records affected by the event.<BR /> (SQL, BUF: number of table or view rows;<BR /> ENQ: number of lock granules)<BR /> (<SPAN class="TextRun SCXP94104991 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP94104991 BCX0">Not for RFC, HTTP, APC, and AMC trace records.</SPAN></SPAN><SPAN class="EOP SCXP94104991 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Program Name</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Name of the ABAP program that called the event.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Object Name</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Name of the object that was accessed.<BR /> (SQL, BUF: table or view; ENQ: lock object;<BR /> RFC: function; HTTP, APC: path; AMC: channel ID)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Statement</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Edited statement.<BR /> (SQL: field list and </SPAN><SPAN data-contrast="none">FROM</SPAN><SPAN data-contrast="none"> clause removed, variable names replaced by values)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">DB Cursor</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Number of the cursor used for the operation.<BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records.</SPAN></SPAN><SPAN class="EOP SCXP8895558 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">SQL Statement Hash</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Hash value of the SQL statement.<BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records on SAP HANA.</SPAN></SPAN><SPAN class="EOP SCXP8895558 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Array</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Maximum number of records that can be transferred from the database to the ABAP work process within one communication package.<BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records.</SPAN></SPAN><SPAN class="EOP SCXP8895558 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Connection Name</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Name of the logical database connection (default = R/3).<BR /> (<SPAN class="TextRun SCXP224852523 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP224852523 BCX0">Only for SQL trace records.</SPAN></SPAN><SPAN class="EOP SCXP224852523 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">User Name</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Name of the user who executed the event.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">Client</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Client where the event was executed.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 190.518px;border-style: solid"><I><SPAN data-contrast="none">WP Type</SPAN></I></TD><BR /> <TD style="width: 427.435px;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Type of the work process that executed the event.</SPAN></TD><BR /> </TR><BR /> </TBODY><BR /> <CAPTION><EM><STRONG>Table 3:</STRONG> Fields in the default layout of the list of trace main records.</EM></CAPTION></TABLE><BR /> Every trace record contains the abbreviated statement, focussing on the parts with an impact on performance, and the object accessed by the statement. Also available is the calling program, and some details on how the statement was processed. The <EM>Duration</EM> (in microseconds; μs) or the number of affected table rows (<EM>Records</EM>) are likely the most relevant values for judging performance. If your system is based on the SAP HANA database, SQL trace records include measurements for the <EM>CPU Time</EM> and for the <EM>Memory Consumption</EM>&nbsp;on the database server, and identify the statement with its <EM>SQL Statement Hash</EM>.<BR /> <BR /> The second header line at the top of the list summarizes the visible trace records by showing totals for <I><SPAN data-contrast="none">Duration</SPAN></I>, <EM>CPU Time</EM>, and <I><SPAN data-contrast="none">Records,</SPAN></I> and the maximum for <EM>Memory Consumption</EM>. Note that the total <I><SPAN data-contrast="none">Duration</SPAN></I> is not necessarily related to the application's elapsed time. In the example of Fig. 4, the incoming HTTP request triggered SQL statements which were executed during the HTTP request's duration. Thus, the total <I><SPAN data-contrast="none">Duration</SPAN></I> may overestimate the elapsed time.<BR /> <BR /> Further fields (listed in Table 4) may be shown by customizing the ALV grid control's layout.​<BR /> <TABLE style="height: 447px;width: 100%;border-collapse: collapse;border-style: solid" border="1"><BR /> <TBODY><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 10px;vertical-align: top;width: 30.88%;border-style: solid"><I><SPAN data-contrast="none">Start Date</SPAN></I></TD><BR /> <TD style="width: 68.8%;height: 10px;vertical-align: top;border-style: solid">S<SPAN data-contrast="none">tart date of the event in the user’s time zone.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 30.88%;border-style: solid"><EM>Instance</EM></TD><BR /> <TD style="width: 68.8%;height: 14px;vertical-align: top;border-style: solid">Application server instance <SPAN data-contrast="none">where the event was executed.</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 30.88%;border-style: solid"><EM>Processing Time</EM></TD><BR /> <TD style="width: 68.8%;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">Elapsed execution time of the event in microseconds (µs).</SPAN><BR /> (<SPAN class="TextRun SCXP8895558 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP8895558 BCX0">Only for SQL trace records on SAP HANA.</SPAN></SPAN>)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 30.88%;border-style: solid"><EM>Transaction Code</EM></TD><BR /> <TD style="width: 68.8%;height: 14px;vertical-align: top;border-style: solid"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Name of the transaction that triggered the traced activity.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 30.88%;border-style: solid"><I><SPAN data-contrast="none">DB connection ID</SPAN></I></TD><BR /> <TD style="width: 68.8%;height: 14px;vertical-align: top;border-style: solid"><SPAN data-contrast="none">ID of the logical database connection.<BR /> (<SPAN class="TextRun SCXP224852523 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP224852523 BCX0">Only for SQL&nbsp; trace records.</SPAN></SPAN><SPAN class="EOP SCXP224852523 BCX0">​</SPAN>)</SPAN></TD><BR /> </TR><BR /> <TR style="border-style: solid"><BR /> <TD style="height: 14px;vertical-align: top;width: 30.88%;border-style: solid"><I><SPAN data-contrast="none">WP ID</SPAN></I></TD><BR /> <TD style="width: 68.8%;height: 14px;vertical-align: top;border-style: solid"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">Number of the work process that executed the traced activity.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="vertical-align: top;width: 30.88%;border-style: solid;height: 14px"><I><SPAN data-contrast="none">Transaction ID</SPAN></I></TD><BR /> <TD style="width: 68.8%;vertical-align: top;border-style: solid;height: 14px"><SPAN data-contrast="none"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">The transaction GUID designates an SAP LUW.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="height: 28px"><BR /> <TD style="vertical-align: top;width: 30.88%;border-style: solid;height: 28px"><I><SPAN data-contrast="none">EPP Root Context ID</SPAN></I></TD><BR /> <TD style="width: 68.8%;vertical-align: top;border-style: solid;height: 28px"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0"><SPAN data-contrast="none">The extended passport (EPP) correlates requests in complex business processes throughout the system landscape.<BR /> The root context ID identifies the initial context.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="vertical-align: top;width: 30.88%;border-style: solid"><I><SPAN data-contrast="none">EPP Connection ID</SPAN></I></TD><BR /> <TD style="width: 68.8%;vertical-align: top;border-style: solid"><SPAN data-contrast="none"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">The connection ID distinguishes involved remote destinations.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> <TR style="height: 28px"><BR /> <TD style="vertical-align: top;width: 30.88%;border-style: solid;height: 28px"><I><SPAN data-contrast="none">EPP Connection Counter</SPAN></I></TD><BR /> <TD style="width: 68.8%;vertical-align: top;border-style: solid;height: 28px"><SPAN data-contrast="none"><SPAN class="TextRun SCXP148981702 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP148981702 BCX0"><SPAN class="TextRun SCXP158498109 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP158498109 BCX0"><SPAN class="TextRun SCXP61426920 BCX0" lang="EN-US" lang="EN-US" data-contrast="none"><SPAN class="NormalTextRun SCXP61426920 BCX0">The connection counter enumerates multiple calls that reuse a connection.</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></TD><BR /> </TR><BR /> </TBODY><BR /> <CAPTION><EM><STRONG>Table 4:</STRONG> Further fields for the list of trace main records, available on demand by changing the ALV grid control's default layout.</EM></CAPTION></TABLE><BR /> The list of main records helps you to judge the choreography of executed statements. In particular, it answers the question: Which event was executed when and where? This may allow you to conclude that statements are executed although they do not contribute anything to your application's business logic. These <STRONG>superfluous statements slow down your application, and at the same time waste precious resources</STRONG>. You must eliminate them. In my follow-up blog post <A href="https://blogs.sap.com/2023/05/17/st05-aggregate-trace-records/" target="_blank" rel="noopener noreferrer">ST05: Aggregate Trace Records</A>, I present an easy and reliable method to find these unnecessary statements in a trace and in your application's ABAP source code.<BR /> For the remaining essential events, you <STRONG>focus on the statements that have a long <EM>Duration</EM>, affect many <EM>Records</EM>, or consume a lot of HANA hardware resources (<EM>CPU Time</EM>, <EM>Memory</EM>)</STRONG>. <STRONG>They offer the largest optimization potential</STRONG>. The sequel blog post quoted above also discusses how to identify statements that would benefit the most from tuning. In my most recent blog post&nbsp;<A href="https://blogs.sap.com/2023/06/30/st05-analyze-individual-trace-records/" target="_blank" rel="noopener noreferrer">ST05: Analyze Individual Trace Records</A> I describe their in-depth analysis.<BR /> <H1 id="toc-hId-833025404">Summary</H1><BR /> <SPAN style="font-size: 1rem">Getting started with <CODE>ST05</CODE> is really easy and takes only a few clicks. Just start the tool, and click button <EM>Activate Trace</EM>. Then execute the application you want to analyze. When it has finished, return to <CODE>ST05</CODE> and click button <EM>Deactivate Trace</EM>. Finally, click <EM>Display Trace</EM> and execute to evaluate the trace records. The analysis of the trace records will discover hot spots and bottlenecks of your application related to its communications with external resources. The most important caveat is that <STRONG>all steps have to be done on the same application server instance and by the same back-end user</STRONG>.</SPAN> 2023-02-24T12:24:31+01:00 https://community.sap.com/t5/technology-blogs-by-sap/use-st05-to-analyze-the-communication-of-the-abap-work-process-with/ba-p/13553712 Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources 2023-02-24T12:27:16+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 In my previous blog posts <EM><A class="ds-link ds-link--blue ds-relatedContent__item-text" title="Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS" href="https://blogs.sap.com/?p=1445441" target="_blank" rel="noopener noreferrer">Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A></EM> and <EM><A class="ds-link ds-link--blue ds-relatedContent__item-text" title="Use Transaction STATS_FE to Analyze the Performance of your Web Application" href="https://blogs.sap.com/?p=1464978" target="_blank" rel="noopener noreferrer">Use Transaction STATS_FE to Analyze the Performance of your Web Application</A></EM>, I have put you as a software developer in charge of your business applications' performance. Here, <STRONG>performance encompasses end-to-end response time and scalability</STRONG>, which is impacted by your application's resource consumption. Users expect short response times and high business data throughput. To meet these non-functional requirements, you need <STRONG>tools to find root causes for poor performance</STRONG>.<BR /> <BR /> With my transaction <CODE>STATS_FE</CODE>, you break down your applications' end-to-end response times into three main contributors: front end, network, and back end. The ABAP back-end portion is covered by the ABAP kernel's main statistics records. You display and evaluate them with my transaction <CODE>STATS</CODE>. There, you might discover that an individual task in the back end is too slow or requires too many resources. Further, you might conclude that this is due to communication of the ABAP work process executing your applications' ABAP code with external resources - most prominently the database, but also remote servers accessed via RFC or HTTP calls, or other entities engaged through appropriate interfaces. Beyond this conclusion the back-end statistics records cannot be very helpful. They are a monitoring mechanism and a measurement tool, thus do not contain sufficient detail to identify or analyze root causes.<BR /> <BR /> To <STRONG>pin down bottlenecks</STRONG> and to <STRONG>derive efficient optimization approaches</STRONG>, you need <STRONG>a dedicated analysis tool that captures and logs the communication across the boundaries of the ABAP work process</STRONG>. This is the purpose of the <EM>Performance Trace</EM> (SAP GUI transaction <CODE>ST05</CODE>), which not only registers the communication with external entities via the relevant interfaces, but also enriches the corresponding records with measurement values (e.g., duration, resource consumption, amount of transferred data). <CODE>ST05</CODE> is the ABAP stack's interface trace tool. It captures events during application execution that leave a work process to request data or services from external resources, or that enter a work process to perform services for external callers. The set of the ensuing records is a trace of your applications' outgoing or incoming data transmissions.<BR /> <BR /> <STRONG><CODE>ST05</CODE> is a tool for the analysis of individual applications and their single user runtime behaviour.</STRONG> It investigates applications with respect to the resources they request from outside of the work process, and is also applicable to services provided for remote clients. <CODE>ST05</CODE> is not suitable for load or mass tests.<BR /> <BR /> The&nbsp; information obtained from <CODE>ST05</CODE> helps you to fulfill the expectations of your software's users or operators. It identifies hot spots in an application that may be due to ...<BR /> <UL><BR /> <LI>… expensive SQL statements</LI><BR /> <LI>… unnecessary accesses to the persistence layer</LI><BR /> <LI>… long running SAP locks (enqueues)</LI><BR /> <LI>… RFC or HTTP issues</LI><BR /> </UL><BR /> In contrast to the statistics records, which are always and autonomously recorded by the ABAP kernel, the ABAP work process' communications are traced only on demand. Otherwise the associated overhead may slow down applications in productive use too much.<BR /> <BR /> As I have already emphasized in my blog post <A class="ds-link ds-link--blue ds-relatedContent__item-text" title="Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS" href="https://blogs.sap.com/?p=1445441" target="_blank" rel="noopener noreferrer">Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A>, the value of your performance analysis depends on the quality of the underlying measurements. You need some <STRONG>preparation to ensure that the captured information accurately and reproducibly reflects the performance of the application</STRONG>. Only then can you derive reliable conclusions.<BR /> <OL><BR /> <LI>Confirm that the test system is configured and customized correctly.</LI><BR /> <LI>Verify that the test system is not under high load from processes running concurrently with your analyses.</LI><BR /> <LI>Carefully define the business scenario to be tested by your application. It must adequately represent the application’s behavior in production.</LI><BR /> <LI>Provide a set of test data that is representative of productive data. Only then will the scenario execution resemble everyday use.</LI><BR /> <LI>Execute the scenario a few times to fill the buffers and caches of all involved components (e.g., DB cache, application server’s table buffer, web browser cache). Without these pre-runs or warm-up runs, your recorded traces will not be reproducible, but will capture one-time or first-use effects like loading data into buffers and caches. This may lead you to incorrect diagnoses, or make it more difficult to identify the real issues. It is then much harder to draw reliable conclusions.</LI><BR /> </OL><BR /> After this preparation, you <STRONG>activate the trace recording</STRONG>, then <STRONG>execute the application</STRONG> (this is the measurement run), and afterwards <STRONG>deactivate the trace recording</STRONG>. Next <STRONG>display the trace</STRONG>. The subsequent evaluation of the trace records will identify hot spots and bottlenecks of your application that are caused by the communications and associated data transmissions of the ABAP work process with external resources.<BR /> <H1 id="toc-hId-832999240">List of Blog Posts on <CODE>ST05</CODE></H1><BR /> In a sequence of individual posts, I cover the main features of <CODE>ST05</CODE>, explain the necessary technical background, and share best practices for efficiently working with the tool.<BR /> <OL><BR /> <LI><A href="https://blogs.sap.com/?p=1689314&amp;preview=true&amp;preview_id=1689314" target="_blank" rel="noopener noreferrer">Basic Use</A><BR /> How do you work with the tool?</LI><BR /> <LI><A href="https://blogs.sap.com/2023/03/22/st05-technical-background-of-trace-recording-and-analysis/" target="_blank" rel="noopener noreferrer">Technical Background of Trace Recording and Analysis</A><BR /> What is the technology behind <CODE>ST05</CODE> and how does it affect its behaviour?</LI><BR /> <LI><A href="https://blogs.sap.com/2023/04/28/st05-trace-directory/" target="_blank" rel="noopener noreferrer">Trace Directory</A><BR /> How do you save and recover traces?</LI><BR /> <LI>Advanced Features of <CODE>ST05</CODE><BR /> <OL><BR /> <LI><A href="https://blogs.sap.com/2023/03/08/st05-activate-trace-recording-with-filter/" target="_blank" rel="noopener noreferrer">Activate Trace Recording with Filter</A><BR /> How can you control the trace recording?</LI><BR /> <LI><A href="https://blogs.sap.com/2023/05/17/st05-aggregate-trace-records/" target="_blank" rel="noopener noreferrer">Aggregate Trace Records</A><BR /> How do you aggregate related trace records to get a better overview?</LI><BR /> <LI><A href="https://blogs.sap.com/2023/06/30/st05-analyze-individual-trace-records/" target="_blank" rel="noopener noreferrer">Analyze Individual Trace Records</A><BR /> What can you learn about the processing of communication steps?</LI><BR /> </OL><BR /> </LI><BR /> </OL><BR /> Examples shown in these blog posts were recorded while running the transactional S/4HANA Fiori application F0997 (Audit Journal) from the Finance line of business in an internal test system. The test case displayed the changes for <EM>Company Code</EM> 1010 and <EM>Fiscal Year</EM> 2023.<BR /> <BR /> Transaction <CODE>ST05</CODE> is part of SAP_BASIS since decades. I am continuously improving it and in this series of blog posts I am presenting the tool's state for SAP NetWeaver 7.58 as of early 2023. Depending on your system's release, some of the features may not yet be available.<BR /> <H1 id="toc-hId-636485735">References</H1><BR /> I have published several articles in SAPinsider which are relevant to measuring and analyzing the performance of ABAP applications:<BR /> <UL><BR /> <LI>Manfred Mensch:<BR /> <B><A href="https://www.sap.com/documents/2023/06/7ea04aed-7a7e-0010-bca6-c68f7e60039b.html" target="_blank" rel="noopener noreferrer">Identifying Performance Problems in ABAP Applications: Analyze Statistics Records Using the Performance Monitor (Transaction STATS)</A></B></LI><BR /> <LI>Manfred Mensch:<B><BR /> <A href="https://www.sap.com/documents/2023/06/921720ec-7a7e-0010-bca6-c68f7e60039b.html" target="_blank" rel="noopener noreferrer">Track Down the Root of Performance Problems with Transaction ST05</A></B></LI><BR /> <LI>Manfred Mensch:<B><BR /> <A href="https://www.sap.com/documents/2023/06/c2ea4ded-7a7e-0010-bca6-c68f7e60039b.html" target="_blank" rel="noopener noreferrer">Pinpoint Performance Bottlenecks Using ABAP Profiling: Analyze Your Application with Transaction SAT</A></B></LI><BR /> </UL><BR /> The copyright to these three articles is with SAPinsider and they appear here with permission from the publisher.<BR /> <BR /> There are two previous blog posts related to <CODE>ST05</CODE>, based on an older SAP_BASIS release, but still useful:<BR /> <UL><BR /> <LI>Siegfried Boes:<STRONG><BR /> <A href="https://blogs.sap.com/2007/09/05/the-sql-trace-st05-quick-and-easy/" target="_blank" rel="noopener noreferrer">The SQL Trace (ST05) Quick and Easy</A></STRONG></LI><BR /> <LI>Randolf Eilenberger:<STRONG><BR /> <A href="https://blogs.sap.com/?p=101848" target="_blank" rel="noopener noreferrer">Code Inspector Integration into SQL Trace of ST05</A></STRONG></LI><BR /> </UL><BR /> Refer to my blog posts on transactions <CODE>STATS</CODE> and <CODE>STATS_FE</CODE>&nbsp;for measuring your application's end-to-end response time and resource consumption:<BR /> <UL><BR /> <LI>Manfred Mensch:<BR /> <STRONG><A class="ds-link ds-link--blue ds-relatedContent__item-text" title="Use Transaction STATS_FE to Analyze the Performance of your Web Application" href="https://blogs.sap.com/?p=1464978" target="_blank" rel="noopener noreferrer">Use Transaction STATS_FE to Analyze the Performance of your Web Application</A></STRONG></LI><BR /> <LI>Manfred Mensch:<STRONG><BR /> <A class="ds-link ds-link--blue ds-relatedContent__item-text" title="Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS" href="https://blogs.sap.com/?p=1445441" target="_blank" rel="noopener noreferrer">Measure your Application's Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A></STRONG></LI><BR /> </UL> 2023-02-24T12:27:16+01:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-activate-trace-recording-with-filter/ba-p/13560035 ST05: Activate Trace Recording with Filter 2023-03-08T10:22:35+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 This is the second blog post in my series of posts about SAP GUI transaction&nbsp;<CODE>ST05</CODE>. Here, I explain that you can control and customize the trace recording with filter conditions, and how this is useful for analyzing your applications’ performance. With a small case study I show this feature in action.<BR /> <BR /> In the introduction to the sequence of blog posts (<A href="https://blogs.sap.com/?p=1688270" target="_blank" rel="noopener noreferrer">Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources</A>) I have referred to my transactions <CODE>STATS</CODE>&nbsp;and&nbsp;<CODE>STATS_FE</CODE> as measurement tools, which help you to find performance hot spots in your applications. To identify root causes of poor performance (long response time or high resource consumption), you need dedicated analysis tools. With respect to communications and data transfers between the ABAP work process and external components, <CODE>ST05</CODE> is the analysis tool of choice. I have described the straightforward way of working with it in my previous post <A href="https://blogs.sap.com/?p=1689314&amp;preview=true&amp;preview_id=1689314" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A>. Be sure to read it for a quick review.<BR /> <P style="overflow: hidden;margin-bottom: 0px">The simplest way to switch on tracing involves the selection of the desired trace types, followed by a click on <EM>Activate Trace</EM>. Then trace recording is active only on the local ABAP application server instance and exclusively for the current user.&nbsp;<SPAN class="TextRun BCX0 SCXP20094057" lang="EN-US" lang="EN-US" data-usefontface="false" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP20094057">Activities on other instances or by other users are not captured.<BR /> Now imagine that you want to support co-workers with the performance analysis of their business application. Maybe they do not have authorization to run <CODE>ST05</CODE>, while you are not allowed to work with the application. Or you do not know ahead of time which of the system's application server instances will handle the back-end portion of the application—the system’s load balancer may dispatch incoming requests to any instance. Or you need to investigate a batch job that runs at night time, when you do not want to manually switch on or off the trace recording. Furthermore, within a trace type, i.e., for a particular communication interface of the ABAP work process, you might be interested only in a subset of all associated communication events. All these situations are not covered by the ordinary <EM>Activate Trace</EM>. This is where the option to&nbsp;<EM>Activate Trace with Filter</EM>&nbsp;(Fig. 1) comes in.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_ActivateFilter.png" /></SPAN></SPAN><EM><STRONG>Figure 1:</STRONG>&nbsp;Clicking button&nbsp;<STRONG>Activate Trace with Filter&nbsp;</STRONG>opens a&nbsp; popup with <STRONG>Conditions for Trace Recording</STRONG>. There you can override some of&nbsp;<CODE>ST05</CODE>’s defaults, or specify restrictions on the communication events to be captured. <STRONG>Scheduling</STRONG> the trace recording is convenient for the analysis of batch jobs that run while you are not in the office.<BR /> The running text explains all options in detail.</EM></P><BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px">With an entry in field&nbsp;<EM>User Name</EM>&nbsp;you can <STRONG>activate tracing for another user</STRONG>. Then her or his activities are recorded instead of yours. User name patterns with the asterisk&nbsp;<CODE>*</CODE>&nbsp;as a terminating wildcard character are supported.</P><BR /> To <STRONG>trace events originating from or handled by a non-local application server instance</STRONG> within the current system, expand the dropdown list box for the&nbsp;<EM>Instance</EM> field to see all active instances. The local instance is explicitly indicated. If you know the relevant instance, select it. Otherwise, to activate tracing on all instances, choose &lt;<CODE>ALL</CODE>&gt;. This tries to switch on tracing, but if it is already active for another user on an instance, the attempt fails for this instance. A popup will inform about this failure. The brute force option &lt;<CODE>ENFORCE</CODE>&gt; unconditionally terminates any tracing in progress on all instances and then activates trace recording per your conditions. Use this option sparingly and carefully. It is convenient and safe for you, but may be disturbing and annoying for your colleagues.<BR /> <BR /> With the group of fields&nbsp;<EM>Transaction Name</EM>,&nbsp;<EM>Program Name</EM>,&nbsp;<EM>RFC Function Name</EM>, or&nbsp;<EM>URL</EM>, you can <STRONG>limit the captured events to those that are triggered while executing a particular application</STRONG>. Note that this application must be at the very top of the call hierarchy. Therefore, a value can be given for at most one of the fields. Patterns with the asterisk <CODE>*</CODE> as a terminating wildcard are allowed.<BR /> <BR /> Occasionally, an application (most often a batch job) may occupy a work process for a very long time. With transaction <CODE>SM50</CODE> you can determine the work process’ number and then enter it into the <EM>Process Number</EM> field of the filter conditions popup. Thereby, you <STRONG>confine the trace recording to events related to the given ABAP work process</STRONG>. The resulting trace may identify the reason for the long duration. There is one caveat: A long running database operation that started before the trace was switched on will not trigger the creation of an associated trace record.<BR /> (To the best of my knowledge, the value of this filter criterion is rather limited, and it is not used very often. Please add a comment to this blog post if you know of an important use case.)<BR /> <BR /> For an SQL trace, you can <STRONG>restrict the recording of SQL statements to those that work on certain database tables</STRONG> (or database views, including CDS views). You may define up to 5 tables to be included. Similarly, you can exclude up to 5 database tables. Statements accessing these excluded tables will then not be recorded. For both options, you may filter on groups of tables by terminating entries in columns <EM>Include</EM>&nbsp;or&nbsp;<EM>Exclude</EM>&nbsp;with an asterisk&nbsp;<CODE>*</CODE>. For implemented Open SQL <CODE>JOIN</CODE>s, the table name filter applies to the first of the <CODE>JOIN</CODE>ed database tables. If a database table matches entries in both columns, <EM>Include</EM>&nbsp;and&nbsp;<EM>Exclude</EM>, SQL statements against this table will not be recorded.<BR /> If you specify a table in the <EM>Include </EM>column, but also want to trace all statements that do not directly affect an individual table (e.g., <CODE>COMMIT</CODE>s, <CODE>ROLLBACK</CODE>s, <CODE>SET SESSION VARIABLE</CODE>, <CODE>SET CLIENT INFO</CODE>), you must mark the check box <EM>Include Statements with Empty Table Names</EM>.<BR /> You may identify tables to be included with transaction <SPAN class="TextRun BCX0 SCXP20094057" lang="EN-US" lang="EN-US" data-usefontface="false" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP20094057"><CODE>STATS</CODE>(cf. my blog post <A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">Measure your Application’s Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A>)</SPAN></SPAN>: The <EM>Top N Table Accesses</EM> sub record in the <EM>DB</EM> area shows the top N most expensive tables. You may also decide to focus on a table with central importance for your line of business, so that you get an overview and deeper understanding of where or how this table is used. Based on this knowledge, you can derive approaches for optimizing the accesses to this table.<BR /> Excluding certain tables from trace recording may be helpful if your application triggers many statements against these tables and you have already verified and confirmed that they are all necessary and processed in the best possible way. Then the corresponding trace records would only clutter up your trace, without adding any useful information. Even worse, they increase the risk that the available trace files get filled up to their capacity and then are successively overwritten, thereby evicting potentially important records. (Refer to my blog post&nbsp;<A href="https://blogs.sap.com/2023/03/22/st05-technical-background-of-trace-recording-and-analysis/" target="_blank" rel="noopener noreferrer">ST05: Technical Background of Trace Recording and Analysis</A> for a detailed description and explanation of the underlying mechanism.)<BR /> Make sure that you do not by mistake exclude a table that your application accesses via potentially expensive statements.<BR /> <BR /> Imagine that you need to <STRONG>investigate the communications triggered by a batch job</STRONG>. You know its scheduled start time and have an idea about its expected duration. If the job starts or ends well outside of your work time, you can use <CODE>ST05</CODE>’s <EM>Scheduling</EM> capability. Mark the check box <EM>Schedule Trace Recording</EM>, specify the relevant <EM>Start Date</EM> and <EM>Start Time</EM> as well as <EM>End Date</EM> and <EM>End Time</EM>. This schedules and releases jobs named <CODE>ST05_Trace_On</CODE> and <CODE>ST05_Trace_Off</CODE>, which respectively activate and deactivate tracing on the appropriate dates and times. <EM>Start Date</EM> and <EM>Start Time</EM> should be slightly earlier than the beginning of the batch job you want to analyze, and <EM>End Date</EM> and <EM>End Time </EM>should be a little later than its projected end. Only then will the trace recording be active for the job's entire duration so that the resulting trace can cover all relevant events.<BR /> If you cannot analyze the trace shortly after it was recorded, other subsequent tracing activities may overwrite it from its beginning. To protect against this, mark the check box <EM>Save Trace in DB</EM> and provide a <EM>Description</EM>. This will add a second step to job <CODE>ST05_Trace_Off</CODE>, which processes all available trace records in the prescribed time frame and persists them with your description into the trace directory. There they will expire only after 120 days, giving you plenty of time for your evaluation. Please note that an active trace recording may overwrite its own beginning. The danger&nbsp; for this increases with the time during which tracing is switched on. Option <EM>Save Trace in DB </EM>cannot prevent this. It will nevertheless store the remaining trace records into the trace directory so that you can work at least with those that are still available, and do not lose even more records to other tracing activities. Of course, the previously explained approach to limit traced SQL statements to those that do or do not access specified database tables is very efficient in reducing the risk that a scheduled trace overwrites its own leading records.<BR /> <P style="overflow: hidden;margin-bottom: 0px">Once you have defined your filter conditions, switch on trace recording by pressing the <EM>Enter</EM> key. The <EM>Trace State</EM> area on <CODE>ST05</CODE>’s main screen will then indicate that recording has been activated with filter. To review the current settings, select <EM>Display Filter for Trace Recording</EM> from the <EM>Edit</EM> menu (Fig. 2). If your only restriction affects the <EM>User Name</EM>, <CODE>ST05</CODE> does not consider this a genuine filtered activation, but of course still respects it, and already displays it in the <EM>Trace State</EM>.<BR /> The <EM>User Name</EM> must not be changed while recording a trace. The <EM>Transaction Name</EM>,&nbsp;<EM>Program Name</EM>,&nbsp;<EM>RFC Function Name</EM>, or&nbsp;<EM>URL</EM> to be traced, as well as the list of tables to be <EM>Include</EM>d or <EM>Exclude</EM>d, can be modified while tracing.<BR /> If you <EM>Schedule Trace Recording</EM>, a message in the SAP GUI’s status bar indicates the result. On success the corresponding batch jobs show up in the job overview of transaction <CODE>SM37</CODE>.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_ActivateFilter_Display-1.png" /><EM><STRONG>Figure 2:</STRONG> Review the <STRONG>Conditions for Trace Recording</STRONG>, either in the <STRONG>Trace State</STRONG> area on <CODE>ST05</CODE>'s main screen, or in full detail via a dedicated popup.</EM></P><BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px">When you have switched on trace recording on all application server instances, make sure that you click button <EM>Deactivate Trace on All Instances</EM> to switch it off. Otherwise, it gets deactivated only on the local instance, but keeps going on all remote instances.</P><BR /> &nbsp;<BR /> <H1 id="toc-hId-833826726">Example</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">Let's assume that we want to analyze the start of the SAP S/4HANA Fiori application F0997 (<EM>Audit Journal</EM>) with an automatically applied default filter on <EM>Company Code</EM> 1010, <EM>Fiscal Year</EM> 2023, and <EM>Ledger</EM> 0L. We start the app by selecting it from our favorites in the <SPAN class="ui-provider yc b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"><EM>SAP S/4HANA Product Home Page</EM>, and then immediately go back after the list of journal entries has been displayed. We repeat this back and forth pattern several times to create a reliable set of statistics records.&nbsp;<EM><BR /> </EM></SPAN>We begin our investigation with transaction <CODE>STATS_FE</CODE>(<A href="https://blogs.sap.com/2022/01/27/use-transaction-stats_fe-to-analyze-the-performance-of-your-web-application/" target="_blank" rel="noopener noreferrer">Use Transaction STATS_FE to Analyze the Performance of your Web Application</A>) to measure the end-to-end performance of this front-end user interaction and to understand its overall impact on the ABAP back end (Fig. 3). We identify one front-end statistics record as representative for the user's activity. Forward navigation by double click takes us from there to transaction <CODE>STATS</CODE>, which resolves the user interaction's total effect into individual back-end tasks and their corresponding main statistics records (Fig. 4). In our example scenario, we observe 8 ABAP tasks, triggered by incoming HTTP server requests. One of them clearly dominates the load on the back end, and this is obviously due to database requests . The corresponding <EM>Top N Table Accesses</EM> sub record in the main statistics record indicates that sequential reads from two database tables account for almost all the time.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/STATS_FE_AuditJournal-4.png" /><EM><STRONG>Figure 3:</STRONG> Transaction <CODE>STATS_FE</CODE> displays the front-end statistics records corresponding to user interactions. Fields with a green background characterize the front-end activity. Fields with a gray background contain measurements taken on the browser by the UI framework. The fields with the yellow background (normally shown to the right, here copied into an overlay) show aggregated values of the associated back-end statistics records.</EM><BR /> <EM>The first record corresponds to the initial logon to the <STRONG>SAP S/4HANA Product Home Page.</STRONG> Then, 11 pairs of records represent calls from there to the <STRONG>Audit Journal</STRONG> and back. Observe that the first call to the application is significantly slower, presumably because buffers and caches have not been filled. Also note that only multiple repeated executions allow the identification of a failed measurement (crossed out in the screen shot).</EM><BR /> <EM>The red arrows mark the front-end statistics record analyzed in more detail (Fig. 4).</EM></P><BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_ActivateFilter_CaseStudy_STATS_AuditJournal.png" /><EM><STRONG>Figure 4:</STRONG> A double-click on the front-end statistics record marked by the red arrows in Fig. 3 shows the associated back-end statistics records in transaction <CODE>STATS</CODE>. This resolves the back-end load triggered by the user interaction into separate tasks. Analyze the critical tasks, i.e., those that are slow or consume many resources. The records' details provide deeper insights and suggest the next steps in a root cause analysis. These details are displayed in a popup by double-click on the back-end statistics record.</EM></P><BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px">For this scenario, our investigation so far has used solely the monitoring transactions <CODE>STATS_FE</CODE> and <CODE>STATS</CODE> based on the statistics records, which are always available. As a result, we know that one of the five calls to OData service /sap/opu/odata/sap/FAC_AUDIT_JOURNAL_SRV dominates the performance, and that accesses to tables IFIACCDOCJRNL and IFICMPTJRNL are the decisive factors (Fig. 4). To come closer to the root cause, we will use this information, together with knowledge of the back-end user's name, to set <EM>Conditions for Trace Recording</EM> in <CODE>ST05</CODE> (Fig. 5).</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_ActivateFilter_CaseStudy-2.png" /><EM><STRONG>Figure 5:</STRONG> <STRONG>Conditions for Trace Recording</STRONG> for a focussed investigation of Fiori application F0997 (<STRONG>Audit Journal</STRONG>), deduced from the monitoring data contained in front-end and back-end statistics records (Fig. 3 and Fig. 4).</EM></P><BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px">The resulting trace (Fig. 6) is very much to the point. It contains only the HTTP requests serving the business logic. Those that were triggered by any generic framework did not pass the filter. With respect to SQL statements, exactly those that fetch records from the specified CDS views IFIACCDOCJRNL and IFICMPTJRNL were recorded. From here, we can focus on understanding how and where the statements are implemented, how they are called via various involved frameworks, and most importantly, how the database server has processed them. I cover all this in my blog post <A href="https://blogs.sap.com/2023/06/30/st05-analyze-individual-trace-records/" target="_blank" rel="noopener noreferrer">ST05: Analyze Individual Trace Records</A>.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_MainRecords_CaseStudy.png" /><EM><STRONG>Figure 6:</STRONG> Complete trace of the start of the <STRONG>Audit Journal</STRONG> Fiori app recorded with the filter conditions shown in Fig. 5. Without filter, the trace for the same user interaction would contain several hundred SQL trace records.</EM></P><BR /> &nbsp;<BR /> <H1 id="toc-hId-637313221">Summary</H1><BR /> <SPAN class="TextRun BCX0 SCXP20094057" lang="EN-US" lang="EN-US" data-usefontface="false" data-contrast="none"><SPAN class="NormalTextRun BCX0 SCXP20094057">The option to <STRONG><EM>Activate Trace with Filter </EM>significantly enhances the basic trace recording capability of <CODE>ST05</CODE></STRONG>&nbsp;to capture the communications and data transfers between the ABAP work process and external components. Without it many performance analysis projects would be much more complicated, and others would even be impossible.<BR /> The particular choice of filter conditions shall be guided by previous measurements of the application under analysis, e.g., with transactions&nbsp;<CODE>STATS</CODE>&nbsp;or&nbsp;<CODE>STATS_FE</CODE> based on the statistics records. They identify the critical areas, and with corresponding filter criteria you limit the trace recording to these parts. This facilitates your subsequent investigation.<BR /> </SPAN></SPAN>Trace <EM>Scheduling</EM> is really convenient for the analysis of applications that run at known after-hours times. 2023-03-08T10:22:35+01:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-technical-background-of-trace-recording-and-analysis/ba-p/13551465 ST05: Technical Background of Trace Recording and Analysis 2023-03-22T06:07:28+01:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 This blog post in my series of posts related to SAP GUI transaction <CODE>ST05</CODE> (introduced in <A href="https://blogs.sap.com/?p=1688270" target="_blank" rel="noopener noreferrer">Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources</A>) explains the tool's inner workings and configuration options, and how they affect its behavior. With this knowledge, you can avoid some pitfalls that otherwise would make your performance analyses less convenient or less reliable.<BR /> My blog post <A href="https://blogs.sap.com/?p=1689314&amp;preview=true&amp;preview_id=1689314" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A> describes the straightforward work with this analysis tool so that you can record your applications' communications with external resources across the boundaries of the ABAP work process. This current post does not teach you any new tricks, and you may safely ignore it at first—as long as you remember it exists when you feel that <CODE>ST05</CODE> misbehaves. Then the tool's technical background as presented here does explain that <CODE>ST05</CODE> actually works as designed.<BR /> <H1 id="toc-hId-832936933">Authorizations</H1><BR /> Transaction <CODE>ST05</CODE> is protected by authorization object <CODE>S_ADMI_FCD</CODE>, which checks accesses to various basis functions. It defines a single authorization field, also called <CODE>S_ADMI_FCD</CODE>, for these system administration functions. The relevant values are<BR /> <UL><BR /> <LI><B><CODE>ST0M</CODE> </B>&nbsp; Authorization to activate or deactivate trace recording</LI><BR /> </UL><BR /> <UL><BR /> <LI><B><CODE>ST0R</CODE></B>&nbsp; &nbsp;Authorization to analyze traces</LI><BR /> </UL><BR /> There are no further checks. In particular, <STRONG>every user with the authorization to switch tracing on or off can deactivate a trace recording switched on by any other user</STRONG>. Similarly, <STRONG>every user with the authorization to analyze traces may see all available trace records</STRONG>, independent of who activated their recording, or who triggered the recorded event.<BR /> <H1 id="toc-hId-636423428">Trace Recording</H1><BR /> <CODE>ST05</CODE> really is just a display transaction. The only changes it can trigger are via buttons <EM>Activate Trace </EM>and <EM>Deactivate Trace</EM>&nbsp;(and the closely related buttons <EM>Activate Trace with Filter</EM> and <EM>Deactivate Trace on All Instances</EM>). These actions modify the so-called <STRONG>SW</STRONG>itches <STRONG>B</STRONG>lock (SWB) in the <STRONG>S</STRONG>hared <STRONG>C</STRONG>ommon <STRONG>S</STRONG>ystem <STRONG>A</STRONG>rea (SCSA), a small shared memory segment accessed by SAP executables (kernel programs). The SWB content determines whether tracing is on or off, which trace types (i.e., communication interfaces) are to be recorded, and what filter conditions shall be applied. The actual capturing of the communication events according to these settings is done by the ABAP kernel.<BR /> Because the SCSA is shared across the entire application server instance, <STRONG>trace recording does not work concurrently</STRONG>, i.e., <CODE>ST05</CODE> cannot capture communication events triggered by distinct users (or by distinct user groups defined with a trailing wildcard <CODE>*</CODE>).<BR /> With one SCSA per instance, tracing is instance specific so that at the same time it can be active for one user on one instance, and for another user on another instance (and inactive on other instances). This also demands that the application whose communication requests you want to capture runs on the instance where trace recording was switched on. Simple trace evaluation via the <EM>Display Trace</EM> button is also instance specific, i.e., only works with trace records previously captured on the same application server instance. Altogether,<STRONG> trace recording, application execution, and trace analysis must all be done on the same application server instance</STRONG>.<BR /> <STRONG>Trace recording is always cross-client</STRONG>. Active tracing captures communication events related to each and every client in the system.<BR /> <BR /> When trace recording is active, the kernel saves trace records into dedicated (binary) files on the application server instance's file system. The base name of these files (including the path) is fixed by the value of profile parameter <CODE>rstr/filename</CODE> (e.g., /usr/sap/YI3/D34/log/TRACE). New trace records are always stored into a file by exactly this name. When it is filled to its capacity (as defined in megabytes by profile parameter <CODE>rstr/max_filesize_MB</CODE>; default value 16, maximum value 100), the file is renamed by appending a two-digit number between 00 and 99 to the base filename. If a file by that name already exists, it will be discarded. An empty file with the base filename is recreated, and trace recording into this newly created file continues without any gap. The maximum number of trace files (active plus overflow) is defined by profile parameter <CODE>rstr/max_files</CODE> (default value 10, maximum value 99). If this number of files is exceeded, the oldest file is deleted, and recreated to act as the youngest overflow file. As a consequence of this round-robin approach, <STRONG>old trace records are eventually lost</STRONG>, and <STRONG>a trace may overwrite its own beginning</STRONG> if recording is active for too long, or if the traced application triggers a large number of recorded events. Depending on the specified filter conditions for trace recording (cf. my blog post <A class="row-title" href="https://blogs.sap.com/2023/03/08/st05-activate-trace-recording-with-filter/" aria-label="“ST05: Activate Trace Recording with Filter” (Edit)" target="_blank" rel="noopener noreferrer">ST05: Activate Trace Recording with Filter</A>), on the traced load on the application server instance, and on the configured number and size of trace files, this may happen within just a few minutes.<BR /> <BR /> To minimize the impact of trace recording on the instance's performance, the records are not appended immediately and individually to the trace file, but first cached in an internal memory buffer within the ABAP work process. This buffer's size (in kilobytes) is given by profile parameter <SPAN class="ph sap-technical-name sap-technical-name"><CODE>rstr/buffer_size_kB</CODE> (default value 500)</SPAN>. If the size of a single statement (including its variables’ values) exceeds this limit, it will be truncated.<BR /> <BR /> The method used for trace recording, as described above, implies that on the technical level there are only individual trace records, stored one after the other. The concept of a trace as a set of records that belong together has no technical realization. Of course it is still a useful mental notion when you work with <CODE>ST05</CODE> to analyze your application's communication events.<BR /> <BR /> Based on benchmark runs, the average size of a trace record is less than 1kB and the overhead for server response time, as well as ABAP CPU time, is less than 3%.<BR /> <H1 id="toc-hId-439909923">Additional Trace Types</H1><BR /> The SWB in the SCSA supports more trace types than are exposed by <CODE>ST05</CODE>. The corresponding interfaces deal with authorization checks done by your applications, or with low-level calls to the kernel's C functions or C modules. You can control and analyze these trace types in transaction <CODE>ST01</CODE>, together with the others, which are more frequently used and therefore accessible in <CODE>ST05</CODE>.<BR /> The inability to trace concurrently also extends to these <CODE>ST01</CODE>-only trace types. Thus, in rare cases your attempt to record a trace with <CODE>ST05</CODE> may fail although the <EM>Trace State</EM> area on its start screen is empty. A popup will then explain the situation with an information message: <EM>At least one trace type was already activated for user &lt;NN&gt;. (This may be an ST01 trace.) The trace is not activated.</EM> You may want to discuss the situation with the given user.<BR /> <H1 id="toc-hId-243396418">Stack Trace</H1><BR /> As I have described in my blog post&nbsp;<A href="https://blogs.sap.com/2023/02/24/st05-basic-use/" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A>, in the <EM>Configure Trace</EM> area on <CODE>ST05</CODE>'s start screen you can request &nbsp;that relevant communication activities shall be recorded together with their triggering ABAP call hierarchy (<EM>Stack Trace</EM>&nbsp;=&nbsp;<CODE>On</CODE>). With the setting <EM>Stack Trace</EM>&nbsp;=&nbsp;<CODE>Off</CODE> , which is the default in customer systems, only the immediate caller will be recorded.<BR /> The recording of the stack trace uses a delta strategy. Each trace record stores only those parts of the corresponding event's ABAP call stack that have not yet been captured in previous records. The correct and complete ABAP call stack is assembled only at display time, i.e., on demand. This approach minimizes the recording overhead for including the stack trace, and—equally important—the size of the trace records does not grow too much so that precious space in the trace files is saved and available for further trace records. This technique comes with a disadvantage: If you apply a filter to the trace records at display time, parts of the call hierarchy may not pass the filter. Then the ABAP call stack cannot be reassembled. <CODE>ST05</CODE> detects this situation and indicates it with a warning popup: <EM>Cannot fully display ABAP call hierarchy for statement of selected trace record</EM>. To avoid this type of problem, do not filter records when you display a trace taken with <EM>Stack Trace</EM>&nbsp;=&nbsp;<CODE>On</CODE>. Prefer to set a filter already while tracing, which saves even more space in the trace files.<BR /> <BR /> Capturing call stack information takes ~30µs per trace record, and increases the record size on average by ~50%. Thus trace recording with <EM>Stack Trace</EM>&nbsp;=&nbsp;<CODE>On</CODE> increases the danger that a trace overwrites its own beginning.<BR /> <H1 id="toc-hId-46882913">Profile Parameters</H1><BR /> Table 1 summarizes the profile parameters that govern how the trace recording works.<BR /> <TABLE class="alignleft" style="height: 280px;width: 100%;border-collapse: collapse" border="1" cellspacing="0" cellpadding="0"><CAPTION><STRONG>Table 1</STRONG>: Profile parameters to control trace recording.</CAPTION><BR /> <TBODY><BR /> <TR><BR /> <TD style="width: 26%"><STRONG>Name</STRONG></TD><BR /> <TD style="width: 44.00%"><STRONG>Explanation</STRONG></TD><BR /> <TD style="width: 15.00%"><STRONG>Default Value</STRONG></TD><BR /> <TD style="width: 15.00%"><STRONG>Maximum Value</STRONG></TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/accept_remote_trace</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Accept trace switches from remote client?</TD><BR /> <TD style="width: 15.06%">FALSE</TD><BR /> <TD style="width: 17.16%">N/A</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/auth_delim_tab</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Use tabulator (instead of '&amp;') as separator in authorization trace</TD><BR /> <TD style="width: 15.06%">TRUE</TD><BR /> <TD style="width: 17.16%">N/A</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/buffer_size_kB</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Size of trace buffers<BR /> (one buffer per work process)</TD><BR /> <TD style="width: 15.06%">500</TD><BR /> <TD style="width: 17.16%"></TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/filename</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Base name of the trace files</TD><BR /> <TD style="width: 15.06%"></TD><BR /> <TD style="width: 17.16%">N/A</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/max_files</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Maximum number of trace files</TD><BR /> <TD style="width: 15.06%">10</TD><BR /> <TD style="width: 17.16%">99</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/max_filesize_MB</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Maximum size of one trace file</TD><BR /> <TD style="width: 15.06%">20</TD><BR /> <TD style="width: 17.16%">100</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 26%;height: 14px"><CODE>rstr/send_global_trace</CODE></TD><BR /> <TD style="width: 41.78%;height: 14px">Send global trace switches (together with user-specific settings) to remote server?</TD><BR /> <TD style="width: 15.06%">FALSE</TD><BR /> <TD style="width: 17.16%">N/A</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> <H1 id="toc-hId--149630592">References</H1><BR /> <A href="https://launchpad.support.sap.com/#/notes/12715" target="_blank" rel="noopener noreferrer">SAP note 12715 (<EM>Collective note: problems with SCSA</EM>)</A> covers potential issues with the SCSA. 2023-03-22T06:07:28+01:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-trace-directory/ba-p/13558057 ST05: Trace Directory 2023-04-28T06:59:16+02:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 In this blog post of my series&nbsp;<A href="https://blogs.sap.com/?p=1688270" target="_blank" rel="noopener noreferrer">Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources</A>, I explain how you can&nbsp;<STRONG>store traces of your applications' communication events</STRONG> as long as required. Beside giving you more time for in-depth analyses, <STRONG>stored traces pave the way to completely new types of investigations</STRONG>. Examples are:<BR /> <UL><BR /> <LI>Check the temporal evolution of the applications' use of external resources (before-after comparisons).</LI><BR /> <LI>Investigate the impact of user input or data volume on the applications' performance or scalability.</LI><BR /> <LI>Compare the applications' behavior between systems.</LI><BR /> <LI>Share traces with co-workers who do not have access to the system where the application was executed.</LI><BR /> </UL><BR /> This blog post assumes previously recorded traces. See the descriptions in my posts <A href="https://blogs.sap.com/2023/02/24/st05-basic-use/" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A> and&nbsp;<A href="https://blogs.sap.com/2023/03/08/st05-activate-trace-recording-with-filter/" target="_blank" rel="noopener noreferrer">ST05: Activate Trace Recording with Filter</A> to refresh your trace recording skills.<BR /> <BR /> Some of your traces may be more important for you than other traces. But for <CODE>ST05</CODE>, they are all the same and subject to the file system storage mechanism that cycles through the configured number of trace files. Due to this round-robin retention approach, even your most important trace is eventually lost—and this can happen before you have completed your analysis of this trace. For a more complete explanation of the process, please refer to my blog post <A href="https://blogs.sap.com/2023/03/22/st05-technical-background-of-trace-recording-and-analysis/" target="_blank" rel="noopener noreferrer">ST05: Technical Background of Trace Recording and Analysis</A>. It covers the trace recording in great detail, and gives a comprehensive description of the underlying mechanism. The trace directory integrated into <CODE>ST05</CODE> provides a solution by persisting traces into the database.<BR /> <H1 id="toc-hId-833141597">Save a Trace into the Trace Directory</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">Let's begin with the assumption that you have just recorded a trace. On the <CODE>ST05</CODE> start screen, click button <EM>Display Trace</EM> to go to the <EM>Filter Conditions for Trace Records </EM>(Fig. 1, left panel). Specify criteria that support your intended analysis. Then, click button <EM>Save Trace in Database <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconSave.png" height="18" width="21" /></EM>. This will immediately save the trace records without displaying them.<BR /> Alternatively and preferably, take a first quick look at the trace to convince yourself that it is complete and representative for your application's typical execution. Only then can it be a reliable foundation for detailed and conclusive investigations. Next, trigger <EM>Save Trace in Database</EM> via the appropriate button <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconSave-1.png" height="18" width="21" /> above the ALV grid control displaying the trace records (Fig. 1, right panel).<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_TraceDirectory_SaveDB.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 1:</STRONG> Saving trace records into the trace directory on the database can be done from the <STRONG>Filter Conditions for Trace Records</STRONG> (left panel) or from the list of <STRONG>Trace Main Records</STRONG> displayed in an ALV grid (right panel). In both cases, a popup (inset) asks for a <STRONG>Short Description of Trace</STRONG> to identify the resulting trace directory entry.</P><BR /> Either way, a popup prompts you to give a <EM>Short Description of Trace</EM> (Fig. 1, inset) so that later you can reliably find your trace in the trace directory.<BR /> When you continue from this popup, the display formats of the trace records (as created on the fly by <CODE>ST05</CODE> from the raw data in the trace files on the application server instance's file system) are stored in the database. Any restrictions you may have defined for the trace records in the <EM>Filter Conditions for Trace Records</EM> or in the ALV's filter are respected: Only those trace records that match your selection criteria are stored in the database.<BR /> <BR /> Traces that you save into the trace directory are given an <EM>Expiry Date</EM>, which by default is 120 days in the future. After this date they will be deleted automatically from the database. This mechanism prevents excessive growth of the underlying database table's size due to old and most likely outdated, therefore useless, traces.<BR /> <H1 id="toc-hId-636628092">Display the Trace Directory</H1><BR /> To navigate to the trace directory, click button <EM>Display Trace Directory</EM> on <CODE>ST05</CODE>'s start screen. This takes you to the <EM>Directory of Performance Traces</EM> (Fig. 2). In its two areas at the top, you can select from predefined filter conditions, or provide your own terms for the stored traces that you want to work with. The bottom panel shows the list of matching traces in an ALV grid control. By default, you see the traces you have created on the current day.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/03/ST05_TraceDirectory_List-1.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 2:</STRONG> The <STRONG>Directory of Performance Traces</STRONG> is subdivided into three areas. In the upper two panels, <STRONG>Trace Selection</STRONG> and <STRONG>Time Period</STRONG>, you define conditions on the stored traces you want to list. The table in the lower panel then consists of the relevant trace directory entries. The icon at the start of each row distinguishes between entries that contain just metadata pointing to traces only available in the application server instance's file system (indicated by the icon depicting a binary file), and entries where the trace records are saved in the database (represented by the DB-like icon).<BR /> Here the table shows two sets of five traces each for consecutive calls to the <STRONG>Audit Journal</STRONG> Fiori application. For the older set, the metadata-only entries are already deleted because the trace records are no longer in the file system. The newer set still includes the metadata-only records next to their counterparts with the complete traces persisted in the database.</P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 1:</STRONG> Fields in the list of traces in the trace directory.</CAPTION><BR /> <TBODY><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>Client</EM></TD><BR /> <TD style="width: 75.6%;height: 14px">Client where directory entry was created.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>User</EM></TD><BR /> <TD style="width: 75.6%;height: 14px">User who saved trace.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>Instance Name</EM></TD><BR /> <TD style="width: 75.6%;height: 14px">Application server where trace was created.<BR /> (Always empty for traces stored in database.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>Start Date</EM></TD><BR /> <TD style="width: 75.6%;height: 14px">Start date of trace period.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>Start Time</EM></TD><BR /> <TD style="width: 75.6%;height: 14px">Start time of trace period.</TD><BR /> </TR><BR /> <TR style="height: 10px"><BR /> <TD style="width: 24.4%;height: 10px"><EM>Expiry Date</EM></TD><BR /> <TD style="width: 75.6%;height: 10px">Date after which trace will be deleted from directory.<BR /> (Only used for traces stored in database.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 24.4%;height: 14px"><EM>Description </EM></TD><BR /> <TD style="width: 75.6%;height: 14px">Description of trace.</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> <P style="overflow: hidden;margin-bottom: 0px">The characteristic fields of directory entries are listed in Table 1. An additional leading column in front of <EM>Client</EM> contains one of two icons to distinguish the type of trace directory entry. The kind described so far is identified by the DB-like icon <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconDB.png" height="18" width="20" />, indicating that the entire trace with all its records is stored in the database. The other icon <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconBinary.png" height="18" width="20" /> represents a binary file. It is assigned to trace directory entries that keep only metadata (trace types, trace period) in the database. This type of trace directory entry is initiated automatically whenever trace recording is activated (buttons <EM>Activate Trace</EM> or <EM>Activate Trace with Filter</EM> on <CODE>ST05</CODE>'s start screen), and completed when you switch off tracing. The actual trace records are only in the application server instance's file system, where they are subject to the cyclic overwriting described in my blog post <A href="https://blogs.sap.com/2023/03/22/st05-technical-background-of-trace-recording-and-analysis/" target="_blank" rel="noopener noreferrer">ST05: Technical Background of Trace Recording and Analysis</A>. When the trace records are overwritten, <CODE>ST05</CODE> automatically deletes the corresponding metadata trace directory entries. They are a convenience tool: Imagine that you record a trace, and then you have to logout of the system before you can analyze the trace. When you logon again, the load balancer may put you on another application server instance. Then these trace directory entries save you the effort to manually search for your trace on all of the system's application server instances. Instead, it is very easy to find it—provided it has not been overwritten in the meantime: Open the trace directory, find and double-click the entry. <CODE>ST05</CODE> will go to the adequate application server instance and display the trace there. To enable this cross-instance navigation, these types of trace directory entries have the appropriate value in their <EM>Instance Name</EM> field. For traces completely stored in the database, this value is not necessary and always empty.<BR /> The precise semantics of <EM>Start Date</EM> and <EM>Start Time</EM> depend on the type of the trace directory entry. For those representing fully persisted traces, they are the values specified on the <EM>Filter Conditions for Trace Records</EM> screen. For the metadata-only entries, they correspond to the instant of trace activation.</P><BR /> In the <EM>Trace Selection</EM> area, the default option <EM>My Traces</EM> restricts the list of traces to those trace directory entries that you have created. Optionally, you may decide to see traces of any user, or you select traces based on their owner (<EM>User</EM>), their <EM>Description</EM>, or their <EM>Expiry Date</EM>&nbsp;(<EM>Deleted Before</EM>). The selection criteria for <EM>User</EM> and <EM>Description</EM> support patterns with the wildcard characters <CODE>+</CODE> (single character) or <CODE>*</CODE> (any character string). The <EM>Description</EM> is case sensitive. When you mark the checkbox <EM>All Clients</EM>, traces saved from every client in the system will be shown. Please note that the <EM>User</EM> is the one who has created the trace directory entry. This may be different from the user who has recorded the trace, or from the user whose activities were recorded. A similar remark applies to the <EM>Client</EM> field.<BR /> In the <EM>Time Period</EM> panel, you filter traces by their <EM>Start Date</EM>. The default is the current day (<EM>Today</EM>). Other restrictions are for traces from the current week (<EM>This Week</EM>) or by a <EM>Time Period</EM>. The option <EM>No Limit</EM> covers all traces, independent of their <EM>Start Date</EM>.<BR /> The conditions from the two panels are combined by logical <CODE>AND</CODE>.<BR /> <H1 id="toc-hId-440114587">Work with Saved Traces</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">For completely saved traces, the trace directory allows you to change their properties <EM>Expiry Date</EM> (if the default retention period of 120 days is too short) or <EM>Description</EM>. You can do this either via button <EM>Change Trace Property</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconChange.png" height="18" width="24" />, or through the appropriate entries in the corresponding fields' context menus. The <EM>Description</EM> can also be set or changed for metadata-only directory entries, but because of their short lifetime this hardly ever makes sense.<BR /> When you do not need some previously stored traces any longer, mark them in the trace directory.&nbsp; Then manually delete them with button <EM>Delete Trace(s)</EM>&nbsp; <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconDelete.png" height="18" width="20" /> . This saves space in the underlying database table and gives you a better overview of your still relevant traces.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">If you have recorded separate but related traces, e.g., one for each individual user interaction of an application with multiple steps, and also want to analyze the entire application's communication with external resources, you can mark all corresponding traces and merge them into one comprehensive trace through button <EM>Merge Traces</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconMerge.png" height="18" width="20" />. Then analyze it as if it was recorded in one go.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">To access the true content of a trace directory's entry (as opposed to its characteristics shown in the list and explained in Table 1), double click it. For persisted traces, this takes you immediately to the list of <EM>Trace Main Records</EM> as covered in my blog post&nbsp;<A href="https://blogs.sap.com/2023/02/24/st05-basic-use/" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A>. Alternatively, you right-click an entry's row header and select <EM>Display Trace with Filter</EM> from the context menu or from button <EM>Display Trace</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconDisplay.png" height="18" width="24" /> to get the <EM>Filter Conditions for Trace Records</EM> screen where you can restrict to a subset of the stored trace records. This screen is always the entry point for metadata-only trace directory entries.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">You may also export traces from the trace directory into the local file system of your front-end computer. Mark the desired trace and select the download format from the context menu of button <EM>Export Trace</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconExport.png" height="18" width="23" />. Available formats are binary, or CSV for the various aggregation levels supported by <CODE>ST05</CODE>. Give a file name for each trace you want to export. You can initiate trace downloads also from the <EM>Filter Conditions for Trace Records</EM> screen or from the list of <EM>Trace Main Records</EM>.<BR /> CSV downloads are typically opened with a spreadsheet application. A binary export can be imported into a trace directory of another system (button <EM>Import Trace</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconImport.png" height="18" width="19" />). There, its description will be the file name with&nbsp;<CODE> (Imported from file)</CODE> appended. Based on such an imported trace, you can continue your analysis of the trace even when you do not have access to the original system any longer. Or you can forward the trace to a colleague who does not have a user in the original system. Finally, with imported traces you can compare the behavior of your application between different systems with distinct configurations, or software releases, or amounts of data. The next section explains the trace comparison in detail.</P><BR /> Trace records contain the name of the user who triggered the associated statement. This may conflict with local data privacy legislation. To remedy such collisions, you can anonymize persisted traces: Mark the relevant stored traces and select <EM>Anonymize Trace Records</EM> from the context menu (right-click the row header). In the ensuing popup, specify the user name to be anonymized. It will be replaced by a string of 12 alphanumeric characters. If you specify <CODE>*</CODE> all user names will be deleted. No other wildcards are supported.<BR /> <H1 id="toc-hId-243601082">Trace Comparison</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">For fully persisted traces, the trace directory supports their comparison: Mark exactly two traces, then click button <EM>Compare Two Traces</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconCompare.png" height="18" width="19" /> (Fig. 3).</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_Compare.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 3:</STRONG> From the <STRONG>Directory of Performance Traces</STRONG> you can compare two traces that you have previously saved on the database. Fig. 4 shows the comparison.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">This leads to the <EM>Trace Comparison of Structure-Identical Statements</EM> (Fig. 4). Its upper panel shows the two traces' metadata and overall totals for their KPIs <EM>Total Number of Executions</EM>, <EM>Number of Records</EM>, <EM>Execution Duration</EM>, <EM>HANA CPU Time</EM>, and <EM>Redundant Identical Statements.</EM> Additionally, it includes the prevalences of buffer types among the database tables or views recorded in the traces. The lower panel contains the actual comparison. The first trace is considered the baseline against which the second trace is contrasted. Press button <EM>Swap Traces</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconSwap.png" height="18" width="19" /> to interchange the traces if you want to regard the other trace as the baseline.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_Comparison-2.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 4:</STRONG> With a trace comparison you can investigate variations in your application's runtime behavior related to its communication with external resources. These may be due to unequal amounts of data either in principle available to the application, or actually processed by it. Other reasons for runtime differences may be changes to the application's source code, or its configuration, or the way it is executed by its users.<BR /> The upper panel shows the two traces' metadata and their overall KPI totals for <STRONG><EM>Total Number of Executions</EM></STRONG>, <STRONG><EM>Number of Records</EM></STRONG>, <STRONG><EM>Execution Duration</EM></STRONG>, <STRONG><EM>HANA CPU Time</EM></STRONG>, and <EM><STRONG>Redundant Identical Statements</STRONG>.<BR /> </EM>In the lower panel, the actual comparison examines the KPI's values aggregated according to the selected granularity.<EM>&nbsp;The default comparison method is the difference, and the rows are sorted descending by the runtime difference.<BR /> In the screenshot, the comparison contrasts two calls to the <STRONG>Audit Journal</STRONG> Fiori application F0997. The first one does not find any data, the second has 71 rows in its result set.</EM></P><BR /> To prepare for the comparison, <CODE>ST05</CODE> summarizes, separately within each trace, the values for <EM>Total Number of Executions</EM>, <EM>Number of Records</EM>, <EM>Execution Duration</EM>, <EM>HANA CPU Time</EM>, and <EM>Redundant Identical Statements</EM> of all matching records. The default summarization criterion is the object affected by the statements, independent of the type or the structure of the statements. For finer granularity, distinct operations (<CODE>SELECT</CODE>, <CODE>INSERT</CODE>, <CODE>UPDATE</CODE>, <CODE>DELETE</CODE>, ENQUEUE, DEQUEUE, ...) can be resolved, or (for greatest detail) the operations and the statements. After this preparation, the summary records of the two traces are matched (by the combination of object, operation, or statement, corresponding to your chosen level of resolution), and their values are compared. The default comparison (Fig. 4) uses the values' differences (absolute numbers). Optionally, <CODE>ST05</CODE> can express this as the percentages relative to the values of the first trace. Other alternatives show the ratios of the second trace's values divided by those of the first trace, or the relative contributions to the corresponding total values of each trace.<BR /> <BR /> The first column of each summary record in the comparison table encodes the record's occurrence:<BR /> <UL><BR /> <LI><CODE>T1_</CODE>&nbsp; :&nbsp; only in the first trace</LI><BR /> <LI><CODE>T_2</CODE>&nbsp; :&nbsp; only in the second trace</LI><BR /> <LI><CODE>T12</CODE>&nbsp; :&nbsp; in both traces</LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px">For a meaningful trace comparison, <CODE>T12</CODE> shall be the predominant code. Otherwise, the two traces are not really comparable.<BR /> Columns <EM>Object Name</EM>, <EM>Operation</EM>, and <EM>Statement</EM> characterize the level of detail on which the comparison is done. For rows dealing with database tables or views, column <EM>Buffer Type</EM> indicates the buffering type.<BR /> The four color-coded groups with three columns each contain the compared KPIs with the measured values for the two traces and their differences.<BR /> To streamline the comparison, click button <EM>Display Differences Only</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconDiffOnly.png" height="18" width="20" />. This compares only those records that are not in both traces (code either <CODE>T1_</CODE> or <CODE>T_2</CODE>)&nbsp;or that have different values for <EM>Total Number of Executions</EM>&nbsp;or <EM>Number of Records</EM>. Press the button again to toggle back to <EM>Display Full List</EM>.<BR /> From the dropdown menu of button <EM>Set Comparison Method</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconCompareMethod.png" height="18" width="23" /> you can pick your preferred perspective: absolute difference, ratio, percentage increase, or percentage of each trace's totals.<BR /> Similarly, use the dropdown menu of button <EM>Set Comparison Granularity</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconCompareGranularity.png" height="18" width="23" /> to determine the level of detail for your analysis: just <EM>Objects</EM>, or <EM>Objects and Operations</EM>, or <EM>Objects, Operations, and Statements</EM>.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">The example shown in Fig. 4 indicates that the same number of HTTP requests to OData services <CODE>/sap/opu/odata/sap/FAC_AUDIT_JOURNAL_SRV</CODE> took significantly longer in the second trace than in the first one. The reasons are different accesses to CDS views <CODE>IFIACCDOCJRNL</CODE> (<EM>Journal</EM>) and <CODE>IFICMPTJRNL</CODE> (<EM>Compact Journal</EM>), leading to longer <EM>Execution Duration</EM>&nbsp;and higher <EM>HANA CPU Time</EM> consumption. For an in-depth investigation, you open the second trace (by double-clicking it in the upper panel of the <EM>Trace Comparison</EM>, or by pressing button <EM>Display Trace</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/04/ST05_TraceDirectory_IconCompareDisplay.png" height="18" width="19" />). There you can use all the tools offered by <CODE>ST05</CODE> to analyze why the second execution is slower. In this example, the evident reason is that it handles more data, but you still may find an approach to accelerate it. Always question the obvious explanations and try to go beyond the apparent cause.</P><BR /> <BR /> <H1 id="toc-hId-47087577">Summary</H1><BR /> The trace directory integrated into <CODE>ST05</CODE> serves two main purposes:<BR /> <UL><BR /> <LI>It prevents important traces from being overwritten by subsequently recorded traces.<BR /> This gives you more time for comprehensive analyses, e.g., to find optimization approaches.</LI><BR /> <LI>Two previously stored traces can be compared with each other.<BR /> With such a comparison you can investigate your application's scaling behavior (related to its communication with external resources) to verify that its execution time or resource consumption grows at worst proportional to the amount of processed data.<BR /> Alternatively, with a trace comparison you may be able to demonstrate that your optimization project has been successful.</LI><BR /> </UL><BR /> Traces exported to your front-end computer's file system and then imported into another SAP system enable the comparison of your application's behavior across systems. Such a comparison may reveal the impacts of differences in system configuration, process customizing, or available data volume on your application's performance. 2023-04-28T06:59:16+02:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-aggregate-trace-records/ba-p/13569482 ST05: Aggregate Trace Records 2023-05-17T11:23:04+02:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 This is a follow-up to my blog post&nbsp; <A href="https://blogs.sap.com/?p=1689314&amp;preview=true&amp;preview_id=1689314" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A>. Here I explain various options for aggregating trace records. They greatly facilitate the analysis of a trace.<BR /> <BR /> If you have not yet done so, please read the introductory post <A href="https://blogs.sap.com/?p=1688270" target="_blank" rel="noopener noreferrer">Use ST05 to Monitor the Communication of the ABAP Work Process with External Resources</A>. There I describe how my measurement transactions <CODE>STATS</CODE>&nbsp;and&nbsp;<CODE>STATS_FE</CODE> help you to detect performance bugs in your applications, and I state that <CODE>ST05</CODE> is an essential analysis tool to find root causes for applications that are too slow or consume too many resources. In particular, <CODE>ST05</CODE> captures requests and data transmissions between the ABAP work process and external components. By default these transmissions are not recorded to not incur the associated overhead. You need to consciously and explicitly activate the recording, and subsequently must switch it off. Once you have a high quality trace of your application's communication with external resources, you want to evaluate it in the most efficient way.<BR /> <BR /> Fig. 1 shows the ALV list of <EM>Trace Main Records</EM> for the Audit Journal Fiori application F0997, with records for the interface types SQL, Enqueue, HTTP, and RFC. Refer to my blog post <A href="https://blogs.sap.com/?p=1689314&amp;preview=true&amp;preview_id=1689314" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A> for a complete description of the scope and purpose of the <EM>Trace Main Records</EM>. With its chronological sort order, the list provides a comprehensive picture of the flow of the application's communication with external agents, but it does not draw your attention to the most expensive statements, nor does it indicate events that have been executed multiple times or even redundantly. It also does not distinguish between statements related to the involved technical frameworks and statements that contribute to the business logic.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_MainRecords-1.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 1:</STRONG> In the chronologically sorted list of <STRONG>Trace Main Records</STRONG>, each entry corresponds to one execution of an ABAP statement calling an external resource, or to the processing of an incoming request.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">To remedy these shortcomings,<STRONG><CODE>ST05</CODE> offers various options to summarize the list of <EM>Trace Main Records</EM>, which make your work with previously recorded traces much more efficient</STRONG>. They are all accessible from the drop-down menu of button <EM>Aggregate Trace</EM> &nbsp;<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_AggregateTrace.png" height="18" width="22" />. Table 1 briefly introduces them, and the following sections describe them in detail.</P><BR /> <BR /> <TABLE style="height: 70px;width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 1:</STRONG> Aggregation levels supported by <CODE>ST05</CODE>.</CAPTION><BR /> <TBODY><BR /> <TR style="height: 14px"><BR /> <TD style="width: 31.44%;height: 14px"><EM>Structure-Identical Statements</EM></TD><BR /> <TD style="width: 68.56%;height: 14px">Specific values of bind variables are not considered.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 31.44%;height: 14px"><EM>Value-Identical Statements</EM></TD><BR /> <TD style="width: 68.56%;height: 14px">Structure-identical statements where the bind variables have the same values.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 31.44%;height: 14px"><EM>Table Accesses</EM></TD><BR /> <TD style="width: 68.56%;height: 14px">Database accesses from the same category (<CODE>SELECT</CODE>, <CODE>INSERT</CODE>, <CODE>UPDATE</CODE>, <CODE>DELETE</CODE>, ...) grouped by object and by database connection.<BR /> Buffer accesses using the same number of key fields.<BR /> (Only for trace types SQL, BUF.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 31.44%;height: 14px"><EM>Trace Overview</EM></TD><BR /> <TD style="width: 68.56%;height: 14px">Quality control of the trace, break-down of records by type, and high-level evaluation with hints for potential optimizations.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 31.44%;height: 14px"><EM>Sizing Information</EM></TD><BR /> <TD style="width: 68.56%;height: 14px">Estimates the data volume added by the traced application to the database.</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 31.44%"><EM>Trace Single Records</EM></TD><BR /> <TD style="width: 68.56%">Resolves individual low-level operations.<BR /> (They are recorded only for trace types SQL, BUF.)</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> The main benefit of trace aggregation is for trace types SQL and BUF. They record concrete values used in individual statements, leading to a large variety of trace records. Aggregation creates a significantly shorter list of records, giving you a much better overview of the various kinds of statements and their durations or resource consumptions.<BR /> <H1 id="toc-hId-834098841">Structure-Identical Statements</H1><BR /> The list of <EM>Structure-Identical Statements</EM> (Fig. 2) summarizes identical <EM>Trace Main Records</EM> without considering the actual values for any bind variables. The resulting list is augmented by some statistics on the set of main records contributing to each entry, and (for SQL, BUF, and ENQ trace records) by metadata from the ABAP dictionary on the affected table, view, or lock object. Table 2 covers the columns that are shown in the default ALV grid layout. You may add a few additional fields with more technical content (e.g., from the SAP extended passport) by changing the list's layout.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_StructureIdenticalRecords-3.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 2:</STRONG> The list of <STRONG>Structure-Identical Statements</STRONG> summarizes the <STRONG>Trace Main Records</STRONG> for statements with the same structure, but potentially distinct values for bind variables. The list is sorted descending by <STRONG>Duration</STRONG>.</P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 2:</STRONG> <EM>Fields in the default layout of the list of <STRONG>Structure-Identical Statements</STRONG>.</EM></CAPTION><BR /> <TBODY><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Executions</EM></TD><BR /> <TD style="width: 76%;height: 14px">Total number of executions of the structure-identical statements.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Redundancy</EM></TD><BR /> <TD style="width: 76%;height: 14px">Absolute number of redundant value-identical statements.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Identical</EM></TD><BR /> <TD style="width: 76%;height: 14px">Relative number of redundant value-identical statements.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Duration</EM></TD><BR /> <TD style="width: 76%;height: 14px">Total elapsed execution time in µs of the structure-identical statements.<BR /> (Measured by the ABAP work process.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>CPU Time</EM></TD><BR /> <TD style="width: 76%;height: 14px">Total HANA CPU time in µs used during the structure-identical statements' executions.<BR /> (Only for SQL trace records on SAP HANA.)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Memory</EM></TD><BR /> <TD style="width: 76%;height: 14px">Maximum memory consumption in kByte during the structure-identical statements' executions.<BR /> (Only for SQL trace records on SAP HANA.​)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Records</EM></TD><BR /> <TD style="width: 76%;height: 14px">Total number of records affected by the structure-identical statements.<BR /> (SQL, BUF: number of table or view rows;<BR /> ENQ: number of lock granules)<BR /> (Not for RFC, HTTP, APC, and AMC trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Duration / Execution</EM></TD><BR /> <TD style="width: 76%;height: 14px">Average execution time in µs per contributing statement.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Records / Execution</EM></TD><BR /> <TD style="width: 76%;height: 14px">Average number of records affected per contributing statement.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Duration / Record</EM></TD><BR /> <TD style="width: 76%;height: 14px">Average execution time in µs per record.<BR /> (Records = 0 ⇒ average execution time per contributing statement.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM> Min. Duration / Record</EM></TD><BR /> <TD style="width: 76%;height: 14px">Minimum execution time in µs per record.<BR /> (Records = 0 ⇒ minimum execution time of contributing statements.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Length</EM></TD><BR /> <TD style="width: 76%;height: 14px">ABAP dictionary record length in Byte of the table or view.<BR /> (Only for SQL and BUF trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM> Buffer Type</EM></TD><BR /> <TD style="width: 76%;height: 14px">Buffer type of the table or view.<BR /> (Only for SQL and BUF trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Table Type</EM></TD><BR /> <TD style="width: 76%;height: 14px">Table type of the table or view.<BR /> (Only for SQL and BUF trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Data Class</EM></TD><BR /> <TD style="width: 76%;height: 14px">Type of data stored in the table.<BR /> (Only for SQL and BUF trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Size</EM></TD><BR /> <TD style="width: 76%;height: 14px">Estimated size category of the table.<BR /> (Only for SQL and BUF trace records.​)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Object Name</EM></TD><BR /> <TD style="width: 76%;height: 14px">Name of the object that was accessed.<BR /> (SQL, BUF: table or view; ENQ: lock object;<BR /> RFC: function; HTTP, APC: path; AMC: channel ID)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 23.84%;height: 14px"><EM>Statement</EM></TD><BR /> <TD style="width: 76%;height: 14px">Edited statement.<BR /> (SQL: field list and <CODE>FROM</CODE> clause removed, variable names as place holders for values;<BR /> BUF: buffer type, length of key values in characters, buffer operation;<BR /> ENQ: lock operation, lock mode, table, granule argument;<BR /> RFC: source, destination, <CODE>CLIENT</CODE> or <CODE>SERVER</CODE>, function, sent data in Byte;<BR /> HTTP: method, status code, status text, scheme, host, port, <CODE>CLIENT</CODE> or <CODE>SERVER</CODE>, path;<BR /> APC: executed action, protocol, host, port, <CODE>CLIENT</CODE> or <CODE>SERVER</CODE>, path;<BR /> AMC: &lt;empty&gt;)</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> The sort order is descending by <EM>Duration</EM>, placing the most expensive statements at the top. They have the biggest impact on the application's end-to-end response time and are your first entry point to a detailed analysis, which shall also consider the number of <EM>Records</EM> affected by the statement:<BR /> If <EM>Min. Duration / Record</EM> exceeds 10,000 µs = 10 ms for <CODE>SELECT</CODE>s, or 50,000 µs = 50 ms for <CODE>INSERT</CODE>s, <CODE>UPDATE</CODE>s, or <CODE>DELETE</CODE>s, the statement's execution on the database is slow and shall be investigated in detail. If a statement has been executed multiple times (e.g., <EM>Executions</EM> ≥ 10), also consider the value of average <EM>Duration / Record</EM>. With few executions, a single outlier may distort the average, i.e., one slow execution may conceal several fast executions, but with 10 or more executions, it should be reliable and taken seriously. In my blog post <A href="https://blogs.sap.com/2023/06/30/st05-analyze-individual-trace-records/" target="_blank" rel="noopener noreferrer">Analyze Individual Trace Records</A>, I explain how you can recognize the database's processing of a slow statement and how this may indicate optimization approaches.<BR /> <BR /> Other purely technical indicators for potential improvements related to SQL trace records are<BR /> <UL><BR /> <LI>Column&nbsp;<EM>Buffer Type</EM><BR /> It shall be empty. If a table's technical settings is&nbsp;<EM>Buffering switched on</EM>, the vast majority of Open SQL statements against this table shall be handled by the table buffer on the application server instance. Then they will not be recorded by an SQL trace. SQL trace records where&nbsp;<EM>Buffer Type&nbsp;</EM>equals&nbsp;<CODE>FUL</CODE>,&nbsp;<CODE>GEN</CODE>, or&nbsp;<CODE>SNG</CODE>&nbsp;indicate that the table buffer was bypassed, which slows down the application, puts unnecessary load on the database server, and does not take advantage of the application server memory used to buffer the table's rows. Rewrite the corresponding statements so that they can be handled by the table buffer. Values in the&nbsp;<EM>Buffer Type</EM>&nbsp;column starting with&nbsp;<CODE>DE</CODE>&nbsp;represent the technical setting&nbsp;<EM>Buffering allowed but switched off</EM>. Check whether buffering can be switched on for the affected tables. The&nbsp;<EM>Buffer Type</EM>&nbsp;<CODE>CUST</CODE>&nbsp;identifies accesses to unbuffered customizing tables (<EM>Data Class</EM>&nbsp;=&nbsp;<CODE>APPL2</CODE>). Consider to switch on buffering for the table—this is typically suitable for customizing data. Finally, the entry&nbsp;<CODE>DDIC</CODE>&nbsp;in the&nbsp;<EM>Buffer Type</EM>&nbsp;column indicates direct accesses to tables belonging to the ABAP dictionary. Replace them by using functions&nbsp;<CODE>DDIF*</CODE>, in particular&nbsp;<CODE>DDIF_NAMETAB_GET</CODE>&nbsp;or&nbsp;<CODE>DDIF_FIELDINFO_GET</CODE>.</LI><BR /> <LI>Columns <EM>Redundancy</EM> or <EM>Identical</EM><EM><BR /> </EM>They shall contain only zeros. These columns show the absolute number or relative number, respectively, of redundant <EM>Value-Identical Statements</EM> within the corresponding set of <EM>Structure-Identical Statements</EM>. These duplicate <EM>Value-Identical Statements</EM> repeatedly access the same rows on the database, instead of taking their content from the application's state in the application server instance. This is slower than necessary and wastes precious resources on the database server. You need to eliminate them. Refer to the following section on <EM>Value-Identical Statements</EM> for a complete discussion.</LI><BR /> <LI>Columns <EM>Executions</EM> and <EM>Records / Execution<BR /> </EM>Entries with a large number of <EM>Executions</EM> and <EM>Records / Execution</EM> ≈ 1 may indicate single row SQL statements nested inside a loop. Consider a mass-enabled approach to reduce the number of data transfers.<EM><BR /> </EM></LI><BR /> </UL><BR /> With domain knowledge about the application's business logic and its purpose, you may identify further critical statements by looking at<BR /> <UL><BR /> <LI>Columns <EM>Object Name</EM> and <EM>Statement</EM><BR /> For SQL trace records: Does the application need rows from the table or view? If yes, is the statement's <CODE>WHERE</CODE> clause as restrictive as possible, and does the field list request only necessary columns?<BR /> For the other trace types, similar questions apply and help to identify potentially unnecessary communication events triggered by your application.</LI><BR /> <LI>Column <EM>Executions</EM><BR /> Are all executions required for the application to be functionally correct?</LI><BR /> <LI>Column <EM>Records</EM><BR /> Does the number of rows make sense? Are all the records needed by the application? Can you use code push-down (at least in the form of SQL aggregate functions) to calculate on the database instead of transferring many rows to the ABAP work process?</LI><BR /> </UL><BR /> With button <EM>Absolute &lt;-&gt; Relative Values&nbsp;</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconAbsRel.png" height="18" width="19" />&nbsp;you can toggle between these two options for columns <EM>Executions</EM>, <EM>Duration</EM>, <EM>CPU Time</EM>, and <EM>Records</EM>. The relative values are expressed as percentages of the respective totals.<BR /> The drop-down menu of button <EM>Break Down Trace Record&nbsp;</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconBreakDown.png" height="18" width="22" />&nbsp;allows you to view either the contributing <EM>Trace </EM><EM>Main Records</EM> or the associated <EM>Value-Identical Statements</EM> for selected list entries.<BR /> <H1 id="toc-hId-637585336">Value-Identical Statements</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">The list of&nbsp;<EM>Value-Identical Statements</EM> (Fig. 3) also summarizes identical <EM>Trace Main Records</EM>, but unlike the <EM>Structure-Identical Statements</EM>, it takes the concrete values for any bind variables into account. This aggregation supports only SQL, BUF, and ENQ trace records. These are the only trace types where values are recorded. The columns in the list of <EM>Value-Identical Statements</EM> are mostly like the ones for the <EM>Structure-Identical Statements</EM>. Table 3 contains the differences.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_ValueIdenticalRecords-1.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 3:</STRONG> The list of <STRONG>Value-Identical Statements</STRONG> summarizes <STRONG>Trace Main Records</STRONG> for statements with the same structure, and with identical values for bind variables. The list is sorted descending by <STRONG>Duration</STRONG>.</P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 3:</STRONG> <EM>Fields in the default layout of the list of <STRONG>Value-Identical Statements</STRONG>&nbsp;that differ from the fields for the <STRONG>Structure-Identical Statements</STRONG>.</EM></CAPTION><BR /> <TBODY><BR /> <TR><BR /> <TD style="width: 24.4%"><EM>Executions</EM></TD><BR /> <TD style="width: 75.6%">Total number of executions of the value-identical statements.</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 24.4%"><EM>Redundancy</EM></TD><BR /> <TD style="width: 75.6%">Not available—covered by <EM>Executions</EM>.</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 24.4%"><EM>Identical</EM></TD><BR /> <TD style="width: 75.6%">Not available—covered by <EM>Executions</EM>.</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 24.4%"><EM>Statement</EM></TD><BR /> <TD style="width: 75.6%">Edited statement.<BR /> (SQL: field list and <CODE>FROM</CODE> clause removed, variable values;<BR /> BUF: buffer type, length of key values in characters, key values;<BR /> ENQ: lock operation, lock mode, table, granule argument)</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> The list of <EM>Value-Identical Statements</EM> is sorted descending by <EM>Duration</EM>. Records with <EM>Execution</EM> = 1 are suppressed.<BR /> <BR /> Value-identical SQL statements read the same data multiple times from the database, thus create unnecessary load. Identical data can be read redundantly by statements that are not value-identical―and not even structure-identical. This is not visible in the list of <EM>Value-Identical Statements</EM>. All unnecessary accesses to the persistence layer must be eliminated. This is a more comprehensive demand than just removing value-identical SQL statements. Unfortunately, there is no support in <CODE>ST05</CODE> (nor in any other tool) to find all superfluous SQL statements.<BR /> Click button <EM>Break Down Trace Record</EM> &nbsp;<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconBreakDown-1.png" height="18" width="22" /> to see the <EM>Trace Main Records </EM>contributing to the selected <EM>Value-Identical Statements</EM>.<BR /> <H1 id="toc-hId-441071831">Table Accesses</H1><BR /> The <EM>Table Accesses</EM> aggregation (Fig. 4) combines statements by their type, separately for each object. It aggregates all SQL trace records corresponding to statements of the same category (e.g., <CODE>SELECT</CODE>, <CODE>INSERT</CODE>, <CODE>UPDATE</CODE>, <CODE>DELETE</CODE>) that access a table or view over the same logical database connection. Similarly,&nbsp; all BUF trace records triggered by statements that were handled by the table buffer or by other buffers on the application server instance, and that access an object with the same number of key fields are aggregated. No other trace types are supported by this aggregation option. Table 4 contains the fields displayed in the <EM>Table Accesses</EM> list.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_Table-Accesses.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 4:</STRONG> The list of <STRONG>Table Accesses</STRONG> summarizes, separately for each table or view, all statements of the same category. The sort order is alphabetically by <STRONG><EM>Object Name</EM></STRONG>, <EM><STRONG>Statement</STRONG> category</EM>, and <EM><STRONG>Connection Name</STRONG>.</EM></P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 4:</STRONG> <EM>Fields in the default layout of the <STRONG>Table Accesses</STRONG>.</EM></CAPTION><BR /> <TBODY><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Object Name</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Name of the table or view that was accessed.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Length</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">ABAP dictionary record length in Byte of the table or view.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Buffer Type</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Buffer type of the table or view.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Table Type</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Table type of the table or view.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Data Class</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Type of data stored in the table.</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Size</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Estimated size category of the table.</TD><BR /> </TR><BR /> <TR style="height: 42px"><BR /> <TD style="width: 19.6%;height: 42px"><EM>Statement</EM></TD><BR /> <TD style="width: 81.04%;height: 42px">Category of statement<BR /> SQL: <CODE>SELECT</CODE>, <CODE>INSERT</CODE>, <CODE>UPDATE</CODE>, <CODE>DELETE</CODE>, ...<BR /> BUF: buffer type, key length</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Connection Name</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Name of the logical database connection used by the contributing statements.</TD><BR /> </TR><BR /> <TR style="height: 28px"><BR /> <TD style="width: 19.6%;height: 28px"><EM>Duration</EM></TD><BR /> <TD style="width: 81.04%;height: 28px">Total elapsed execution time in µs of the contributing statements.<BR /> (Measured by the ABAP work process.)</TD><BR /> </TR><BR /> <TR style="height: 42px"><BR /> <TD style="width: 19.6%;height: 42px"><EM>CPU Time</EM></TD><BR /> <TD style="width: 81.04%;height: 42px">Total HANA CPU time in µs used during the contributing statements' executions.<BR /> (Only for SQL trace records on SAP HANA.)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="height: 56px"><BR /> <TD style="width: 19.6%;height: 56px"><EM>Memory</EM></TD><BR /> <TD style="width: 81.04%;height: 56px">Maximum memory consumption in kByte during the contributing statements' executions.<BR /> (Only for SQL trace records on SAP HANA.​)<BR /> (Measured by the SAP HANA DB server.)</TD><BR /> </TR><BR /> <TR style="height: 14px"><BR /> <TD style="width: 19.6%;height: 14px"><EM>Records</EM></TD><BR /> <TD style="width: 81.04%;height: 14px">Total number of table or view rows affected by the contributing statements.</TD><BR /> </TR><BR /> <TR style="height: 28px"><BR /> <TD style="width: 19.6%;height: 17px"><EM>Executions</EM></TD><BR /> <TD style="width: 81.04%;height: 17px">Total number of executions of contributing statements.</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> The list is sorted ascending by <EM>Object Name</EM>, category of <EM>Statement</EM>, and <EM>Connection Name</EM>.<BR /> <BR /> The <EM>Table Accesses</EM> display provides a highly condensed survey of the tables with which the traced application works and how the application affects these tables. Use it to verify that there are no expensive accesses to tables that have no relevance to the business process, and to make sure that the required accesses have good performance.<BR /> <BR /> As in the list of <EM>Structure-Identical Statements</EM>, button <EM>Absolute &lt;-&gt; Relative Values</EM> &nbsp;<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconAbsRel.png" height="18" width="19" /> toggles between these options for columns&nbsp;<EM>Duration</EM>, <EM>CPU Time</EM>, <EM>Records</EM>, and <EM>Executions</EM>.<BR /> <P style="overflow: hidden;margin-bottom: 0px">Button <EM>Component Hierarchy</EM> &nbsp;<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconComponentHierarchy.png" height="18" width="22" />&nbsp;enhances the list of the <EM>Table Accesses </EM>(Fig. 5). It groups the accessed tables by their application component (levels 0 and 1 are supported, level 0 is the default, buttons&nbsp; <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconComponentHierarchyLevel1.png" height="18" width="19" /> or&nbsp; <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconComponentHierarchyLevel0.png" height="18" width="19" /> toggle between the levels), and additionally shows the tables’ short descriptions from the ABAP data dictionary. For each application component, absolute and relative subtotals of the duration, the number of records, and the number of executions are given separately for the statement categories (<CODE>SELECT</CODE>, <CODE>INSERT</CODE>, <CODE>UPDATE</CODE>, <CODE>DELETE</CODE>; buffer accesses), and across all categories. <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_Table-Accesses_ApplicationComponentHierarchy-1.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left">Figure 5: The <STRONG>Application </STRONG><EM><STRONG>Component Hierarchy</STRONG> view augments the </EM>list of <STRONG>Table Accesses</STRONG> (Fig. 4) by including the tables' application components and descriptions. With this additional information you can better understand why the tables are accessed when the application executes. The grouping by application component helps you to judge the run time contributions of the components.</P><BR /> Use this enriched list of <EM>Table Accesses</EM> to understand the software domains used—either directly or via intermediary frameworks—by your application, and to assess how much they impact your application's performance. It may also uncover unnecessary accesses, which you can eliminate without breaking your application's functional correctness.<BR /> <H1 id="toc-hId-244558326">Trace Overview</H1><BR /> The <EM>Trace Overview</EM> (Fig. 6) provides a quality control of the trace, and also a high-level analysis to indicate potential problem areas. Use this aggregation option to convince yourself that the trace is reliable and to obtain a quick survey of&nbsp; the variety of recorded statements. This may give you some guidance for more detailed analyses.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_TraceOverview.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 6:</STRONG> The <STRONG>Trace Overview</STRONG> evaluates the trace's technical quality, and identifies performance bugs.</P><BR /> It is divided into several areas:<BR /> <OL><BR /> <LI>At the top, the main characteristics of the system are shown. This corresponds to the situation when and where the <EM>Trace Overview</EM> was called. It is not necessarily related to the circumstances in which the application was executed and traced. This is particularly true for old traces from the trace directory, and even more so for traces imported from other systems.<BR /> Then, the time intervals between start and end of the trace analysis period and between the first and the last trace records are compared. A large discrepancy may indicate that the trace is incomplete.</LI><BR /> <LI>The next part evaluates the trace’s technical quality and reliability. If it contains <CODE>ROLLBACK</CODE>s, <CODE>OPEN</CODE> operations, or SQL statements that load content into the table buffer on the application server instance, you have not executed enough pre-runs of your application before recording the trace. The <EM>Trace Overview</EM> then advises you to <!--StartFragment --><EM>Consider re-recording the trace<SPAN class="L0S55">. B</SPAN>efore doing so<SPAN class="L0S55">, </SPAN>execute the application several <SPAN class="L0S52">times</SPAN><SPAN class="L0S55">.</SPAN></EM> Typically, you want to analyze and eventually optimize the repeated executions of your applications. For them, there should not be any <CODE>ROLLBACK</CODE>s. Also, all SQL statements should already be in the database server’s statement cache so that no <CODE>OPEN</CODE> operation is needed, and the table buffer should contain all necessary rows.</LI><BR /> <LI>The following region condenses the trace by the records’ types (SQL, BUF, ENQ, ...), and within the types resolves the main statement categories. Values for <EM>Executions</EM>, <EM>Duration</EM>, and <EM>Records</EM> are given as absolute numbers and as percentages of the respective totals.</LI><BR /> <LI>Finally, the trace is analyzed for violations of common best practices to identify problematic or suspicious patterns like unnecessary accesses to the persistence layer, e.g., <CODE>SELECT</CODE>s for buffered tables or redundant DB accesses. <SPAN class="L0S55">Additionally, the SQL trace records are checked by Code Inspector to find statements </SPAN>whose access <SPAN class="L0S52">times&nbsp;</SPAN><SPAN class="L0S52">to&nbsp;</SPAN>the persistence may erroneously depend <SPAN class="L0S52">on </SPAN>the&nbsp;amount&nbsp;<SPAN class="L0S52">of&nbsp;</SPAN><SPAN class="L0S52">data&nbsp;</SPAN>persisted. This is typically a consequence of inadequate index support.&nbsp;<SPAN class="L0S55"><SPAN class="L0S55"><BR /> One section also deals with accesses to CDS views, to ensure that analytical CDS views are not used in transactional applications. If the trace contains SQL statements that access transactional CDS views, this section also suggest that you verify the modelling of these views. It must guarantee that SQL queries using them have response times and CPU consumptions independent of the data volume saved in the underlying tables.</SPAN></SPAN></LI><BR /> </OL><BR /> <H1 id="toc-hId-48044821">Sizing Information</H1><BR /> The <EM>Sizing Information</EM> (Fig. 7) covers only changing database accesses, specifically <CODE>INSERT</CODE>s, <CODE>DELETE</CODE>s, and <CODE>MODIFY</CODE>s. It estimates the impact of the corresponding SQL statements recorded in the trace on the data volume stored in the database. This provides important input for correctly sizing the storage capacity of the production system landscapes where the application will be executed.<BR /> Your storage system sizing must be based on a trace that covers the entire business process with all user interaction steps from end to end. Do not apply any filter conditions while recording the trace.<IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_SizingInformation-2.png" /><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 7: </STRONG>The <STRONG>Sizing Information </STRONG>calculates rough estimates for the change of the data volume stored in the database caused by the statements recorded in the trace. Uncertainties are produced by not knowing whether <CODE>MODIFY</CODE>s have added new rows or changed existing rows. Another source of uncertainty is related to table fields of types whose sizes are not statically predetermined.</P><BR /> The top of the <EM>Sizing Information</EM> contains the main characteristics of the system, identical to the top row in the <EM>Trace Overview</EM>&nbsp;(Fig. 6).<BR /> Section <EM>Number of <CODE>INSERT</CODE>s, <CODE>MODIFY</CODE>s, and <CODE>DELETE</CODE>s per Table</EM>&nbsp;alphabetically lists the database tables affected by <CODE>INSERT</CODE>, <CODE>DELETE</CODE>, or <CODE>MODIFY</CODE> statements, and shows the numbers of rows affected by statements in these categories. Because a <CODE>MODIFY</CODE> can either insert new rows into a database table or update existing rows, two values per table are calculated for the overall net number of changed rows: The difference of <CODE>INSERT</CODE>s and <CODE>DELETE</CODE>s considers all <CODE>MODIFY</CODE>s as updates of existing rows. This is a lower limit for the net number of rows created by the application. The opposite approach treats all <CODE>MODIFY</CODE>s as if they insert new rows: It uses the sum of <CODE>INSERT</CODE>s and <CODE>MODIFY</CODE>s minus the <CODE>DELETE</CODE>s to obtain an upper limit for the net number of new rows in each table. The <EM>Sizing Information</EM> does not consider <CODE>UPDATE</CODE>s because they never add rows to a database table.<BR /> The next area, <EM>Size of Tables, Primary Keys, and Secondary Indexes,</EM> summarizes the static sizes in Bytes of the changed tables, including their indexes. It also indicates whether tables or indexes contain fields of type <CODE>LRAW</CODE> (<CODE>X</CODE> in column <EM>LRAW</EM>) or of types <CODE>STRING</CODE>, <CODE>RAWSTRING</CODE>, or <CODE>TEXT</CODE>&nbsp;(<CODE>X</CODE> in column <EM>VAR</EM>). The size of the content of these fields is not known statically and taken to be 0, acting as a lower limit. Finally, this area contains the tables' descriptions from the ABAP data dictionary.<BR /> Based on this information, section <EM>Estimation of Data Volume Added</EM> approximates the change to the database's overall size by the statements recorded in the trace: For each table its length plus the lengths of its indexes are summed up. These table-specific sums are then multiplied by either number of changed rows (as explained above) and the resulting sets of products are totalled and given in Bytes, kBytes, and MBytes. Typically, these values are lower limits for the change in the stored data volume, but in some situations may be overestimates. To guard against negative consequences of storage system under-sizing, you should always consider them lower limits, and try to assess the additional impact of the table fields whose sizes are not statically known. From previous experience, you may know their average size in typical production systems.<BR /> <H1 id="toc-hId--148468684">Individual Records</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">So far, this blog post was all about aggregating several <EM>Trace Main Records</EM> that share some common properties. But you can also move in the opposite direction. For trace types SQL and BUF, the <EM>Trace Main Records</EM> are already combinations of individual <EM>Trace Single Records</EM>, which represent low-level operations involved in the processing of the database or buffer accesses. From the list of <EM>Trace Main Records</EM>, button <EM>Display Individual Records <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_IconIndividualRecords.png" height="18" width="22" /></EM> takes you to the <EM>Trace Single Records </EM>(Fig. 8). Table 5 explains the columns that are not in the <EM>Trace Main Records</EM>.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Aggregate_SingleRecords.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 8:</STRONG> The chronologically sorted list of <STRONG>Trace Single Records</STRONG> shows the individual trace records without any aggregation. The three selected entries contribute to the processing of one SQL statement, and are combined into one <STRONG>Trace Main Record</STRONG> with the <STRONG>Start Time</STRONG> of the first entry (cf. Fig. 1).</P><BR /> <BR /> <TABLE style="width: 100%;border-collapse: collapse" border="1"><CAPTION><STRONG>Table 5:</STRONG> <EM>Fields in the default layout of the list of <STRONG>Trace Single Records</STRONG>&nbsp;that are not also part of the <STRONG>Trace Main Records</STRONG>.</EM></CAPTION><BR /> <TBODY><BR /> <TR><BR /> <TD style="width: 16.88%"><EM>Instance Name</EM></TD><BR /> <TD style="width: 83.12%">Application server instance where the statement was triggered.</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 16.88%"><EM>Operation</EM></TD><BR /> <TD style="width: 83.12%">Operation that was executed.<BR /> (RFC, HTTP: <CODE>Client</CODE> or <CODE>Server</CODE>;<BR /> APC: executed action, protocol, path, port, sent and received data in Byte)</TD><BR /> </TR><BR /> <TR><BR /> <TD style="width: 16.88%"><EM>Return Code</EM></TD><BR /> <TD style="width: 83.12%">Return code of the executed operation.</TD><BR /> </TR><BR /> </TBODY><BR /> </TABLE><BR /> The <EM>Trace Single Records</EM> are sorted chronologically. The main value of this full resolution view on the trace records is mostly as an entry point to a technical analysis of how the database server or the buffers on the application server instances have handled table accesses via (Open) SQL statements. Investigations from a business logic perspective hardly ever work with the <EM>Trace Single Records</EM>.<BR /> <H1 id="toc-hId--344982189">Summary</H1><BR /> Compared to the default list of chronologically sorted <EM>Trace Main Records</EM>, <STRONG>the various aggregation levels offered by <CODE>ST05</CODE> greatly improve its capabilities to analyze traces</STRONG> in an efficient way.<BR /> <BR /> The high-level <EM>Trace Overview</EM> provides a very basic quality control of the trace recording. It can also identify performance bugs of the application, and it signals suspicious database accesses.<BR /> The <EM>Table Accesses</EM> view indicates with which tables your application works and what categories of statements it uses on these tables. Use it with your knowledge of the underlying business logic to detect unnecessary or expensive table accesses.<BR /> The list of <EM>Structure-Identical Statements</EM> focusses on statements with a common form and indicates slow statements or statements that are better handled by the application server instances' buffers. The list of <EM>Value-Identical Statements</EM> concentrates even stronger on redundant, therefore superfluous, statements with the same bind variable values. You must eliminate them to accelerate your application and to take load away from the central database server.<BR /> The <EM>Sizing Information</EM> has a different objective and supports the forecast of the required storage capacity by estimating how much the changing SQL statements of an application change the&nbsp; persisted data volume. 2023-05-17T11:23:04+02:00 https://community.sap.com/t5/technology-blogs-by-sap/st05-analyze-individual-trace-records/ba-p/13563513 ST05: Analyze Individual Trace Records 2023-06-30T11:40:01+02:00 ManfredMensch https://community.sap.com/t5/user/viewprofilepage/user-id/165193 This is—for the time being—the last blog post in my series <A href="https://blogs.sap.com/2023/02/24/use-st05-to-monitor-the-communication-of-the-abap-work-process-with-external-resources/" target="_blank" rel="noopener noreferrer">Use ST05 to Analyze the Communication of the ABAP Work Process with External Resources</A>. Previous blog posts in this sequence have mostly dealt with the <CODE>ST05</CODE> tool itself, or with complete traces recorded for an entire end-to-end business process or at least for a whole user interaction. Now it is time to focus on individual trace records, representing statements or communication events triggered by your application. Typically you want to concentrate on those with a long duration or with a high resource consumption. They have the biggest impact on your application's performance and scalability. You should direct your optimization efforts to them.<BR /> <BR /> The best entry point for such a project is the aggregated list of <EM>Structure-Identical Statements</EM> (Fig. 1). I have covered it in my post <A href="https://blogs.sap.com/2023/05/17/st05-aggregate-trace-records/" target="_blank" rel="noopener noreferrer">ST05: Aggregate Trace Records</A>. This list sorts the statements descending by their <EM>Duration</EM>. The overall slowest statements (considering all their aggregated executions) are at the top of the list. If you are more concerned about <EM>HANA CPU Time</EM> or <EM>HANA Memory</EM> consumption, re-sort the list according to these values. In any case, you want to work on the list's first few records.<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_StructureIdenticalRecords.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 1:</STRONG>&nbsp;The list of&nbsp;<STRONG>Structure-Identical Statements</STRONG> summarizes <STRONG>Trace Main Records</STRONG> for statements with the same structure, but potentially distinct values of bind variables. By default, the list is sorted descending by <STRONG>Duration</STRONG>. This list is the recommended starting point for an optimization project that focuses on the most expensive communication events triggered by your application.<BR /> The subsequent discussions use the marked SQL trace record as an example.</P><BR /> Before diving into a thorough analysis of how a statement was processed and how you can optimize it, ask yourself whether it is really required. If the statement contributes neither to your application's business logic nor to the technical frameworks employed by the application, you shall remove it. <STRONG>Elimination of unnecessary statements is always the best optimization strategy—and often the easiest.</STRONG> Statement tuning is meaningful only for essential statements.<BR /> <H1 id="toc-hId-833920840">Statement Details</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">The <EM>Statement</EM> field in all types of trace lists is always strongly abbreviated. For a trace record representing a statement that you have confirmed as essential for your application, you can display all of the statement's details by clicking button <EM>Statement </EM><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Analyze_IconDetails.png" height="18" width="22" />, available for the <EM>Trace Single Records</EM>, the <EM>Trace Main Records</EM>, the <EM>Structure-Identical Statements</EM>, and the <EM>Value-Identical Statements</EM>. Alternatively, double-click the <EM>Statement</EM> field. Fig. 2 shows the <EM>Statement Details</EM> of the SQL trace record marked in Fig. 1. (The result depends on the type of trace record.)<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/05/ST05_Analyze_StatementDetails-1.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 2:</STRONG> <STRONG>Statement Details</STRONG> for the SQL trace record highlighted in Fig. 1. The left panel shows the default option <STRONG>With Variable Names</STRONG> of button <STRONG>Statement</STRONG>. Bind variables are shown as question marks with an orange background. (Other database platforms may use different place holders.) Their types and values are listed separately in section <STRONG>Variables</STRONG>. The right panel displays the alternative <STRONG>With Variable Values</STRONG>, where the bind variables have been replaced by the actual values.<BR /> Navigation to the <STRONG>Statement Details</STRONG> from an aggregated trace record list (<STRONG>Structure-Identical Statements</STRONG> or <STRONG>Value-Identical Statements</STRONG>) takes specific values (e.g., for bind variables in the case of an SQL trace record) from the first contributing record.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">For an SQL trace record, the <EM>Statement Details</EM> display the SQL statement as it was sent from the ABAP work process to the database server for execution. The statement's implementation, e.g., as Open SQL, in your ABAP source code may be different (e.g., it will typically not have an explicite <CODE>WHERE</CODE> clause condition on the <CODE>MANDT</CODE> table field). This is the main benefit of the <EM>Statement Details</EM> display: It enables you to understand how the database interface in the ABAP work process interpreted your implementation, and what the database really had to do. As the application's developer you are familiar with its statements from the design time and implementation time perspective. The <EM>Statement Details</EM> give you the run time view which helps you to verify that the statement sent to and processed by the database fully matches the intended purpose.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">No measurement values (e.g., for elapsed time, consumed resources, or number of processed table rows) are included in the <EM>Statement Details</EM> for an SQL trace record. This also holds for BUF trace records, while details for trace records of the other types do include some measurements.</P><BR /> <BR /> <H1 style="margin-top: 0.5cm" id="toc-hId-637407335">DDIC Information</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">A full analysis and understanding of statements needs to consider the declarations and technical settings of the objects affected by them. For trace records of types SQL or BUF, a click on button <EM>DDIC Information <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_IconDDIC.png" height="18" width="19" /></EM>, or a double-click on the <EM>Object Name</EM> field, produces a summary of the <EM>ABAP Dictionary Information</EM> for the table or view (Fig. 3). If the trace record corresponds to an SQL statement that joins several tables, an intermediate popup enables you to select an individual table. From the <EM>ABAP Dictionary Information</EM>, button <EM>Display Table Fields</EM> takes you to the ABAP Data Dictionary transaction <CODE>SE11</CODE> to look at the complete declaration, including primary key fields, secondary indexes, and buffer settings. Or you jump immediately to either all available indexes, or to a selected index via buttons <EM>Display All Index Fields</EM> or <EM>Display Fields of Selected Index</EM>, respectively. For ENQ trace records, the lock object is shown in transaction <CODE>SE11</CODE>. DDIC information does not exist for the other trace types.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_DDIC-1.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 3:</STRONG> The <EM><STRONG>ABAP Dictionary Information</STRONG> s</EM>ummarizes a table's or view's declaration and technical settings as maintained in the ABAP Data Dictionary. From this summary, you can navigate into transaction <CODE>SE11</CODE> to see all details.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">Based on the <EM>DDIC Information</EM>, you can judge whether accesses to the object are really required for your application. When you combine the statement (e.g., as seen in the <EM>Statement Details</EM>) with the available indexes, you may recognize potential mismatches between the <CODE>WHERE</CODE> clause and the existing indexes. Such mismatches may cause excessive run time or resource consumption while processing the statement.</P><BR /> <BR /> <H1 style="margin-top: 0.5cm" id="toc-hId-440893830">ABAP Source Code</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">As already mentioned, the <EM>Statement Details</EM> show the SQL statement as executed by the database server. To compare this with how the statement was implemented in your application's source code, click on button <EM>ABAP Call Location</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_IconABAP.png" height="18" width="19" />. This takes you to the correct position in the appropriate tool of the ABAP development workbench (i.e., Class Builder <CODE>SE24</CODE>, Function Builder <CODE>SE37</CODE>, ABAP Editor <CODE>SE38</CODE>). There you can apply optimizations, locally to the source code or—after forward navigation into the ABAP Dictionary <CODE>SE11</CODE>—globally to the accessed object.</P><BR /> <BR /> <H1 style="margin-top: 0.5cm" id="toc-hId-244380325">ABAP Call Hierarchy</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">In my previous blog post <A href="https://blogs.sap.com/2023/02/24/st05-basic-use/" target="_blank" rel="noopener noreferrer">ST05: Basic Use</A> I have indicated that the immediate caller of the traced communication event may not be the ABAP source code location where you as a business application developer can apply optimizations. Rather, it may be nested inside some software framework called directly or indirectly by your application's ABAP code. To see the full ABAP call stack (Fig. 4) click button <EM>Call Hierarchy</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_IconCallHierarchy.png" height="18" width="19" />.<BR /> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_CallHierarchy.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 4:</STRONG> The&nbsp;<STRONG>ABAP Call Hierarchy</STRONG> for the SQL statement corresponding to the trace record marked in Fig. 1 indicates that only the ABAP events at levels 26 to 30 are specific to the business application. Everything else is framework coding.</P><BR /> Use the <EM>ABAP Call Hierarchy</EM> to verify that your application coding invokes the framework which eventually triggers the statement in the best possible way, and to confirm that calls from frameworks to your source code are fully optimized. Click on any entry in this list to navigate to the corresponding source code.<BR /> <H1 style="margin-top: 0.5cm" id="toc-hId-47866820">Data Access Strategy</H1><BR /> <P style="overflow: hidden;margin-bottom: 0px">For a deep understanding of an SQL statement's run time behavior—duration as well as resource consumption—you need a very close look at how the database server has executed the statement which you have formulated in a declarative rather than imperative way. Based on a detailed insight you can derive optimization strategies. Ideally, they work locally on the expensive statement so that they cannot have side effects on any other statement. Be very cautious with global changes to the table's or view's declaration, indexes or technical settings. They may improve the performance or resource consumption of the current statement, but may negatively impact other statements which also access the table or view.</P><BR /> <BR /> <H2 id="toc-hId--19563966">Execution Plan</H2><BR /> <P style="overflow: hidden;margin-bottom: 0px">The standard option <EM>Execution Plan </EM>(button <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_IconExecutionPlan.png" height="18" width="22" />) is available for all supported database platforms. Its upper area shows the SQL statement with variable names, and the lower area indicates, in a database specific format, how the database server has handled the statement. This part is often fairly terse and technical and already for only moderately complex statements not easy to digest.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_ExecutionPlan.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 5:</STRONG> The&nbsp;<STRONG>Execution Plan</STRONG> for the SQL statement corresponding to the trace record marked in Fig. 1 displays at the top the statement, similar to the option <STRONG>With Variable Names</STRONG> of the <STRONG>Statement Details</STRONG> (Fig. 2). This part is common to all supported database platforms. It is followed by the database specific representation of how the SQL statement was processed on the database server (here SAP HANA 2.00).</P><BR /> <P style="overflow: hidden;margin-bottom: 0px">The <EM>Execution Plan</EM> displays the nested hierarchy of the applied operations with their options and conditions and the objects on which they were used. The buttons offered in the application toolbar depend on the underlying database platform and may reveal some additional facts (e.g., estimates on the sizes of the involved tables and the sizes of the operation's output) which add significant analysis capabilities.</P><BR /> <BR /> <H2 id="toc-hId--216077471">SQL Analyzer Tool for SAP HANA</H2><BR /> <P style="overflow: hidden;margin-bottom: 0px">If your system uses SAP HANA, you are better off with the graphical <EM>SQL Analyzer Tool for SAP HANA</EM>. This requires that you have&nbsp;<A href="https://code.visualstudio.com/" target="_blank" rel="nofollow noopener noreferrer">Visual Studio Code</A> installed on your local machine and that you have the <A href="https://marketplace.visualstudio.com/items?itemName=SAPSE.vsc-extension-sa" target="_blank" rel="nofollow noopener noreferrer">SQL Analyzer Tool for SAP HANA</A> extension added to it. For a seamless integration with <CODE>ST05</CODE>, you also should set parameter <CODE>HDB_OPEN_STUDIO</CODE> (<EM>Open HANA Studio or SQL Analyzer when a Planviz is created</EM>) to <CODE>X</CODE> in your user profile, and set Visual Studio Code as the default app for <CODE>.plv</CODE> files. Then a click on <EM>HANA SQL Analyzer</EM> <IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_IconPlanViz.png" height="18" width="22" /> will create an appropriate plan file, download it to your local machine's hard disk (into your SAP GUI's documents folder), and from there open it with the extension <EM>SQL Analyzer Tool for SAP HANA</EM> (Figs. 6 and 7). Before the plan file creation, a popup asks you to specify (either confirm or overwrite) session variables. These are a kind of global variables set in the ABAP user context and forwarded from there to the database server where they control the execution of SQL statements. When analyzing an SQL statement in <CODE>ST05</CODE>, and creating its execution plan, the values for the session variables are retrieved from the <CODE>SET SESSION VARIABLE</CODE> statements which have defined the values and which are recorded together with the SQL statement that you are analyzing.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_SQLAnalyzer-1.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 6:</STRONG> The <STRONG>SAP HANA SQL Analyzer</STRONG> extension for <STRONG>Visual Studio Code</STRONG> is the tool of choice for understanding how the SAP HANA database has executed an SQL statement recorded in a trace. The <STRONG>Overview</STRONG> organizes significant information in dedicated cards.</P><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/06/ST05_Analyze_SQLAnalyzer_2.png" /></P><BR /> <P class="image_caption" style="font-style: italic;font-family: SAPRegular, 'Helvetica Neue', Arial, sans-serif;text-align: left"><STRONG>Figure 7:</STRONG> The <STRONG>Plan Graph</STRONG> in the <STRONG>HANA SQL Analyzer</STRONG> represents the execution of the SQL statement as a network graph of the involved plan operators and their connections.</P><BR /> The <EM>SQL Analyzer</EM>'s main section is the analysis view. Its three tabs support different perspectives on the SQL statement and its execution.<BR /> <UL><BR /> <LI>The <EM>Overview</EM> tab (Fig. 6) summarizes the most important information in several cards. The main cards for performance and scalability investigations are:<BR /> <UL><BR /> <LI><EM>Context</EM>:<BR /> Displays the statement with its conditions, variables, and parameters. <SPAN class="ui-provider fz b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr">For more detailed information, go to the&nbsp;<I>SQL</I> tab.</SPAN></LI><BR /> <LI><EM>Execution Summary</EM>:<BR /> <SPAN class="ui-provider fz b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr">Provides details such as compilation and execution times, peak memory usage, number of operators, and connections.</SPAN></LI><BR /> <LI><EM>Dominant Plan Operators</EM>:<BR /> Lists the top 5 operators by execution time.</LI><BR /> <LI><EM>Data Usage</EM>:<BR /> Shows the size of the result set and the number of accessed tables.</LI><BR /> </UL><BR /> </LI><BR /> <LI>The <EM>Plan Graph</EM> tab (Fig. 7) provides a visualization of the SQL query plan. It shows the data flow from bottom to top: Data retrieval from tables is at the bottom, and the query result is at the top. Along the path, plan operators achieve the transformations to obtain the desired output. Operators working concurrently, i.e., in parallel, are positioned next to each other. Nodes in the <EM>Plan Graph</EM> represent physical or logical operators, and contain associated information, especially a breakdown of the operator's execution time. The edges connecting the nodes indicate the number of rows transferred between the two operators. The critical path is determined by the chain of operators with the biggest impact on the query performance. Its edges are shown in red.</LI><BR /> <LI>The <EM>SQL</EM> tab shows the SQL statement with the full session context and the parameters with their types and values. With this information, the SQL query can be re-executed under identical conditions.</LI><BR /> </UL><BR /> The property pane below the analysis view contains 8 tabs where you can focus on small details of the statement's execution to get a very thorough understanding and to discover optimization approaches.<BR /> <H1 style="margin-top: 0.5cm" id="toc-hId--541673695">Summary</H1><BR /> With a monitoring tool like my transaction <CODE>STATS</CODE> (refer to my blog post&nbsp;<A href="https://blogs.sap.com/2021/12/23/measure-your-applications-performance-and-resource-consumption-evaluate-statistics-records-with-transaction-stats/" target="_blank" rel="noopener noreferrer">Measure your Application’s Performance and Resource Consumption: Evaluate Statistics Records with Transaction STATS</A> for an introduction) you may discover that your application's performance is insufficient. Maybe your application is too slow or its resource consumption is too high. In either case, <CODE>STATS</CODE> may indicate that the poor performance is caused by communication events triggered by your application. Then you would use my transaction <CODE>ST05</CODE> to record a corresponding trace. Your application's most expensive communication events will be at the top of the appropriately sorted trace list—ideally you work with the list of <EM>Structure-Identical Statements</EM>. With the various tools offered by <CODE>ST05</CODE> you can<BR /> <UL><BR /> <LI>gain insight into the significance of the event for your application</LI><BR /> <LI>inspect the statement's implementation in the ABAP source code</LI><BR /> <LI>recognize the ABAP call stack that eventually triggered the event</LI><BR /> <LI>review the database tables or views on which the statement operates</LI><BR /> <LI>examine the statement as it was processed</LI><BR /> </UL><BR /> Based on this comprehensive information, you can derive optimization strategies which will improve your application's performance.<BR /> <H1 style="margin-top: 0.5cm" id="toc-hId--738187200">References</H1><BR /> The official documentation for the SAP HANA SQL Analyzer is available at <A href="https://help.sap.com/docs/HANA_SQL_ANALYZER/d1a813bf1e334989a33c0364cbb9dffa/e5681cd520e94c308e4c2594b2ad5db8.html?state=DRAFT" target="_blank" rel="noopener noreferrer">SQL Analyzer Tool for SAP HANA Guide</A>.<BR /> The&nbsp;<A href="https://help.sap.com/doc/e344ef1295b6433e88fe084c0768e1cd/2.0.07/en-US/SAP_HANA_Troubleshooting_and_Performance_Analysis_Guide_en.pdf" target="_blank" rel="noopener noreferrer">SAP HANA Troubleshooting and Performance Analysis Guide</A> might also be helpful.<BR /> The Open SAP course <A href="https://open.sap.com/courses/hanasql1" target="_blank" rel="noopener noreferrer">A First Step Towards SAP HANA Query Optimization</A> covers further techniques for SQL query performance analyses and optimizations. 2023-06-30T11:40:01+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/azure-monitor-for-sap-solutions-one-stop-shop-for-sap-technical-monitoring/ba-p/13572481 Azure Monitor for SAP solutions One-stop-shop for SAP technical monitoring 2024-01-04T09:19:34+01:00 Lakshhma https://community.sap.com/t5/user/viewprofilepage/user-id/176052 Are you an SAP Customer/Partner/ISV seeking a seamless monitoring solution? In this blog, I introduce Microsoft's latest Monitoring solution—Azure Monitor for SAP Solutions—a user-friendly and plug-and-play tool.<BR /> <OL><BR /> <LI>What is Azure Monitor for SAP Solutions?</LI><BR /> <LI>What is the architecture?</LI><BR /> <LI>What can you monitor?</LI><BR /> <LI>What are the other key capabilities of AMS?</LI><BR /> <LI>What are pricing and regions available?</LI><BR /> </OL><BR /> <STRONG>1. What is Azure Monitor for SAP Solutions?</STRONG><BR /> <BR /> Azure Monitor for SAP solutions is a comprehensive technical monitoring tool tailored for businesses leveraging SAP applications on Microsoft Azure. This turnkey solution facilitates the collection of telemetry data from SAP NetWeaver, databases, Linux Pacemaker clusters, and Linux operating systems. Centralized within the Azure portal, this tool streamlines visual correlation and rapid troubleshooting, requiring just a few minutes for configuration without the need for customer infrastructure deployment or maintenance.<BR /> <BR /> <STRONG>2. What is the architecture?</STRONG><BR /> <BR /> The following diagram shows, at a high level, how Azure Monitor for SAP solutions.<BR /> <BR /> &nbsp;<BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/12/azure-monitor-sap-architecture.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">AMS Architecture</P><BR /> <BR /> <UL><BR /> <LI><STRONG>Monitoring SAP Systems:</STRONG> Azure Monitor for SAP solutions allows monitoring of multiple components across various SAP systems in a virtual network.</LI><BR /> <LI><STRONG>Configurable Providers:</STRONG> Configure providers for different components (e.g., HANA database, HA cluster, NetWeaver, DB2 and OS) to collect data.</LI><BR /> <LI><STRONG>Key Architecture Components:</STRONG><BR /> <UL><BR /> <LI>Azure Portal: Access point.</LI><BR /> <LI>Monitor Resource: Displays monitoring data.</LI><BR /> <LI>Managed Resource Group: Automatic deployment with Azure Functions, Key Vault, Log Analytics Workspace, and Storage Account.</LI><BR /> </UL><BR /> </LI><BR /> <LI><STRONG>Visualization and Querying:</STRONG><BR /> <UL><BR /> <LI>Azure Monitor workbooks for customizable visualizations. Pin items to the Azure dashboard for auto-refresh (max every 30 minutes).</LI><BR /> <LI>Use Kusto Query Language (KQL) for log queries in Log Analytics.</LI><BR /> <LI>Detailed Architecture is available at <A href="https://learn.microsoft.com/en-us/azure/sap/monitor/about-azure-monitor-sap-solutions#what-is-the-architecture" target="_blank" rel="nofollow noopener noreferrer">What is Azure Monitor for SAP solutions?</A></LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> <STRONG>3. What can you monitor?</STRONG><BR /> <UL><BR /> <LI><STRONG>SAP HANA</STRONG><BR /> <UL><BR /> <LI>CPU, memory, disk, and network use</LI><BR /> <LI>HANA system replication</LI><BR /> <LI>HANA backup</LI><BR /> <LI>HANA host status</LI><BR /> <LI>Index server and name server roles</LI><BR /> <LI>Database growth</LI><BR /> <LI>Top tables</LI><BR /> <LI>File system use</LI><BR /> </UL><BR /> </LI><BR /> <LI><STRONG>SAP NetWeaver</STRONG><BR /> <UL><BR /> <LI>SAP system and application server availability, including instance process availability of:<BR /> <UL><BR /> <LI>Dispatcher</LI><BR /> <LI>ICM</LI><BR /> <LI>Gateway</LI><BR /> <LI>Message server</LI><BR /> <LI>Enqueue server</LI><BR /> <LI>IGS Watchdog</LI><BR /> </UL><BR /> </LI><BR /> <LI>Work process usage statistics and trends</LI><BR /> <LI>Enqueue lock statistics and trends</LI><BR /> <LI>Queue usage statistics and trends</LI><BR /> <LI>SMON metrics (/SDF/SMON)</LI><BR /> <LI>SWNC workload, memory, transaction, user, and RFC usage (St03n)</LI><BR /> <LI>Short dumps (ST22)</LI><BR /> <LI>Object lock (SM12)</LI><BR /> <LI>Failed updates (SM13)</LI><BR /> <LI>System log analysis (SM21)</LI><BR /> <LI>Batch job statistics (SM37)</LI><BR /> <LI>Outbound queues (SMQ1)</LI><BR /> <LI>Inbound queues (SMQ2)</LI><BR /> <LI>Transactional RFC (SM59)</LI><BR /> <LI>STMS change transport system metrics (STMS)</LI><BR /> </UL><BR /> </LI><BR /> <LI><STRONG>HA Pacemaker Cluster</STRONG><BR /> <UL><BR /> <LI>Node, resource, and SBD status</LI><BR /> <LI>Pacemaker location constraints</LI><BR /> <LI>Quorum votes and ring status</LI><BR /> <LI>Also see the metrics specification for ha_cluster_exporter.</LI><BR /> </UL><BR /> </LI><BR /> <LI><STRONG>OS (Linux)</STRONG><BR /> <UL><BR /> <LI>CPU use, fork count, running processes, and blocked processes.</LI><BR /> <LI>Memory use and distribution among used, cached, and buffered.</LI><BR /> <LI>Swap use, paging, and swap rate</LI><BR /> <LI>File system usage, along with number of bytes read and written per block device.</LI><BR /> <LI>Read/write latency per block device.</LI><BR /> <LI>Ongoing I/O count and persistent memory read/write bytes.</LI><BR /> <LI>Network packets in/out and network bytes in/out</LI><BR /> </UL><BR /> </LI><BR /> <LI><STRONG>IBM Db2 &amp; Microsoft SQL Server</STRONG><BR /> <UL><BR /> <LI>Database availability</LI><BR /> <LI>Number of connections, logical reads, and physical reads</LI><BR /> <LI>Waits and current locks.</LI><BR /> <LI>CPU, memory, and disk use</LI><BR /> <LI>Host name, SQL instance name, and SAP system ID</LI><BR /> <LI>Batch requests, compilations, and page life expectancy over time</LI><BR /> <LI>Top 10 most expensive SQL statements over time</LI><BR /> <LI>Top 12 largest tables in the SAP system</LI><BR /> <LI>Problems recorded in the SQL Server error log.</LI><BR /> <LI>Blocking processes and SQL wait statistics over time.</LI><BR /> </UL><BR /> </LI><BR /> </UL><BR /> <STRONG>4. What are the other key capabilities of AMS?</STRONG><BR /> <UL><BR /> <LI>The <STRONG>SAP Landscape Monitor</STRONG> is a one-stop destination to learn about the health of your entire SAP landscape. You can create a group of SAP systems based on the environment (e.g., Development, Production, etc.), application (e.g., ERP), or criticality and see the health of these systems based on the alerts that have been raised. You can also check alerts triggered by a group or a specific SAP system.</LI><BR /> </UL><BR /> <P style="overflow: hidden;margin-bottom: 0px"><IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/blog_attachments/2023/12/Screenshot-2023-12-29-013227.png" /></P><BR /> <P class="image_caption" style="text-align: center;font-style: italic">AMS Landscape Monitor</P><BR /> <BR /> <H4 id="toc-hId-1222061981"><STRONG>5. What are Pricing and regions available</STRONG></H4><BR /> <UL><BR /> <LI>There is no licensing fee for Azure Monitor for SAP solutions. Customers pay for the infrastructure components that are deployed as part of the managed Azure Resource Group. Standard Azure prices are applicable for Azure Functions (Premium Linux), Azure Log Analytics, Storage, Key Vault, alerts, and notification groups.</LI><BR /> <LI>Azure Monitor for SAP solutions is available in East US, East US 2, West US, West US 2, West US 3, Central US, South Central US, North Central US, West Central US, West Europe, North Europe, Australia Central, Australia East, Australia Southeast, South India, Southeast Asia, and East Asia.</LI><BR /> </UL><BR /> <H4 id="toc-hId-1025548476"><SPAN style="font-weight: bold;background: white">Learn more!</SPAN></H4><BR /> <UL><BR /> <LI><SPAN style="color: #333333;background: white">To learn more, read </SPAN><A href="https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/azure-monitor-overview" target="_blank" rel="nofollow noopener noreferrer"><SPAN style="background: white">documentation</SPAN></A><SPAN style="color: #333333;background: white">&nbsp;or watch&nbsp;</SPAN><A href="https://aka.ms/AMSOverviewVideo" target="_blank" rel="nofollow noopener noreferrer"><SPAN style="background: white">overview</SPAN></A><SPAN style="color: #333333;background: white">&nbsp;and&nbsp;</SPAN><A href="https://aka.ms/AMSDemoVideo" target="_blank" rel="nofollow noopener noreferrer"><SPAN style="background: white">demo</SPAN></A><SPAN style="color: #333333;background: white">&nbsp;video.</SPAN></LI><BR /> <LI><SPAN style="color: #333333;background: white">To get started, head over to&nbsp;</SPAN><A href="https://aka.ms/amspublicpreview" target="_blank" rel="nofollow noopener noreferrer"><SPAN style="background: white">Microsoft Azure portal</SPAN></A><SPAN style="color: #333333;background: white">&nbsp;and create your first resource.&nbsp;</SPAN></LI><BR /> <LI><SPAN style="color: #333333;background: white">Share your thoughts and feedback.&nbsp;</SPAN></LI><BR /> </UL><BR /> &nbsp; 2024-01-04T09:19:34+01:00 https://community.sap.com/t5/technology-blogs-by-members/basis-monitoring-amp-tcodes-with-key-notes/ba-p/13591678 Basis Monitoring & Tcodes with Key notes 2024-02-05T14:25:53.980000+01:00 Williams43 https://community.sap.com/t5/user/viewprofilepage/user-id/779356 <P>Hi All,&nbsp;</P><P>I am thrilled to have the opportunity to connect with all of you through this blog.</P><P>The purpose of this blog is to aid newcomers in Basis in gaining knowledge about Basis-related Tcodes, including key notes and their usage and frequency.</P><P>I believe this will be beneficial for those who are beginning their careers in SAP Basis.</P><P>I wish you good luck and welcome to SAP Basis Team</P><P>The Daily Monitoring Basis-related Tcodes, their uses, and their related Tcodes are utilised for any future investigation.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_0-1706804899073.png" style="width: 744px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58793i4CB3310AB78C7F03/image-dimensions/744x591?v=v2" width="744" height="591" role="button" title="Williams43_0-1706804899073.png" alt="Williams43_0-1706804899073.png" /></span></P><P>Tcodes that pertain to operating systems and databases, their usage, and any future process.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_1-1706804947991.png" style="width: 742px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58794i7E5F56EA3241CB97/image-dimensions/742x365?v=v2" width="742" height="365" role="button" title="Williams43_1-1706804947991.png" alt="Williams43_1-1706804947991.png" /></span></P><P>The SAP Basis Admin is accountable for tuning performance. These Tcodes are associated with performance analysis at the application level.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_2-1706805022361.png" style="width: 746px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58795i8A61F0C50689AC15/image-dimensions/746x389?v=v2" width="746" height="389" role="button" title="Williams43_2-1706805022361.png" alt="Williams43_2-1706805022361.png" /></span></P><P>Ticketing tools vary widely between organizations, including SAP ITSM (SOLMAN), Non SAP (ServiceNow, Zendesk), and others.</P><P>User Management, Role Management, and Transport Management will receive the majority of daily ticketing. Here are the Tcodes that pertain to these areas.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_3-1706805139574.png" style="width: 744px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58796i2E0110DFFF1343D9/image-dimensions/744x331?v=v2" width="744" height="331" role="button" title="Williams43_3-1706805139574.png" alt="Williams43_3-1706805139574.png" /></span></P><P>Tcodes that pertain to SAP Software Maintenance and related OS and other tasks.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_4-1706805213692.png" style="width: 744px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58797i9884C518C59B06AB/image-dimensions/744x536?v=v2" width="744" height="536" role="button" title="Williams43_4-1706805213692.png" alt="Williams43_4-1706805213692.png" /></span></P><P>Programs that are useful for administrative tasks related to Basis.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Williams43_5-1706805251462.png" style="width: 742px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/58798i23076894A6D415DC/image-dimensions/742x407?v=v2" width="742" height="407" role="button" title="Williams43_5-1706805251462.png" alt="Williams43_5-1706805251462.png" /></span></P><P>Thank you for taking the time to read the blog.</P><P>&nbsp;</P><P>#SAPBasis #Basis <a href="https://community.sap.com/t5/c-khhcw49343/Basis+Technology/pd-p/7bf2eaed-4604-44ae-bad7-d2d2d5c58c54" class="lia-product-mention" data-product="1129-1">Basis Technology</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/EWM+-+Basis/pd-p/192798129450263425409096799593312" class="lia-product-mention" data-product="941-1">EWM - Basis</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/NW+ABAP+Monitoring+Tools/pd-p/a414317d-3ddc-487c-9d84-af75d27c65f6" class="lia-product-mention" data-product="1010-1">NW ABAP Monitoring Tools</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+EarlyWatch+Alert/pd-p/f811a31e-b1e7-42ac-9f17-9051d8410d93" class="lia-product-mention" data-product="1192-1">SAP EarlyWatch Alert</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+HANA+Cloud%25252C+SAP+HANA+database/pd-p/ada66f4e-5d7f-4e6d-a599-6b9a78023d84" class="lia-product-mention" data-product="40-1">SAP HANA Cloud, SAP HANA database</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+Advantage+Database+Server/pd-p/67838200100800005437" class="lia-product-mention" data-product="393-1">SAP Advantage Database Server</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/Oracle+Database/pd-p/266216885309448000234589693334884" class="lia-product-mention" data-product="258-1">Oracle Database</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA/pd-p/73554900100800000266" class="lia-product-mention" data-product="799-1">SAP S/4HANA</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+NetWeaver+Application+Server+for+SAP+S%25252F4HANA/pd-p/73554900100800000376" class="lia-product-mention" data-product="736-1">SAP NetWeaver Application Server for SAP S/4HANA</a>&nbsp; #Dailymonitoring <a href="https://community.sap.com/t5/c-khhcw49343/NW+Java+Security+and+User+Management/pd-p/837756977247372160663651537216525" class="lia-product-mention" data-product="1021-1">NW Java Security and User Management</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/Defense+and+Security/pd-p/159367983329805292011158" class="lia-product-mention" data-product="275-1">Defense and Security</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SOLMAN+Setup%25252FConfiguration%25252FLMDB/pd-p/773921536755532122004239005965168" class="lia-product-mention" data-product="1098-1">SOLMAN Setup/Configuration/LMDB</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/NW+ABAP+Monitoring+Tools/pd-p/a414317d-3ddc-487c-9d84-af75d27c65f6" class="lia-product-mention" data-product="1010-2">NW ABAP Monitoring Tools</a>&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SOLMAN+System+Monitoring/pd-p/212358834767912649313917434384826" class="lia-product-mention" data-product="1099-1">SOLMAN System Monitoring</a>&nbsp;</P> 2024-02-05T14:25:53.980000+01:00