Finding your last SQL Server Reboot

01_Vault_101_Citizenship_Award

Pipboy level utility!

Why is this important?  Well statistics get cleared and updated when this happens, and we all know as a DBA your first task is taking control of the system and finding bottlenecks.  In my case indexing is always a thorn in my side…it’s an art and many times people just don’t have the eye for it.  As an example, I am querying stats and seeing that a certain index has had 90 reads and 1000 writes since the last restart (the numbers are just thrown out there, they are not an actual value).  In this case you might think that this is a bad index, possibly one that isn’t used as much as it is affecting write/update/delete operations.  You are probably right.  Now what if this is the statistics from only 2 days of use?

Pradeep Adiga has posted many ways on his blog to check when the SQL server was last restarted, the one I recommend using is:

SELECT sqlserver_start_time FROM sys.dm_os_sys_info;

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.