Thursday, January 28, 2010

How Can You Recover SQL User Database Contents from a “Suspect” Status? Here Is An Answer!

A possible scenario with SQL Database is - At startup, SQL Server tries to get a lock on the device file. If the device is used by some other process (say for example – the backup software) or if the file is missing, you might encounter this problem that your SQL database is in “Suspect Mode.” This can be a grave problem putting your crucial data at stake. To prevent such severe SQL data loss, there is a process that you can try yourself. Just follow the following steps:
1) Firstly, ensure that the device file is available.
2) Use supplemental stored procedure sp_resetstatus to reset the status of a suspect database.
For SQL Server versions 6.0 and 6.5 – if this is not done already, then create procedure by executing the Instsupl.sql script (found in the Mssql\Install directory).
For SQL 7.0 and later versions – Create it at installation by the inscat.sql script (found in Mssql\Install directory).
3) Run sp_resetstatus in the master database for the suspect SQL database:
use master
go
exec sp_resetstatus your_database_name
4) Stop and start SQL Server again.
5) Confirm that the database was recovered and is available.
6) Run DBCC NEWALLOC, DBCC TEXTALL and DBCC CHECKDB.

Now, if you fail to recover the contents from SQL suspect database even after trying these steps, then there is another way to get back you crucial data. You can try using a third-party software tool to recover SQL database contents. One such tool is SysTools SQL Recovery software which is an easy-to-use tool which you can use for SQL suspect database recovery as the software can repair corrupt MDF files and recover SQL database contents in almost all types of corruption cases.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.