MSDB database questioned solution

1. Cause

Computer room power outage, server illegal shutdown, resulting in the MSDB database is "suspect"

The role of 2.Msdb database

Msdb database for use SQLServer Agent scheduling alerts and jobs, and recording operators. For example, we back up a database, a record is inserted in the table backupfile, the backup information to record relevant.

3. The implementation logic

Since Msdb database is not particularly important information is stored, so you can overwrite from other machines to copy the same msdbdata.mdf and msdblog.ldf.

4. resolution steps

A server is "suspect" server; B is equipped with the same version of the server A and the server database software. My version is SQL SERVER 2000.

Step 1, SQL SERVER stopping the service on the server B, a copy "msdbdata.mdf" and "msdblog.ldf" file.

Step 2, stop SQL SERVER service on server A, will cover a copy of the B server "msdbdata.mdf" and "msdblog.ldf" file out of these two files on the A server. 3. Restart the SQL SERVER A service on the server.

Step 3, if the MSDB database remains a suspect state, you can perform the following SQL.

USE MASTER 
GO 
SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE 
GO 
UPDATE SYSDATABASES SET STATUS =32768 WHERE NAME='msdb' 
Go 
sp_dboption 'msdb', 'single user', 'true' 
Go 
DBCC CHECKDB('msdb') 
Go 
update sysdatabases set status =28 where name='msdb' 
Go 
sp_configure 'allow updates', 0 reconfigure with override 
Go 
sp_dboption 'msdb', 'single user', 'false' 
Go 

Reproduced in: https: //www.cnblogs.com/rainman/p/4064561.html

Guess you like

Origin blog.csdn.net/weixin_34127717/article/details/93561373