SYMPTOMS
SQL Server marks a database suspect if any of the device files for the
database are unavailable when it attempts to start. You may see either of
the following sets of messages in the SQL Server error log:
96/11/18 10:48:32.60 kernel udopen: Operating System Error 32 (The
process cannot access the file because it is being used by another
process.) during the creation/opening of physical device,
C:\DATA\SQL\MSDB.DAT (or C:\DATA\SQL\MSDB.MDF)
96/11/18 10:48:32.60 kernel udactivate (primary): failed to open
device C:\MSSQL\DATA\MSDB.DAT (or C:\DATA\SQL\MSDB.MDF) for vdn 127
96/11/18 10:48:32.60 kernel udopen: operating system error 2(The
system cannot find the file specified.) during the creation/opening
of physical device C:\MSSQL\DATA\MSDB.DAT (or C:\DATA\SQL\MSDB.MDF)
96/11/18 10:48:32.60 kernel udactivate (primary): failed to open
device C:\MSSQL\DATA\MSDB.DAT (or C:\DATA\SQL\MSDB.MDF) for vdn 127
These will be followed later in the log by:
96/11/18 10:48:36.70 kernel udread: Operating system error 6(The
handle is invalid.) on device 'C:\MSSQL\DATA\MSDB.DAT' (or C:\DATA\SQL\MSDB.MDF) (virtpage
0x7f000018).
96/11/18 10:48:36.77 spid11 Error : 840, Severity: 17, State: 2
96/11/18 10:48:36.77 spid11 Device 'MSDBData' (with physical name
'C:\MSSQL\DATA\MSDB.DAT' (or C:\DATA\SQL\MSDB.MDF), and virtual device number 127) is not
available. Please contact System Administrator for assistance.
96/11/18 10:48:36.77 spid11 Buffer 1092480 from database 'msdb'
has page number 0 in the page header and page number 24 in the
buffer header
96/11/18 10:48:37.43 spid11 Unable to proceed with the recovery of
dbid <5> because of previous errors. Continuing with the next
database.
For example, performing the following steps will demonstrate the problem:
- Stop SQL Server.
- Issue the following command from a command prompt at the Mssql\Data
directory:
ren msdb.dat msdb.sav
- Start SQL Server.
You will see the above errors (the ones from the second set) in the SQL
Server errorlog. If you then issue the following query in the master
database
select name, dbid, mode, status from sysdatabases where dbid =
db_id('msdb')
You receive the following results:
name dbid mode status
------------------------------
msdb 5 0 328
The status of 328 evaluates to:
truncate log on chkpt
database not recovered yet
database is suspect
For more information, see the "Sysdatabases (Master Database Only)" topic
in the SQL Server Books Online.