herbet
  • herbet
  • 91% (Exalted)
  • Newbie Topic Starter
a year ago
I am trying to repair a DB in a suspect state after exporting a VM server.

I have backups from the other day but I would rather use the live one.

It is not a production system.

What is this error on DBCC checker running?

Msg 596, Level 21, State 1, Line 0
Cannot continue the execution because the session is in the kill state.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
Sponsor

Want to thank us? Use: Patreon or PayPal or Bitcoins: bc1q4whppe29dw77rm4kv4pln0gqae4yjnxly0dny0hky6yhnafukzjsyrsqhk

All opinions expressed within these pages are sent in by members of the public or by our staff in their spare time, and as such do not represent any opinion held by sircles.net Ltd or their partners.


herbet
  • herbet
  • 91% (Exalted)
  • Newbie Topic Starter
a year ago
I had to put the DB in single user mode:

ALTER DATABASE [DB Name]  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

run the checker with:

DBCC CHECKDB (B[DB Name] REPAIR_ALLOW_DATA_LOSS)
GO

Then run the checker again:

DBCC CHECKDB
GO

Then put it back in multi user mode:

ALTER DATABASE [DB Name] SET MULTI_USER
GO

After that it seemed to be OK
herbet
  • herbet
  • 91% (Exalted)
  • Newbie Topic Starter
a year ago
Just as a sidenote - this was from running Disk2VHD on an SQL server with transaction shipping installed which is what caused the issue.

I also had to restore the master and msdb DBs to get it working and restore file permissions to the DB files afterwards.