Displaying posts categorized under

Monitroing Queries

Script to Monitor Mirroring

Script to Monitor Mirroring This script will provide all database which is mirrored with mirroring mode, mirroring status and partner information. Regards, Nirav Gajjar

Script to get Replication Latency

Script to get Replication Latency. I have created monitoring script to get latency information for replication and status of replication health. I have used “SP_REPLMONITORHELPSUBSCRIPTION ” under Distribution database. It gives you same information which you can get from Replication Monitor –> Subscription Wath List. In SQL Server 2012 you just need to pass value only [...]

Script to get replication Undistributed Commands

Script to get replication Undistributed Commands Script to Monitor Replication by checking last refresh time and pending commands Regards, Nirav Gajjar

Query to get Database size and table size

Query to get Database size and table size. Query to get Database size in GB. Query to get Table size in GB with no of rows. Query to get Service Broker Queue size in GB with no of rows. Regards, Nirav Gajjar

Query to get Open Transaction

Query to get Open Transaction. Query to monitor open transactions in your sql server instance. If you are using SQL Server 2012 use open_transaction_count column instead of enlist_count. Query to get open transactions by host. remove the comment if you want open transactions just from ssms window. List Open transactions in details. Regards, Nirav Gajjar

SQL Server long running and blocking queries

SQL Server long running and blocking queries This query helps you to get all running queries including user queries and SQL Server engine queries. with duration, so you can examine which query running long. You can see BlockingWith field which shows you query is blocking with another process. I have ordered query by blocking first [...]