6

Though DBCC DBINFO() is undocumented, but we all know that

dbi_crdate: Database creation datatime
dbi_dbccLastKnownGood: the completion time of the last 'clean' run of DBCC CHECKDB

For one of my database its showing following output.

enter image description here

Why output of DBCC DBINFO() showing smaller value for dbi_dbccLastKnownGood as compare to dbi_crdate. How can someone execute DBCC CHECKDB before a database is created ?

12

If you restore a database as a new database, the dbi_crdate field is the restore date/time.

Here's how to reproduce it:

  1. Create a new database.
  2. Run DBCC CHECKDB() on it.
  3. Look at DBCC DBINFO() for the creation date and DBCC dates.
  4. Back up the database.
  5. Delete the database.
  6. Restore the database (if you want to get fancy, use a different database name.)
  7. Look at DBCC DBINFO() for the creation date and DBCC dates. The creation date will be the restore time, and the DBCC date will be earlier.
  • 2
    I don't like your glasses, but your are just awesome guru. – aasim.abdullah Nov 25 '14 at 12:00
  • 2
    HAHAHA, if it makes you feel better, I do have a new pair of glasses waiting for me at the optometrist today. Have a good week. – Brent Ozar Nov 25 '14 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.