Hi all,I have an environment with MS-SQL Server 2014 and always-on availability group configured (on 2-nodes).I'm writing a Powershell Script which removes the database from the availability group (on the primary server) and then SHOULD drop the database on the secondary Server.That works most of the time, but not always...When it fails I get the error message: Cannot drop database "Customer_2" because it is currently in use.When i check the secondary DB-Server (sp_who2) while the script is running, i see that there is a process for the DB "Customer_2" with Status="background", Command="DB STARTUP" and LastWaitType="REDO_THREAD_PENDING WORK".As soon as the script fails, this process for "Customer_2" disapears.This happens always only on the second database in the availability group.Can someone explain to me, what this process does?Why is the process still there, even after I removed the database from the Availability Group on the primary node.If I remove the database from the availability group manually, the "background" process on the secondary node for that database disappears..Thanks for your help.DanPS: I asked a similar question on stackoverflow, but there with more questions about Powershell:http://stackoverflow.com/questions/33348544/ms-sql-powershell-how-to-kill-background-process-on-secondary-node-in-availabil
↧