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.

1_SQL_Server_Database_Information_using_DBCC_DBINFO_&_DBCC_PAGE

2_SQL_Server_Database_Information_using_DBCC_DBINFO_&_DBCC_PAGE

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.

3_SQL_Server_Database_Information_using_DBCC_DBINFO_&_DBCC_PAGE

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