How to Create a Suspect Database???….

Yes, You heard it right! How to Create a SUSPECT Database. You might be thinking, why would someone make a Database Suspect! I got you! Well, This post is not to teach you how to make your Production Database as “SUSPECT” 😉  I thought of sharing this Info, to fight a PANIC situation where you see a SUSPECT Database in your environment.  Create a SUSPECT Database in your play area and practice how to recover from that situation, get familiarize with a SUSPECT DB and play with it and try to recover from it far before a real Disaster hits your Prod Database(I hope not).

In this post, I’m not going to show how to recover from “SUSPECT DB”, Instead just to simulate a scenario where your DB goes into SUSPECT State. Let’s begin!!!…

Couple of months ago, I’ve written a small blog post(see here) on how to simulate 824 Error using Hex Editor. I’ll be using the same tool to achieve our goal here in this post.

Simple Method:

Step 1: Create a Dummy Database to play with.

Step 2 : Shutdown your SQL Server DB Engine Service.

Step 3: Open your LDF file with Hex Editor and edit it manually with few Bogus entries.

Step 4: Start your SQL Instance, you should be seeing your Database marked as Suspect by SQL Server.

Alternate, more practical method:

Step 1: I’ve created a dummy database to play with “Suspect_tst”.

Step2: I’ve started an explicit transaction(but didn’t committed or Rolled Back) and left it as an Open transaction and did a Checkpoint.

Step3: Force Shut down your SQL Server.

Step4: Open your ldf file in Hex Editor and choose a random row and fill them with some random bogus values same as in method 1.

Step5: Start your SQL Server, You will be seeing a Suspect Database 🙂

You can see the below Screenshot what i meant in Steps 1 and 2.

Now, as of Step 3, all you’ve to do is just open a new query and type “SHUTDOWN  WITH NOWAIT;“(Never ever run this on Production, Trust me, you’ll immediately loose your job:D)

for Step 5, as you can see in the below screenshot, I’ve opened ldf file and filled in 2nd Row with all 1’s.

Save and now Start your SQL Server Instance! Once SQL has been started, query your DB Status as shown below.

Tadaaaaa! We did it….:)

Now, you know how to simulate this most disastrous situation, play with this database for recovery, loosing as less amount data as you can. Cheers!

GeekBench – Bench Marking your Server!!

GeekBench……One of the Best Benchmarking tools available for Server Admins! Well, I didn’t mean that’s a useful tool only for Server Administrators. We, as a SQL Server DBA can run this tool against our servers to obtain Geek bench scores! You can run this on your Laptops as well!!Yeyyyyyy…..Check for your Geek bench Scores if you brought a brand new laptop 😉

For more info, please visit http://www.primatelabs.ca/geekbench/

Actually I’ve downloaded latest version of Geek bench(Trail version/Tryout mode) and the Scores are as follows…

Just Click on Run Benchmarks and the results from my laptop are as follows!! Please note, in trial mode, X64 benchmarks are disabled 😦

As you can see Geek Bench gave my laptop score 2542 😦 Which is obviously a very poor Score. (Well, i bought this Laptop for 550$ almost 2 years ago…..and it is happily handling 3 Instances of SQL Server 🙂 )

Actually you can submit your Scores to geek bench to compare and contrast with all the other submissions on a similar build. For example You can see the below screenshot for all the Dell Studio 1555 scores being submitted.

As you can see this guy hardly exceeded a score beyond 3000 and my laptop scored 2500+! Cheers…

If you are interested in my total scores, please click here

BGINFO – Sysinternals

Let’s deviate a little bit from SQL Server in this Post;)
Let’s get Straight to the point! Have you ever been in a situation logged in to your Windows Server and searching for “Service Packs Installed, IP Configurations, DNS Details, Boot Time, Drive/Volume(s) Information with the Free Space, Logged on Domain, Installed Memory and all that Cool Info..”? Yes, As a SQL Server DBA we need to know that information(at least few from the above mentioned) in few scenarios while troubleshooting few issues. Basically to get all the above mentioned details, we need to dig into multiple tools which are available from Windows Server..

What if you can pull that information from a single location just at a Glance, that too on your Desktop Just as a Wallpaper?? Exciting Right!! This might be already known to most of folks out there….But in case, if you are not aware of this, We can achieve this using a fabulous Free tool from our Microsoft SysInternals called “BGINFO“.

You can download this Tool from http://technet.microsoft.com/en-us/sysinternals/bb897557. Again, this is a free tool from Sysinternals! Actually I’ve downloaded and Installed on my Server and now When i logged in to the Server, I’m welcomed with a Background all the cool Info as you can see in the below Screenshot.

 

So, is this the only information what you can get?? Noo….You can actually edit what you want to see on your Desktop. Just double click on bginfo.exe and you’ll be getting many other options and you can also change the position of text to be displayed as you can see below.

Download this Fabulous little tool and Install it on your Laptops and See what i’m talking about:)