none
DBCC Checkdb failed for Master and msdb databases. RRS feed

  • Question

  • We been running this script from longtime on our prod server. Suddenly, we are getting this error

    We use the Maintain Scripts from the below link.

    ola.hallengren.com

    Command: DBCC CHECKDB ([master]) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY [SQLSTATE 01000] (Message 50000)  The database could not be exclusively locked to perform the operation. [SQLSTATE 42000] (Error 5030)  Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details. [SQLSTATE 42000] (Error 7926)  Outcome: Failed [SQLSTATE 01000] (Message 50000)  Duration: 00:00:00 [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Database: [model] [SQLSTATE 01000] (Message 50000)  Status: ONLINE [SQLSTATE 01000] (Message 50000)  Standby: No [SQLSTATE 01000] (Message 50000)  Updateability: READ_WRITE [SQLSTATE 01000] (Message 50000)  User access: MULTI_USER [SQLSTATE 01000] (Message 50000)  Is accessible: Yes [SQLSTATE 01000] (Message 50000)  Recovery model: FULL [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Command: DBCC CHECKDB ([model]) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY [SQLSTATE 01000] (Message 50000)  Outcome: Succeeded [SQLSTATE 01000] (Message 50000)  Duration: 00:00:00 [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Database: [msdb] [SQLSTATE 01000] (Message 50000)  Status: ONLINE [SQLSTATE 01000] (Message 50000)  Standby: No [SQLSTATE 01000] (Message 50000)  Updateability: READ_WRITE [SQLSTATE 01000] (Message 50000)  User access: MULTI_USER [SQLSTATE 01000] (Message 50000)  Is accessible: Yes [SQLSTATE 01000] (Message 50000)  Recovery model: SIMPLE [SQLSTATE 01000] (Message 50000)  Date and time: 2019-09-07 04:25:35 [SQLSTATE 01000] (Message 50000)  Command: DBCC CHECKDB ([msdb]) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY [SQLSTATE 01000] (Message 50000)  The database could not be exclusively locked to perform the operation. [SQLSTATE 42000] (Error 5030)  


    Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. 


    • Edited by MollyDBA Thursday, October 10, 2019 2:47 PM
    Wednesday, October 9, 2019 6:40 PM

All replies

  • Probably there is another activity using up these databases at the same time, were there any recent jobs/tasks scheduled to run which is conflicting with your DBCC job. Refer this link,

    https://support.microsoft.com/en-us/help/928518/error-message-when-you-run-any-of-the-dbcc-check-commands-in-sql-serve

    You may also check if the service accounts permissions were altered recently on the disks hosting these DB's.

    Check for space on the drive hosting system DB's and tempdb.

    Hope it helps.



    • Edited by Kris_SQL Wednesday, October 9, 2019 7:22 PM
    Wednesday, October 9, 2019 7:08 PM
  • Thanks Kris for the reply! We don't have any scheduled jobs/tasks run on the same time. I am getting this error, even I am running DBCC checkdb manually on a different time. We have around 1TB free space on the drive where the system databases reside. Temp drive has 262GB space free out of 949 GB. None of the file groups are in read only mode. Checked service accounts permissions which looked fine.
    Wednesday, October 9, 2019 8:12 PM
  • Did you check for any error messages pre/post these DBCC errors in SQL Server Logs, Windows App Logs?

    When did it started failing? Check for any errors particularly on the first day of failure.

    Did you try run manually the DBCC command on a single DB?

    Can you post the command you are trying to execute manually?

    Check for any server/storage level activity performed on or before first failure.


    Thursday, October 10, 2019 12:02 AM
  • It is almost impossible to read that that output. Is it from the job history or from the output file? Please check both and post back something which is a bit more readable for us. Also, what command was executed? You can see that in for instance the CommandLog table that Olas solution use (by default), as well as error messages. Also, what else errors do you see in the errorlog file?

    Basically, we need more info...


    Tibor Karaszi, SQL Server MVP (Web Blog)

    Thursday, October 10, 2019 6:40 AM
  • I see this error in the event viewer.

    The operating system returned the error '5(Access is denied.)' while attempting 'GetVolumeInformation' on '\\?\Volume{da97efba-db9f-11e3-9389-005056a91ff1}\' at 'storagedmv.cpp'(308).

    Thursday, October 10, 2019 8:08 PM
  • Hi MollyDBA,

     

    >>The operating system returned the error '5(Access is denied.)' while attempting 'GetVolumeInformation' on '\\?\Volume{da97efba-db9f-11e3-9389-005056a91ff1}\' at 'storagedmv.cpp'(308).

     

    It is a permission issue. This API would fail if SQL Server startup account do not have full permission on Volume in which the data file is located.Grant full permission for the startup account of SQL Server on the root volume of all the data files.

     

    Best regards,

    Dedmon Dai


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Proposed as answer by KevinBHill Saturday, October 12, 2019 9:02 PM
    Friday, October 11, 2019 1:51 AM
  • I am getting the following error when I run DBCC Checkdb for any of the system databases and 'Report server' database. DBCC checkdb on model database is fine. Some of the user databases and system databases reside on the same drive. DBCC Checkdb runs fine with all Userdatabases. 

    DBCC Checkdb (master)

    DBCC Checkdb (msdb)

    DBCC Checkdb (ReportServer)

    Msg 5030, Level 16, State 12, Line 1

    The database could not be exclusively locked to perform the operation.
    Msg 7926, Level 16, State 1, Line 1
    Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.

    Saturday, October 12, 2019 4:12 PM
  • I restored these databases on my test machine. DbCC checkdb ran fine on my test machine but on prod, I am getting the following error.

    The database could not be exclusively locked to perform the operation.
    Msg 7926, Level 16, State 1, Line 1
    Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.

    Saturday, October 12, 2019 4:46 PM
  • Hi MollyDBA,

     

    As I said above, the error message you gave is the permission problem. The service account of sql server needs to have read and write permissions on the folder where the data file is located. Please check it again.

     

    As a solution, you can change the startup account of sql server to local system. If you are really not sure if your startup account has read and write access to the corresponding folder.

     

    Best regards,

    Dedmon Dai


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, October 15, 2019 2:14 AM