0% found this document useful (0 votes)
2 views

SQL Server Profiler Trace

The document provides a step-by-step guide on how to run a SQL Server Profiler trace to troubleshoot performance issues in Archer applications. It highlights that slow performance may be due to a bad data query plan and requires elevated rights on the SQL Server. The guide includes detailed SQL commands and instructions for capturing and analyzing the trace results to identify problematic stored procedures.

Uploaded by

balejandreg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SQL Server Profiler Trace

The document provides a step-by-step guide on how to run a SQL Server Profiler trace to troubleshoot performance issues in Archer applications. It highlights that slow performance may be due to a bad data query plan and requires elevated rights on the SQL Server. The guide includes detailed SQL commands and instructions for capturing and analyzing the trace results to identify problematic stored procedures.

Uploaded by

balejandreg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

21/2/25, 3:37 p.m.

How to Run a SQL Server Profiler Trace to Troubleshoot Archer Performance Issues

Home (/s/) Archer Academy (/s/archer-academy) Products (/s/products)


Search... Support (/s/archer-support)
Search

Oct 5, 2023 Knowledge

Title
How to Run a SQL Server Profiler Trace to Troubleshoot Archer Performance Issues

Applies To
Product(s): Archer Version(s): All Versions Primary Deployment: On Premises

Description
How to run a SQL Trace to troubleshoot Archer performance issues.

For some Archer users, opening or saving Archer content records is very slow for some applications, but not all. This can be caused by a bad data query plan associated with
a SQL stored procedure. Running a SQL Trace may help identify the stored procedure(s).

NOTE: Running a SQL trace requires elevated rights on the SQL Server. Please reach out to your SQL DBA to run the trace.

Cause

Resolution
1. Run the following SQL command to get session id from a list of users logged into Archer.

SELECT s.sessionId, s.userId AS UserId, lc.user_domain AS Domain, u.user_username AS UserName,


u.user_display_name AS DisplayName
, uv.xuserconttype_value AS DefaultEmail
, ut.user_type_name AS UserType
, uv.sec_prm_name AS SecurityParameter
, CONVERT(varchar,(GETUTCDATE() - s.create_date),108) AS TimeIn
, CONVERT(varchar,(GETUTCDATE() - s.session_Timestamp),108) AS TimeIdle
, CAST(CASE WHEN GETUTCDATE() > s.session_Expires THEN 'Expired' ELSE CONVERT(varchar,(s.session_Expires -
GETUTCDATE()),108) END AS varchar) AS TimeLeft
, s.create_date AS LoginTime, s.session_Timestamp AS LastActivity, s.session_Expires AS Expires
, uv.logged_in AS IsLoggedIn, s.is_impersonated AS IsImpersonated
FROM tblSession s WITH ( NOLOCK )
LEFT JOIN tblUser u ON u.user_id = s.userId
LEFT JOIN viewUserList uv WITH ( NOLOCK ) ON uv.user_id = s.userId
LEFT JOIN tblUserType ut WITH ( NOLOCK ) ON ut.user_type_id = u.user_type_id
LEFT JOIN tblLdapConfig lc WITH(NOLOCK) ON lc.config_id = u.ldap_config_id
WHERE uv.logged_in = 1 AND uv.is_impersonated = 0 AND u.user_type_id IN (1,3)

2. Copy the sessionId from results.


3. From SQL Management Studio, open SQL Server Profiler.
4. From the Events Selection tab, enable the Show all columns option.
5. From the Events Selection tab, select the Stored Procedures RPC: Completed event and all columns.

https://www.archerirm.community/s/article/How-to-Run-a-SQL-Server-Profiler-Trace-to-Troubleshoot-Archer-Performance-Issues 1/4
21/2/25, 3:37 p.m. How to Run a SQL Server Profiler Trace to Troubleshoot Archer Performance Issues

6. Click the Column Filters button and select TextData.


7. Expand the Like option and paste the session id within percent signs: %sessionid%

8. Confirm the end user is ready to reproduce the issue.


9. Click the Run button.
10. Reproduce the issue while the trace is running.
11. After reproducing the issue, wait one minute to make sure all traffic was captured.
12. Stop the trace.
13. Save the trace to a trace file (.trc).
14. In the results, check the Duration column for any rows running a long time. NOTE: the time is in milliseconds.
15. The TextData value will contain the name of the SQL stored procedure.
16. From SQL Management Studio, open a new query window.
17. For each stored procedure taking a long time, clear the bad data query plan by running the following SQL command after replacing "stored procedure name".

sp_recompile 'stored procedure name'

Workaround

URL Name
How-to-Run-a-SQL-Server-Profiler-Trace-to-Troubleshoot-Archer-Performance-Issues

Was this article helpful? 0 0

https://www.archerirm.community/s/article/How-to-Run-a-SQL-Server-Profiler-Trace-to-Troubleshoot-Archer-Performance-Issues 2/4
21/2/25, 3:37 p.m. How to Run a SQL Server Profiler Trace to Troubleshoot Archer Performance Issues

Question

What would you like to know? Ask

Sort by:

Most Recent Activity Search this feed...

Collaborate here!
Here's where you start talking with your colleagues about this record.

Follow

Files (0) (/s/relatedlist/ka0VM000000OcnJYAS/AttachedContentDocuments)

Related Articles

Identifying and Resolving Issues with Archer History Log Fields (/s/article/Identifying-and-Resolving-Issues-with-Archer-History-Log-Fields) 361

Intermittent Login Issue with The Error 'Validation of Viewstate MAC Failed' in a Web Farm in Archer (/s/article/Intermittent-Login-Issue-with-The-Error-Validation-of-Viewstate-MAC-Failed-
285
in-a-Web-Farm-in-Archer)

Intermittent Issue Where Notifications Are Not Triggered in Archer (/s/article/Intermittent-Issue-Where-Notifications-Are-Not-Triggered-in-Archer) 158

How to Replace The Advanced Workflow SSL Certificate in Archer (/s/article/How-to-Replace-The-Advanced-Workflow-SSL-Certificate-in-Archer) 927

How to Run SQL Server Profiler Trace for a Specific Archer Job (/s/article/How-to-Run-SQL-Server-Profiler-Trace-for-a-Specific-Archer-Job) 191

Trending Articles
Introducing the Next Generation User Experience
(/s/article/Introducing-the-Next-Generation-User-Experience)

Installer is Hanging (script 239 of 253) in Archer


(/s/article/Installer-is-Hanging-script-239-of-253-in-Archer)

How to Use Modern Authentication in Archer


(/s/article/How-to-Use-Modern-Authentication-in-Archer)

https://www.archerirm.community/s/article/How-to-Run-a-SQL-Server-Profiler-Trace-to-Troubleshoot-Archer-Performance-Issues 3/4
21/2/25, 3:37 p.m. How to Run a SQL Server Profiler Trace to Troubleshoot Archer Performance Issues

How to Add a Line Break Between Fields/Values in the CONCATENATE function within a Calculation
(/s/article/How-to-Add-a-Line-Break-Between-Fields-Values-in-the-CONCATENATE-function-within-a-Calculation)

Package Mapping Error 'The source file cannot be read, The file may be missing or corrupt'
(/s/article/Package-Mapping-Error-The-source-file-cannot-be-read-The-file-may-be-missing-or-corrupt)

ADDRESS ABOUT ARCHER CUSTOMERS

13200 Metcalf Ave Events (https://www.archerirm.com/events) Support (https://www.archerirm.community/s/archer-support)


Suite 300 Resources (https://www.archerirm.com/resources) Archer Exchange (https://www.archerirm.com/archer-exchange)
Overland Park, KS 66213 About Us (https://www.archerirm.com/about-us) Archer Academy (https://www.archerirm.community/s/archer-academy)

(https://www.linkedin.com/company/archer-integrated-risk- (https://www.twitter.com/ArcherI (https://www.youtube.com/channel/UChGLiMjPX1KKXH_IMRQx


management/) RM) 8wQ)

Privacy Policy (https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.archerirm.com%2Fcompany%2Fprivacy-


4b7a442289016d276a5%7C0%7C0%7C638711776221886055%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIs
Archer is a leading provider of enterprise risk management solutions, which include third party risk management, IT risk management, operational risk management, ESG, and more.

https://www.archerirm.community/s/article/How-to-Run-a-SQL-Server-Profiler-Trace-to-Troubleshoot-Archer-Performance-Issues 4/4

You might also like