檢查SQL Server重啟時間(Restart Time)

因為有收到叫修事件,需要確認SQL Server 是否有被重啟的狀況
以下是檢查DB啟動時間的方式.

  • 檢查 error log
    sp_readerrorlog 0,1,’Copyright (c)’
  • 檢查tempdb 重建時間
    SELECT create_date FROM sys.databases WHERE name = ‘tempdb’
  • sqlserver start time in sys.dm_os_sys_info
    SELECT sqlserver_start_time FROM sys.dm_os_sys_info
  • login_time from sys.dm_exec_sessions
    SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1
  • SSMS 報告
    Reports > Standard Reports > Server Dashboard
  • Event viewer
    start -> run -> eventvwr

資料來源:
https://social.technet.microsoft.com/wiki/contents/articles/22040.sql-server-find-windows-and-sql-server-last-restart-time.aspx

分類: SQL Server。這篇內容的永久連結