---
title: "How to Monitor SQL Queries With Retrace"
slug: "monitors-sql-queries"
description: "Effectively monitor SQL queries and database health with SQL Monitors. Configure alerts for query results, record count, and more."
updated: 2022-01-06T15:39:16Z
published: 2022-01-06T15:39:17Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Monitor SQL Queries

Every app relies on a database to ensure the flow of information. SQL Monitors proactively keep tabs on data and database health. However, problems in the database often have a wide-reaching impact downstream. In this guide, learn how to make SQL monitors to effectively monitor query results.

## Preparing for SQL Monitors

Set up the database information inside Retrace. If you have not done this process, first set up your database credentials and configure a database connection. Then create a reusable query. See the [Password Vault](https://docs.stackify.com/docs/security-passwords) article to see how to set SQL Connections up.

## SQL Monitors Page

Click on the **Monitoring** tab and click on the **SQL Queries** link.

![SQL Queries](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/SQL%20Queries.png)

Click on the **Add New** button to configure a new monitor.

![AddNew](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/AddNew.png)

### Select A Type Of Query To Monitor

You will be given the option to create new a monitor from an existing query or to create a new query to be monitored.

![Database Query Monitor](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/Database%20Query%20Monitor.png)

Retrace supports SQL Server, MySQL, Oracle, and PostgreSQL database types.

> When creating a new query to be monitored, you will be asked to enter the database connection details for the query.

### Select A Query And Connection

If you chose to use an existing query, you will select which query to use here. Next, you will choose an existing connection to run the query on. The query will be sent from an agent currently installed on one of your Active Devices.

![CreatingNewDatabase](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/CreatingNewDatabase.png)

Once you create the SQL connection and select the query, you can then add and configure monitors.

## Configure the Monitor

Below is an example of some settings you could configure to monitor a SQL query.

![Databases](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/Databases.png)

**Duration:** Depending on how long the SQL statement takes to execute, an alert could be set up to provide the notification.

**Record Count:** This warning will occur every time a record count is 1 or greater. In this case, this would alert you every time a customer is missing an email address in the database.

**Result Check:** This setting will check the value of the query results. This is especially useful if you want an alert for unexpected query results.
