SQL Server 2005 – How to find Sql server Uptime

Two ways to find the system uptime for production server by using windows command that is systeminfo. Second option is using system table or views in sql server. When you execute systeminfo to command prompt, you will find the system related information including processor information, memory related info, system up time and many more as shown below.

Systeminfo command to find sql server uptime

C:>systeminfo

Host Name: SANDY-PC
OS Name: Microsoft Windows 7 Ultimate
OS Version: 6.1.7600 N/A Build 7600
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
Registered Owner: Sandy
Registered Organization:
Product ID: 00426-OEM-8992662-00497
Original Install Date: 11/09/2011, 5:58:42 PM
System Boot Time: 11/03/2012, 10:16:49 AM
System Manufacturer: Dell Inc.
System Model: Inspiron 1545
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 23 Stepping 10 Genuine Intel ~1188 Mhz
BIOS Version: Dell Inc. A10, 17/07/2009
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume1
System Locale: 4009
Input Locale: en-us;English (United States)
Time Zone: (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
Total Physical Memory: 4,056 MB
Available Physical Memory: 2,009 MB
Virtual Memory: Max Size: 8,111 MB
Virtual Memory: Available: 5,733 MB
Virtual Memory: In Use: 2,378 MB
Page File Location(s): C:\pagefile.sys
Domain: WORKGROUP
Logon Server: \\SANDY-PC
Hotfix(s): 2 Hotfix(s) Installed.
[01]: KB978601
[02]: KB979309
Network Card(s): 4 NIC(s) Installed.

…….. many more

Also we can use system table to find the out uptime, as we know whenever sql server restarts it creates new tempdb. So we can run below query to find the last time when sql server started.

Example using sql script

USE master;

SELECT crdate FROM sysdatabases WHERE NAME=’tempdb’

It will return date and time of sql server tempdb database.

By using below query on dynamic view we can extract uptime in sql server 2008.

select sqlserver_start_time FROM sys.dm_os_sys_info

 

Leave a Reply

  

  

  


+ 6 = 8