SQL Server Profiler (Profiler) helps database administrators track specific events that are performed by SQL Server databases, monitors the behavior of the database, and saves these valuable information to a file or table for later analysis to resolve problems with the database. Optimizes the performance of the database engine. This step-by-step article describes how to use SQL Server Profiler to create the entire process of SQL Server tracing.
To create a trace:
1, first from the Start menu point to All Programs, open SQL Server Management Studio.
2, choose Profiler from the Tools menu.
3. When the profiler main interface is open, select New Trace from the File menu.
4. At this point, SQL Server Profiler prompts you to connect to the instance of SQL Server where you want to sniff the trace. To provide the required details for the connection, click the "Connect" button to continue.
5. In the "Tracking name" text box, enter the name of the trace you want to create for this trace.
6. Select a template for the trace you created from the "template name" Drop-down menu. (The following tips will use information about the purpose of the common trace template).
7. Select the "Save to File" option to save the trace you created to a file on your local hard drive. After clicking the check box, enter a filename and its location in the "Save as" window that pops up.
8. Click on the "Events" tab to view the events you want to follow up in the tracking plan you created. Depending on the template you choose, the system will automatically select some events, but you can modify these default option settings. Look at other options by clicking the Show All events and show all columns check boxes.
9, click the "Run" button to start tracking. SQL Server starts creating the trace and displays the trace details in the saved file. When you are finished running, choose Stop Tracing from the File menu.
Tips:
1, the trace template option provides a "standard" (Standard) template for capturing a large amount of information about SQL Server connections, stored procedures, and Transact-SQL statements.
2, the tuning template is used to capture information that can be used by Database Engine Tuning Advisor to optimize SQL Server performance.
3, the "TSQL_Replay" template is used to capture the details of all Transact-SQL statements needed to rerun this trace in the future.