Monday, April 16, 2012

How to make database as suspect database



How to make database as suspect database
1. Run the transaction from one query window (don’t commit or rollback)
2. Open another query window and run SHUTDOWN WITH NOWAIT
3. Open the LDF file in hex editor and overwrite the second row with some values (for example type all 8’s in the second row and save the file)
4. Start the SQL Service
5. Now you can see the current database is in Suspect Mode.

SELECT DATABASEPROPERTYEX ('Test', 'STATUS') AS 'Status';

It shows the result as SUSPECT.

**Make sure you are working with your test database, This may help you to bring suspect database to online.

No comments: