Fixing Application Latency and Timeout issues in Multi-Subnet Always ON SQL Server Setup

Issue Application Team complained about latency in connecting to database through listener name. They also complained about application taking more time to connect to database after Always ON Group failover. Sometimes they observed application timeouts as well. Underlying database was part of Multi-Subnet Always ON SQL Server. Application was connecting to database using Listener IP. … Read more

Always ON Group Failover not happening in SQL Server 2017

We had one activity planned which was related to windows hostname and SQL server name change. DB Servers Setup Information: It was a 2 node windows cluster, Node1 & Node2. SQL server Always On was configured on this setup. 4 Synchronous Always On Groups (AG1, AG2,AG3,AG4) were setup and Node1 was acting as Primary. Always … Read more

LOG_REUSE_WAIT_DESC shown as Availability_Replica even though DB is removed from AG

Issue: One of our customers have a AG server with 2 nodes and 4 databases added to availability group. He got an alert saying that log file is full for one of the bigger database.

Read more

Cannot drop server ‘repl_distributor’ because it is used as a Distributor in replication

I am writing this post as I recently faced error mentioned in title while I was migrating all objects from one SQL instance to another SQL instance as part of decommission plan of source instance. On source server, there was transactional publication was configured with local distributor. If you restore a replicated database to another … Read more

Avoid deadlock scheduler situation in AlwaysOn setup

Scenario Kindly consider below AlwaysOn setup between three servers. Server A — Primary ReplicaServer B — Secondary synchronous commit replicaServer C — Secondary asynchronous commit replicaEach server is having 8 logical CPUs thus having 576 max worker threads.SQL instance is having 150 user databases across 5 AGs with 30 databases in each AG. With above … Read more

Lost permissions on subscriber objects after applying snapshot

Symptoms: You are using SQL Server replication (transactional/merge/snapshot) subscribers for transactions. You have provided users some object level permissions on specific objects (tables/stored procedures etc.) at subscriber database. After applying the snapshot users complaint about missing permissions on subscriber database. Cause: In SQL server replication, while applying snapshot default behavior is to drop existing objects … Read more

HIGH CPU usage due to RESOURCE MONITOR command

On one of SQL 2016 server HIGH CPU usage alert was received. It was constantly above 95% and SQL server was highest CPU consumer. As checked with sp_who2, Resource Monitor command running under system SPID was biggest CPU consumer and its CPU usage was not coming down.

Execute permission was denied on object ‘agent_datetime’

Execute permission was denied on object ‘agent_datetime’

Finding SQL Server Product Key

Recently, we had to retrieve SQL Server License Keys for existing SQL Server setups due to auditing requirements. Existing database server setups spanned from SQL 2008 to SQL 2019. PowerShell Script mentioned in below article could be used to retrieve product key for SQL server 2008 , 2008 R2 & 2012. https://mspowershell.blogspot.com/2010/11/sql-server-product-key.html We made small … Read more