Hi Friends,
Today, I am focusing on the use of an undocumented command DBCC DBINFO. By using this command you can get some more interesting information about SQL Server Database Information Query. Actually, DBCC DBINFO gives you the information about metadata of the database which you provide as parameter. To see the output you have to turn on the trace flag 3604.
DBCC TRACEON (3604) GO DBCC DBINFO (SQLGEEKS)
From the above output you can get the information about database id, create date, compatibility level, Last log backup time etc. Here most useful information is db_dbccLastKnownGood. Which tells us the time when dbcc checkdb command last run successfully? This information will be very useful when you want to overcome from corruption problem.
Now another interesting thing is you can get all this information by using DBCC PAGE command. We know that Page of id 9 is the database boot page means it contain all the metadata information about that database.
DBCC TRACEON (3604) GO DBCC PAGE ('SQLGEEKS',1,9,3)
So you can use DBCC DBINFO or DBCC PAGE to get such type of information.
Regards
Prince Rastogi
Like us on FaceBook | Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook
Follow me on Twitter | Follow me on FaceBook
db_dbccLastKnownGood value is NOT 100% updated correctly every time DBA runs/schedule DBCC CHECKDB command.
It works only with PHYSICAL_ONLY clause. Perhaps you want to give a try.