## DB Query Logs

The DB query logs refers to a set of logs that captures information about the execution of database queries within the SQL Server instance. These logs are essential for monitoring and auditing database activities, troubleshooting performance issues and also ensuring the security and integrity of the database environment. In the DB query logs window, you can see the following details which are listed below:

- Timestamp: This refers to a data element that records the date and time when a specific event or SQL query occurred within a database management system (DBMS). You can see the date and time in the following format DD/MM/YY and HH:MM:SS.
- Database: This refers to the specific component within the logs that provides information about events, activities and errors related to an individual database hosted by the SQL server instance.
- Class: This refers to categorizing and identifying different types of messages or events that are logged within the service logs.
- Method: This refers to the information about the method or process used for generating a particular log entry.
- Query: This refers to the specific SQL statement that was executed within the database management system (DBMS) such as: Microsoft SQL Server (MSSQL).
- Execution Time: This refers to the amount of time taken by a specific operation to execute within the SQL server instance.

Note: In the DB query log window, you can perform the following operations which are listed below:

- Search: You can perform search operation in the table by providing the timestamp, database, class, method etc in the Search in table column icon.
- Download : On clicking this icon, it will download the Service Logs report in the CSV file format in your local.
- Toggle Columns : On clicking this icon, you will be able to show or hide a column from the Service Logs report window.
- Toggle Filter : On clicking this icon, you can apply search operation on columns in the Service Logs report window.

The query execution refers to the process of executing a specific SQL query within the database management system (DBMS). These logs capture different detailed information about how a query was processed by the database engine, including its execution plan, duration and resource usage. In query execution, there are following predefined function which you can apply while executing a query which are listed below:

- EXEC sp_WholsActive: This refers to the execution of a stored procedure named "sp_WholsActive" within an SQL server database. This statement initiates the execution of the stored procedure, which can perform various database operations based on its design and purpose.
- EXEC sp_who: This refers to the execution of a built-in stored procedure named "sp_who". This procedure is designed to query and display information about active sessions and processes within the SQL server instance.
- Custom Query: This refers to the execution of a user-defined SQL query, which is a specific SQL statement crafted by a database administrator, or a user to perform custom database operation.

Note: Once you have selected the query which you want to execute by clicking on their corresponding radio buttons, you have to click on the Execute
button to execute the query. On executing the query, the corresponding output for the query will be displayed in the Query Output window.