Summary: This blog will discuss error 926 that users encounter while working with SQL Server 2008 R2. It will also describe solutions on how to deal with SQL Server 2008 R2 Error 926. The blog also mentions an SQL Repair tool that can help you easily restore the database.
You write an SQL query and are ready to execute it in SQL Server 2008 R2; but as you input the code, you get the following error message:
Database ‘msdb’ cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926).
The error may occur during any of these operations:
Starting up a SQL Server instance
SQL database is not attached properly
Using the RESTORE database or RESTORE LOG commands
How to Fix SQL Server 2008 R2 Error 926?
Check the SQL Server error log to identify what caused the error. If the recovery failed due to an I/O error (a torn page) or any other hardware issue, try resolving the hardware issue to fix the error. If this doesn’t work, there must be some form of database corruption. In that case, try restoring the database from the last known database backup.
If you don’t have a backup or the backup is corrupt, set the database in EMERGENCY mode and try the DBCC CHECKDB repair operations. Doing so, will help you restore access to the database marked as suspect. But, before attempting this solution, try the following tricks to fix Microsoft SQL Server 2008 R2 Error 926 MSDB:
Refresh the SQL connection.
Disconnect and reconnect the SQL connection.
Restart the service for MSSQLSERVER.
Restart the SQL Server Management Studio (SSMS).
If none of the above methods helpsresolve the error, perform these steps:
Step 1: Use EMERGENCY Mode to Repair a Suspect Database
Open a new query window in SSMS, and then run the following commands:
Note: You can also use the ‘sp_resetstatus’ stored procedure to turn off the suspect flag on a database. For detailed information, refer to this link.
ALTER DATABASE DB_Name SET EMERGENCY;
This command puts the database in EMERGENCY mode. In this mode, users only get read-only permission to access the database.
Note: Members of the sysadmin fixed server can only access this right.
DBCC CHECKDB (‘DB_Name’);
The above command helps check the integrity of all database objects.
ALTER DATABASE DB_Name SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
The command sets the database in ‘single user mode’.
DBCC CHECKDB (‘DB_Name’, REPAIR_ALLOW_DATA_LOSS);
This DBCC CHECKDB command will help repair the errors in SQL Server 2008 R2.
ALTER DATABASE DB_Name SET MULTI_USER;
With this command, the SQL Server database will be set in multi-user mode, which allows multiple users to access the database.
After executing all of the above commands, check if you can access the database. If you can, put the db back in normal mode.
You can use manual fixes and software to deal with SQL Server 2008 R2 Error926. While the manual fixes may help you fix the error, they may take considerable time and effort in resolving the error. This increases server downtime, leading to productivity loss and chances of data loss. However, using an SQL repair software may help you restore the database in minimal time without the fear of losing data.
Priyanka is a technology expert working for key technology domains that revolve around Data Recovery and related software's. She got expertise on related subjects like SQL Database, Access Database, QuickBooks, and Microsoft Excel. Loves to write on different technology and data recovery subjects on regular basis. Technology freak who always found exploring neo-tech subjects, when not writing, research is something that keeps her going in life.