Datafile and MDF_MSSQL_DBCC8

Avyayah 1,291 Reputation points
2021-04-07T03:55:20.867+00:00

One of the database has MDF_MSSQL_DBCC8 file besides its own datafile. The user also noticed that some of the data was missing from the database. Not sure what to do with these files or how to correct the database.
85069-test.jpg

Developer technologies | Transact-SQL
SQL Server | Other
{count} votes

4 answers

Sort by: Most helpful
  1. Olaf Helper 47,516 Reputation points
    2021-04-07T05:50:31.7+00:00

    That's not the common naming convention for database files, but they can be named as one like.

    You can get the associated database with this query

    select mf.name, mf.physical_name, db.name
    from sys.master_files as mf
         inner join
         sys.databases as db
             on mf.database_id = db.database_id
    order by db.name
    
    1 person found this answer helpful.
    0 comments No comments

  2. AmeliaGu-MSFT 14,006 Reputation points Microsoft External Staff
    2021-04-07T06:29:11.523+00:00

    Hi SahaSaha-5270,

    MDF_MSSQL_DBCC files are the internal snapshot database generated for dbcc checkdb. The new MDF_MSSQL_DBCC files are deleted at the end of DBCC CHECKDB processing. If the operating system encounters an unexpected shutdown while the DBCC CHECKDB command is in progress, then these files will not be cleaned up. They will accumulate space, and potentially will prevent future DBCC CHECKDB executions from completing correctly. In that case, you can delete these new files after you confirm that there is no DBCC CHECKDB command currently being executed.
    Please refer to What is .mdf_MSSQL_DBCC15 file which might help.

    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  3. AmeliaGu-MSFT 14,006 Reputation points Microsoft External Staff
    2021-04-08T03:10:51.413+00:00

    Hi SahaSaha-5270,
    Thanks for your reply.

    How do I check if DBCC CHECKDB command is in progress.

    Please try this:

    SELECT  session_id ,
    request_id ,
    percent_complete ,
    estimated_completion_time ,
    DATEADD(ms,estimated_completion_time,GETDATE()) AS EstimatedEndTime,
    start_time ,
    status ,
    command
    FROM sys.dm_exec_requests
    where command like '%DBCC%'
    

    Best Regards,
    Amelia

    1 person found this answer helpful.
    0 comments No comments

  4. Erland Sommarskog 122.4K Reputation points MVP Volunteer Moderator
    2021-04-07T21:39:46.22+00:00

    Two leftover DBCC files and user claiming data missing. Hmm, seems like there could be some trouble. Have you checked the SQL Server errorlog? If DBCC has run into trouble, this should appear here.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.