Professional Documents
Culture Documents
This article describes the course of actions you should take 1. if your database somehow got "suspect mode" or "emergency mode"; 2. if you receive the error 1813 on attaching database
3.
Now proceed to the sysdatabases table in the master database, locate your database row and put 32768 into its status column
4.
Restart SQL Server and refresh Enterprise Manager Open Enterprise Manager - the database will be marked as "Emergency Mode"
These articles explain the trick behind suspect and emergency mode: http://support.microsoft.com/support/kb/articles/Q165/9/18.ASP http://www.swynk.com/friends/knight/unmarksuspect.asp http://support.microsoft.com/support/kb/articles/Q180/5/00.asp
4.
Note that there might be complex dependencies between database objects, so Copy SQL Objectstask might not work properly. For example: view A is dependent on view Z; Copy SQL Objects task will try to create view A first, -- that will fail, because view Z does not exist yet.
1. 2. 3. 4. 5.
Create new database using the same name and file location as database that is failing to attach Stop SQL Server Copy non-attachable data files over the new ones Delete log files Start SQL Server Open Enterprise Manager - the database will be marked as "suspect"
Once your database is "suspect", use instructions outlined above... Note that database will be marked "suspect" only if transaction log contained active sections. To illustrate the problem for 100%, run a few inserts against the database before deleting transaction log. Pasted from <http://www.gerixsoft.com/blog/mssql/recovering-mssql-suspect-mode-emergency-mode-error-1813>