question

SahaSaha-5270 avatar image
0 Votes"
SahaSaha-5270 asked AmeliaGu-msft commented

Datafile and MDF_MSSQL_DBCC8

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


sql-server-generalsql-server-transact-sql
test.jpg (21.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SahaSaha-5270,
Was your issue resolved? Did the answers help you?
Please feel free to let us know if you have any other question.
If you find any post in the thread is helpful, you could kindly accept it as answer.
Best Regards,
Amelia

0 Votes 0 ·
OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered SahaSaha-5270 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AmeliaGu-msft > Thanks for the quick response. I plan on restarting the server and hoping that it will clean up the MDF_MSSQL_DBCC files. We have about 100 Database servers and I do not see DBCC CHECKDB run as a maintenance plan on any of the server. Is this something I should implement to prevent corruption of databases?
How do I check if DBCC CHECKDB command is in progress.

0 Votes 0 ·
ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered

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



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.