How to recover a suspect database

Symptoms

When the software opens you are presented with the following error.

Login failed for user 'cyc'

error 3414

A typical reason that this will happen is that the database has been corrupted. There is a script that can be run in an attempt to recover it.

Open the SQL Manager

Open the SQL Manager

Select the Start button ---> All Programs ---> Microsoft SQL Server ---> SQL Server Management Studio

Connect to the database

Connect to the database

1: Click the connect button to connect to the database

Check the status of the database

Check the status of the database

In this example the CYC database is marked "suspect"

THE SCRIPT BELOW IS ONLY DESIGNED FOR DATABASES THAT ARE MARKED AS "SUSPECT" - IF THE DATABASE IS NOT MARKED AS SUSPECT PLEASE DO NOT GO ANY FURTHER.

Open a query window

Open a query window

1: Open a Query window by click the New Query button.

Use this script

Copy and paste the following script into the Query window

------------------------------------------------------------------------------------

EXEC sp_resetstatus cyc;

ALTER DATABASE cyc SET EMERGENCY

DBCC checkdb(cyc)

ALTER DATABASE cyc SET SINGLE_USER WITH ROLLBACK IMMEDIATE

DBCC CheckDB (cyc, REPAIR_ALLOW_DATA_LOSS)

ALTER DATABASE cyc SET MULTI_USER

Execute the script

Execute the script

1: Click the Execute button - the script will run.

Database recovered

Database recovered

If the recovery was successful the word "suspect" will be removed and the database tree will become visible.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.