Proper tuning of a relational database requires knowing how the database is used on a regular basis. SQL Server Profiler is a graphical tool that allows system administrators to monitor engine events in SQL Server by capturing a continuous record of server activity in real time. SQL Server Profiler monitors events that occur in SQL Server, filters events based on user-specified criteria, and directs the trace output to the screen, a file, or a table. SQL Server Profiler then allows the database administrator to replay previously captured traces to test changes to database structures, to identify slow-performing queries, to troubleshoot problems, or to re-create past conditions.
Examples of engine events that can be monitored include:
Data from each event can be captured and saved to a file or SQL Server table for later analysis. Data from the engine events is collected by creating traces, which can contain information about the SQL statements and their results, the user and computer executing the statements, and the time the event started and ended.
Database administrators can filter event data to collect only the event data of interest to them. For example, they can collect only the events that affect a specific database or user and ignore all other events; or they can collect only data from queries that take longer than a specified time to execute.
SQL Server Profiler provides a graphical user interface to a set of extended stored procedures, which you can use directly. Therefore, it is possible to create your own application to monitor SQL Server that uses the SQL Server Profiler extended stored procedures.