Database monitoring with SQL Profiler

TipsMake.com - SQL Server Profiler is an effective logging tool, included with SQL Server. Profiler allows you to manage and capture ongoing activities in your database, including query adhoc, archive requests, login, errors, . Today, we will Learn how to use Profiler to clarify the above.

Suppose that we have a SOCK named application running on the SOCKsql database, on SwampTest server. If we want to display the T-SQL query that affects the database when a user accesses the SOCK, we will have to:

1. Start SQL Server Profiler and set up the log

2. Run the log while performing the SOCK application login.

3. Stop running the log and check the saved result

Start SQL Server Profiler

You can start SQL Profiler from the Start menu , or in SQL Server Management Studio (SSMS), under the Tools menu. Another way to open SQL Profiler is Start> Run> Profiler . When opened, Profiler will display you the Connect to Server dialog box. Next, you will have to fill in the name of the server you want to create a record, along with confirmation information. Then, click Connect.

Database monitoring with SQL Profiler Picture 1

The Trace Properties window will allow you to adjust the record you want. On the General tab , you can enter a Trace name, select a template , choose a save method and turn on the query stop time.

Database monitoring with SQL Profiler Picture 2

At the Event Selection tab, we select the database event and the properties for each event we want to record. The selected event is part of the standard template we see in the General tab.

Near the left end of the screen, we have 2 small boxes. The ' Show all events ' box displays all the events we can query with Profiler. Take a look at the items in it and then tick it.

Check the ' Show all columns ' dialog box so that we can see all the properties of each event.

• We don't need Audit Login and Audit Logout events today, so there's no need to tick it.

• You will need ' ExistingConnection ', without it, all actions taken by the current connection will not be displayed.

• RPC: Completed - 'Remote Procedure Call: Completed'. The SOCK application almost exclusively uses RPCs, so we'll have to tick it.

SQL: BatchStarting and SQL: BatchCompleted will display the start and end of the T-SQL command group. You do not have to tick here.


Use column filters to filter the data we don't need. Click Column Filters . In the Edit Filter dialog box, select DatabaseName and then click Like and type the name of your database: SOCKsql . This will ensure Profiler will only record events that occur on the SOCKsql database.

Database monitoring with SQL Profiler Picture 3

Run the record

In the illustration, only the selected events as well as the time that the record was limited. Therefore, we will not be left with unnecessary information and reduce the load on the server pretty much.

When you're ready to log into SOCK, click Run in SQL Profiler. You will see ' Trace Start ' displayed at the top of the event list in Profiler, followed by a series of current connections.

In the example, we will only record the SOCK login-related events, so as soon as the record is started, we can access the SOCK application. Next, click on the ' stop trace ' red button in SQL Profiler. As such, they already have event log tables.

Database monitoring with SQL Profiler Picture 4

Read the record

If you want, you can save these events into a file by clicking File > Save As > Trace File , or saving it as a SQL: File > Save As > Trace Table table . For example, we will save this data into an SQL table, which will help you find a word that is in the table easier and faster.

You can now read all recorded events, or search for a keyword or number in any path. When clicking on any line, the data for that row will be displayed at a table at the bottom of Profiler. Note that we have filtered the data by the name of the database, you can check again by dragging to the right of the table to see the name of the selected database.

This short introduction to SQL Profiler can help you record database operations whenever needed.

4 ★ | 1 Vote

May be interested

  • How to create a database in MySQLHow to create a database in MySQL
    mysql can be a scary program. all commands must go through the command line interpreter program (command prompt) without any intuitive interface. therefore, the basic knowledge of how to create and manipulate on a database in mysql can save you time and avoid nuisance.
  • How to recover the database in MS SQL ServerHow to recover the database in MS SQL Server
    simply put, this is the process of retrieving the backup file and returning it to the database.
  • Overview of the Access 2010 tutorial seriesOverview of the Access 2010 tutorial series
    access 2010 is a database creation and management program. to better understand access, you must first understand the database.
  • What is Database Security and how to secure the database effectively?What is Database Security and how to secure the database effectively?
    database security refers to the measures taken to protect a business's data from unauthorized access, disclosure, alteration, or theft.
  • 6 devices and sensors for monitoring the best intelligent air quality6 devices and sensors for monitoring the best intelligent air quality
    here are some of the best smart indoor air quality monitoring devices and sensors to consider. each air monitoring device can monitor some or most of the air pollutants and interesting additional features.
  • Comprehensive network monitoring tool setComprehensive network monitoring tool set
    network monitoring is a diverse function with many tasks that a computer network administrator needs to perform. to simplify administration and improve network performance. in the following article, we would like to share a fairly complete toolkit for comprehensive network monitoring goals.
  • Top 10 best bandwidth monitoring softwareTop 10 best bandwidth monitoring software
    monitoring network bandwidth is very important. it helps users understand what's going on within their network.
  • Secure programming of Access databaseSecure programming of Access database
    almost everyone who uses a microsoft access application uses one of the (or all) of the following ways to protect the database (database), to lock their hands and lock the curious employees:
  • Best Linux monitoring tool & softwareBest Linux monitoring tool & software
    like windows, the infrastructure that runs on linux must also be monitored, which is why today tipsmake.com summarizes the best monitoring tools and software available today.
  • Database security methodDatabase security method
    in the data security strategy, most companies now focus resources on data protection on the transmission line. meanwhile, the data protection issue in the database (database, database) has not been properly concerned.