You can optimize SQL statements extracted by SQL Scanner using SQL Optimizer. SQL Optimizer supports single INSERT, UPDATE, SELECT, DELETE, or MERGE SQL statements.
To send a statement to SQL Optimizer
Create a scan job using the Add Scanner Jobs wizard.
Select a group in the Scanner node in the Task pane.
Select a scan job from the Group node.
Select the SQL statement in the Job List pane.
Click in the SQL Text pane.
Notes:
Find SQL helps you locate the most resource-intensive SQL in your server. It evaluates existing SQL performance by different statistics (such as CPU time and elapsed time) from different areas (such as batches and database objects).
Note: The Find SQL from Plan Cache module supports only SQL Server 2005 (Service Pack 2) or later.
Additionally, you can:
To create a new Plan Cache search session
Select Find SQL.
Note: If you are creating your first search session, select Click here to start find SQL and select a connection. Then select Click to start finding SQL in Plan Cache.
The Add Plan Cache Search dialog opens. Select criteria for collecting SQL. Review the following for additional information:
Criteria to collect SQL | Description |
Databases |
Click the link and select from the following options:
|
Select the number of SQL to retrieve |
Click the link to specify the number of SQL and the retrieval method. Note: The second option allows you to specify the number of SQL according to a specific criterion. |
A search progress bar displays next to the search name during the search process. The following information and options are displayed in the Find SQL from Plan Cache pane.
Start a new search |
Select to begin a new search and to display the Criteria to collect SQL dialog box. |
Search name |
Name you have given to your search. Click to open the dashboard-style Search Result page for this search. Notes:
|
Status |
Displays status of search:
|
Show all Plan Cache searches in this server |
Select to display all the searches you have conducted on the selected server. Note: Right-click the search to delete the selected search. |
When the search is finished, a dashboard-style Search Results page displays.
Click a pie chart to view the top-consuming SQL for that resource. Each pie chart represents a different view of the most-expensive (top-consuming) SQL. In each view, the SQL statements are filtered by a different resource consumed and by a different SQL location.
Find SQL from SQL Trace/Extended Events allows you to extract SQL statements and their performance statistics from trace files or trace tables collected by SQL Profiler. It also allows you to extract SQL statements and their performance statistics from Extended Event files. You can identify the most resource-intensive SQL statements.
Additionally, you can:
To create a new SQL Trace/Extended Event search session
Select Find SQL.
Note: If you are creating your first search session, select Click here to start find SQL and select a connection. Then select Click to start finding SQL in SQL Trace/Extended Event search.
The Add SQL Trace/Extended Event Search dialog opens. Select a trace file, table, or extended events. Review the following for more information:
Notes:
Add from Trace Files |
Click to add SQL from trace files. |
Add from Trace Tables |
Click to add SQL from trace tables. The Add Trace Table dialog opens. Select a connection.
Then select a trace table. Note: Find SQL requires certain event columns in your trace in order to analyze it. For convenience, SQL Optimizer provides trace templates for you to use. These template files are located in the Find SQL - Trace Templates folder in the SQL Optimizer installation directory. |
Add from Extended Events | Click to add SQL from Extended Event files |
Show Collect Criteria |
Click to filter the SQL to collect. You can filter by:
|
A search progress bar displays next to the search name during the search process. The following information and options are displayed in the Find SQL from SQL Trace/Extended Event pane.
Start a new search |
Select to begin a new search and to display the Add SQL Trace/Extended Event Search dialog box. |
Search name |
Name you have given to your search. Click to open the dashboard-style Search Result page for this search. Notes:
|
Status |
Displays status of search:
|
Show all SQL Trace/Extended Event searches in this server |
Select to display all the searches you have conducted on the selected server. Note: Right-click the search to delete the selected search. |
When the search is finished, a dashboard-style Search Results page displays.
Click a pie chart to view the top-consuming SQL for that resource. Each pie chart represents a different view of the most-expensive (top-consuming) SQL. In each view, the SQL statements are filtered by a different resource consumed and by a different SQL location.
Find SQL requires certain event columns in your trace in order to analyze it. For your convenience, SQL Optimizer provides trace template files (.tdf) for you to use. The template files are located in the Find SQL - Trace Templates folder in the SQL Optimizer installation directory.
If you create your own template, make sure it defines the events and columns listed in the following table.
Methods for setting up SQL Trace | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use trace templates provided by SQL Optimizer |
Use trace templates provided by SQL Optimizer to collect SQL. You can locate the templates in the installation directory. | ||||||||||||||||||||||||
Use your own templates |
Ensure that the following trace events and columns are captured.
|
Find SQL requires certain event columns in your extended events in order to analyze it. For your convenience, SQL Optimizer provides Extended Event template files (.tdf) for you to use. The template files are located in the Find SQL - Extended Event Templates folder in the SQL Optimizer installation directory.
If you create your own template, make sure it defines the events and columns listed in the following table.
Methods for setting up Extended Events | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use extended event templates provided by SQL Optimizer |
Use extended event templates provided by SQL Optimizer to collect SQL. You can locate the templates in the installation directory. | ||||||||||||||||||||||||||||||||||||
Use your own templates |
Ensure that the following trace events and columns are captured.
|
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center