I have been watching the SQL Server: Advanced Corruption Recovery Techniques by Paul Randal on Pluralsights. During module 4, he discusses the fact that if you have a missing log file it is important to know if the database was shutdown cleanly or not. This would determine if SQL Server will run crash recovery or not.
He goes on to mention, that the flag for this can be found in the database boot page (1:9 is my assumption based on the course materials and backed up through this link on microsoft). However, I do not see any obvious flags inside the page using -
DBCC TRACEON (3604);
DBCC PAGE ('stack',1, 9, 2) WITH TABLERESULTS;
DBCC TRACEOFF (3604);
In looking for this online, I am not able to find the information about the Boot page (1:9). I was able to find that sys.databases
has a column for is_cleanly_shutdown
which stands for:
1 = Database shut down cleanly; no recovery required on startup
0 = Database did not shut down cleanly; recovery is required on startup
However, I would like to follow along with the class, can someone advise what I am looking for in the boot page? Also, how to get the database to show it was cleanly shutdown or the proper steps to do this?
I am running SQL Server 2012.
m_flagBits
). I can think of two ways to be sure: (1) create scenarios where there is a log file missing and the database was or was not shut down cleanly, and inspect the boot page with a hex editor; (2) ask Paul. He's usually pretty responsive, especially with questions about his courses, as long as you are courteous when you ask.