How to find the last time SQL Server was started? Part l

In this blog, let’s take a look at different ways we can check the date and time SQL Server was started last time. There are multiple ways to do it and each of them has its pros and cons.

Using TempDB

The first method we shall look is to see when was the TempDB created. If you recollect,  one of the first things you have learnt about TempDB is it a database used to store objects temporarily and is refreshed/ recreated every time SQL Server is started. Here we would use the creation time of TempDB to determine when was the SQL Server started last time. To do this, open SQL Server Management Studio, go to object explorer, expand databases node/folder. Expand System databases and right-click on Tempdb as shown below and choose properties. 

Database properties window of Tempdb is displayed. In the very first screen when the General page is selected you can notice the Date Created column (highlighted below)…

This way of finding information from Tempdb creation is the easiest way I feel. This step is

SQL Server Error Log

Another way of finding the same information is from the SQL Server Error Logs. This is also one of the easier ways of finding the SQL Server start time, but can be tricky sometimes, which I shall explain in a while..

First let’s take a look at the steps to perform this task. In object explorer, expand the Management node and find SQL Server Logs. Right click on SQL Server Logs and go to View –> SQL Server Log (as shown below). These SQL Server Logs contain very important information regarding that SQL Server. Every time SQL Server is started, entries are written in the SQL Server Log.

When the entries in Error Log are displayed, you can scroll down to the row which contains the SQL Startup information. In the picture below, look at the entry at 8/27/2011 7:48:06 PM.

It looks like you could find the startup information in SQL Error Log easily, but in some cases it might not be that way. Every time a database backup is performed, there is an entry in the SQL Server Error Log which on an SQL Instance with multiple databases will result in a large number of entries and it would make it difficult to find this information easily. Also, in some cases the Error Log would be regularly recycled in order to ensure that it is easier to read the Error Log and once the maximum number of Error Logs are reached, SQL Server disposes the oldest Error Log when it has to create a new one.

There are other ways to find the SQL Server startup time, which we shall look in my next blog.

Part 2 of this blog can be found here How to find the last time SQL Server was started? Part ll

Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.

–Bru Medishetty

Hopefully less SPAM from now on….

Yes, I am hopeful there would be less SPAM comments to the blogs moving forward. I had been having a huge number of spam comments which are no way related to the site’s content. I tried to reduce the spam comments in many ways and every time I login to write a blog post, I would see lots of comments in queue held for moderation. Having patiently done that for over a year, I finally disabled comments to all of my blogs few months back. Now I have re-enabled comments to my blogs and this time I have enabled comments using Disqus.

Will look forward how this goes and hopefully makes easier for readers to post their replies..

–Bru Medishetty

Download SQL Server 2008 SP3

Microsoft has recently announced Service Pack 3 for SQL Server 2008. There is a separate file for each version (IA64, x86 and x64), download those that apply to your SQL Server installation.. Please visit the download page here..   Service Packs are released to address known issues and bugs and also few enhancements to various sections of the SQL Server product. To find a list of bugs and issues that are addressed in SQL Server 2008 SP3, please visit the link http://support.microsoft.com/kb/2546951.

Some of the enhancements are:

  • Enhanced upgrade experience from previous versions of SQL Server to SQL Server 2008 SP3. Increased performance & reliability of the setup experience
  • In SQL Server Integration Services logs will now show the total number of rows sent in Data Flows.
  • Enhanced warning messages when creating the maintenance plan if the Shrink Database option is enabled.
  • Resolving database issue with transparent data encryption enabled and making it available even if certificate is dropped.
  • Optimized query outcomes when indexed Spatial Data Type column is referenced by DTA (Database Tuning Advisor)
  • Superior user experience with Sequence Functions (e.g Row_Numbers()) in a Parallel execution plan.

And last but not the least, before installing the SP3 take a minute to read the SQL Server 2008 SP3 release notes

Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.

– Bru Medishetty