Error/Fix: Msg 924. Get Database Out of Single User Mode

Spread the love

While doing DBA activities, sometimes I have to take the database into Single_User mode before I can perform the tasks required.

But quite often than I want to admit, I lose a single_user connection to some application/user. This creates big problem for me as it risks my activity and downtime. Below is the error message we receive in case some other session/user has the single_user connection to the database –

Resolution:-

After this incident happened to me a couple of times, I created the below tsql query to get out of any such situation when this risky situation comes up.

In the above tsql code, we create a loop, and kill one session at a time while at the same time, we try to bring the database back to multi_user mode. This way, we keep looping and killing sessions having the single_user connection of the database until the database gets out of single_user mode.

I hope this will be helpful to DBA out there facing this issue. If you like the article, do Like & Share.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.