1

SQL Server 2012:

Tried to do a database copy on a live database - to detach and re-attached.

It errored then the database stated it was in single user mode.

Attempted to run code like:

ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
--do you stuff here
ALTER DATABASE YourDatabase SET MULTI_USER

Database says it can't because it deadlocked on live processes on the DB.

Can't kill live processes because they are below 50, which are system processes.

This is where all of the online articles on the subject break down.

I have tried to cut off all other connections to database and restart database, however these system processes remain alive.


Any rapid answer would be very appreciated so I can get my DB back online.

0

1 Answer 1

1

Help! I'm stuck in Single User Mode and can't get out!

SQL Server 2012

USE [master] 
SET DEADLOCK_PRIORITY HIGH 
ALTER DATABASE [StuckDB] SET MULTI_USER WITH NO_WAIT 
ALTER DATABASE [StuckDB] SET MULTI_USER WITH ROLLBACK IMMEDIATE

source

1
  • 1
    You're the best. And nice GIF, btw.
    – dthree
    Sep 16, 2016 at 3:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .