A
DBA would always like to know when the database server was restarted last time,
this helps them to figure out or track the issues related to the server,
whether it was automatically restarted due to power failure or somebody
has restarted, at least they will get some clue about the database server
during the troubleshooting.
There
several ways you can check when was SQL server restarted last time.
Below are some sql queries/Command to quickly find out the server
restart date time.
We can run any one of below, all will give same
result.
- Last SQL Server instance restart.
- Last DB server (windows services) restart.
HOW
TO CHECK?
SQL
Server Restart:
We
can check it easily and by the Easiest ways (SQL Query)
SELECT sqlserver_start_time FROM sys.dm_os_sys_info
SELECT 'Statistics since: ' + CAST(sqlserver_start_time AS VARCHAR) FROM sys.dm_os_sys_info
OR
EXEC SP_HELPDB 'Tempdb'
DB Server (Windows
Services) Restart:
Option 1-
This method helps you to
figure out root cause for the restart.
Start -> run -> eventvwr
Choose: Windows Log – > System
Open filter and following Event Id’s
6005 to see when the Event
Log service was started. It gives the message “The Event log service was
started”.
6006 to see when there was a clean shutdown. It gives the message “The
Event log service was stopped”.
6008 to see when there was a dirty shutdown. It gives the message “The
previous system shutdown at time on date was unexpected”.
6009 is logged during every boot.
Option(CMD) 2-
·
Run the
following from a command prompt:
systeminfo | find “Time:”
OR
·
Run the
following from a command prompt:
net statistics server
About Author:
Raghwendra Mishra is DBA who works as associate consultant with Systems Plus Pvt. Ltd. He in free time reads and write on various web technologies. He can be contacted at: raghwendra.mishra@spluspl.com
THANK YOU FOR THE INFORMATION
ReplyDeletePLEASE VISIT US
erp solution providers
Good content network switches suppliers in dubai
ReplyDelete