This post has been republished via RSS; it originally appeared at: Azure Database Support Blog articles.
To be honest, this post is one of my favorites that I was looking to post due to many questions that we get from our customers about how to monitor my elastic database pool. Many customers have a dense elastic database pool and they need a clear picture of what is happening in their elastic database pool. I hope that you can enjoy like as much as I enjoyed during these tests.
In this article and video we are going to monitor the elastic database pool using the monitor an we are going to share a query to obtain all the current processes that your elastic database pool is running.
The first thing is to know the main characteristics of an elastic database pool.
- Databases running on a single SQL Instance.
- Configuration per database
The second, is to know the options that we have to monitor an elastic database pool
- Azure Portal, Azure Monitor, Log Analytics and SQL Auditing
- Select * from sys.dm_db_resource_stats
- Select * from sys.dm_exec_requests in combinations with other
- Query Data Store
- Use the queries provided in the demo
FInally, the best practices:
- Update Statistics with fullscan - How to maintain Azure SQL Indexes and Statistics - Microsoft Tech Community
- Lesson Learned #195: Performance Best Practices for Azure SQL Database and Managed Instance. - Microsoft Tech Community
- Resource management in dense elastic pools - Azure SQL Database | Microsoft Docs
Demo
In this demo I have the following configuration:
- Elastic Database Pool Name: Jmjuradotest
- Elastic Database Pool Configuration:
- General Purpose 2 vCores
- Storage Size: 316 GB
- Per Database Setting: Unlimited per Database.
- Databases that are part of this Elastic Database Pool:
- Jmjuradotestdb1
- Jmjuradotestdb2
- Jmjuradotestdb3
How to monitor queries that are running in my Elastic Database Pool.
This is the query that I used to monitor the activity
If you run this query connected to any database that belongs to your elastic database pool you could find some useful information:
As you could see this query has a special table called master_data, basically it is an external table that is connecting to master database to obtain the name of the database. Unfortunately, in Azure SQL Database is not possible to connect to others databases once you are connected to another. If you don't want to create an external table, please, basically, remove the reference like I posted below.
Definition of external table
In the following video you could see that giving a special workload (running queries that are taking high CPU, Bulk inserts and TempDB operations) how I monitor my elastic database pool, how I know that queries running and how I know which is the database that is taking more resources.
Enjoy!
