How to boot directly into your regular desktop Screen in Windows 8.1?

With the new windows 8.1, it is very simple to bypass the new start(Live Tiles) Screen if you want to and directly boot into regular Desktop mode. Let me show you how…

Nope! That’s not a setting in control Panel and not even in your task manager….! Once you login to your windows machine, switch to your legacy Desktop screen  and right click on task bar and go to Properties and navigate to “Navigation” tab.  Now at the bottom section(Start Screen) select “When I sign in or close all apps on a screen, go to desktop instead of start” as shown below and click Apply->ok. That’s it…You are good to go 🙂

1

 

Very Simple huh…!

SQLBuzz – 2012 in Review.

🙂 🙂 🙂 🙂 🙂 :)……………

Here’s an excerpt:
19,000 people fit into the new Barclays Center to see Jay-Z perform. This blog was viewed about 74,000 times in 2012. If it were a concert at the Barclays Center, it would take about 4 sold-out performances for that many people to see it.

Click here to see the complete report.

What’s the worst advice you’ve ever seen(got) on a SQL Server Database…?

Guys, let me ask you this. What’s the worst advice you ever heard something related to SQL Server? Today I’ve seen a public forum where bunch of people are discussing on “How to Shrink a SQL Server Database”. Believe me guys…I can say, not even a single reply came from a real DBA and the guy who was looking for solution, tried all the bogus recommendations given by people without really understanding what he’s doing and how things work in SQL Server.

let me share few highlights! ( Forum Discussions in Red)

Q) I’ve deleted whole bunch of data from SQL Server with delete statement and why my SQL Server Database size not reduced? Google says to Shrink, How can I do that?

Re1: Shrink your LDF File, if it doesn’t work Shrink MDF File. If you Shrink your Database, your DB Performance Increases. It is advised to Shrink the Database everytime you take a Full backup. – OMG!!…Really? I’ve no idea where did he got this advice from.

Re2:  I Agree with Re1, actually your performance increases if you Shrink your DB!!

Now the person who asked the question goes “I’m trying to shrink Log file, but size is not reducing”

Re3: Do a Log backup with Truncate_only Option and then Shrink the File.(Interestingly some other guy is advocating this approach)

Now comes the Best part….

Re4: Take Log Backup, LDF file Size should reduce by this. If this doesn’t work Rebuild the Log File, taking the Database Offline. After doing both the steps change the Rec Model to Simple from Full. Even if this doesn’t work your last option is to restart SQL Server Services.

I couldn’t read any further and closed my window immediately!  Holyyyyyy…………..This made my day. I was laughing rolling all over the floor!

Guys, This is my advice – Don’t fall in trap of every advice you see floating all over internet. Don’t trust anyone’s advice blindly(Including me). You’ll end up loosing your Job, if you do without really understanding what people are advising you to do. There are many places where you can get real useful advises on SQL Server. Look for MSDN, BOL, Technet, SQLCAT, post your Q with #sqlhelp in Twitter. There are many kind and awesome MCM’s and MVP’s who can suggest you correct recommendations and make you understand what really SQL does when you do something on your SQL Server. It’s up to you Whom to trust and whom not to trust….

Also, I’ve seen many cases where people just don’t admit that they don’t know something! What’s wrong in it saying “I don’t know” if you really don’t know?? It is better to admit “I Don’t know, or at least say I’m not sure though” instead of advising some stupid recommendations right?…

Again…as i said earlier, It’s all up to you to decide whom to trust and whom not to.

Cheers!

PetaBytes(6000 TB) SQL Baby – Single SQL Server DB Backup File!!!!!!

Well, Today will be one of my Most memorable days in my SQL Server Career! Anyone Curious Why?? We got a Database Backup from one of our Vendors sizing 6 PB!!!!@$@$$%$@!!!! Yes, You are reading it right. It’s 6000 Tera Bytes! Let me tell you guys the story in short…

It was  just an another typical day for our DBA team and we all were busy with some routine tasks and some ongoing projects…All of a sudden, one of our DBAs was all excited to see a Backup file on a Network Share with a size of 6PB and..we all went to his cube for double checking the size of file what windows is showing. Yes, he was correct…That’s the largest Backup file(Well, any file in that matter) which I never saw in my entire life so far!

See the Screenshot below….

Please Ignore the Ugly Black Spots and just look at the size 😀

Well, am not sure if we could ever restore that file with native methods. First of all, is it a valid Backup file? Am not sure! What in the world are they storing in that Database? I Don’t Know…Even I’m very very curious to see what it turns out ultimately. I’ll chase my fellow DBA for sure to see what is this all about 😀

I just couldn’t stop sharing this with you all before I get more info on this. I Bet, this is the largest Backup File you might’ve ever seen(for maximum viewers of this post)!

If this is a valid Backup file and If the Database Size is really 6 PB, Then, I can proudly shout, our team supported one of the worlds largest SQL Server Databases 😀

I can’t even imagine how to maintain such a huge Database with all routine Maintenance tasks which a typical SQL Server Database needs!!!

How to Truncate/Delete all Tables in a SQL Server Database?

How to Truncate/Delete all Tables in a SQL Server Database in three simple steps????

Howdy! In this post let’s see how to truncate/delete all the tables in a given SQL Server Database and few important considerations while doing so.

Today, I had a request from one of my Application teams to copy a database from Prod to QA and truncate all the tables. It was a very small Database(7.2 GB) but had 250+ tables with manyyyyyyy Foreign Keys. So, I had to deal with Constraints before SQL Server allows me to truncate any table which is being referenced by some other table. Basically I’ve to follow the child-parent hierarchy to do so. I started with scripting out all the Foreign Keys and thought of dropping all of them and do a truncate and then recreating. Well, immediately something came to my mind….”How about Disabling Constraints and do my work and then re-enabling Constraints”

Imp Note: We can’t Truncate tables with just Disabling Constraints. SQL allows only if you drop them physically.

So, what is the Option I’m left with. Well, Delete is my weapon now.

How I did this was..

Step 1:  Disable all the Constrains

Exec sp_msforeachtable “Alter Table ? NOCHECK Constraint all”

Step 2: Delete data from all the Tables

Exec sp_msforeachtable “Delete From ?”

Step 3: Re-enable all the constraints which we disabled in Step 1

Exec sp_msforeachtable “Alter Table ? With Check Check Constraint all”

I Know, I Know….sp_msforeachtable is old school technique and deprecated, but am Okay as long as I Know there’s no harm using it and making my life easy 😀

So, what should we keep in mind if we are considering this approach??

The Very First thing is your Transaction log. How much room do you’ve for your T-log to grow is single most important consideration for this approach. Because Step2 will run as a single Hugee…..transaction. Let me say this in other Words, My Database was in SIMPLE Recovery Mode and I was monitoring the T-Log constantly..It grew upto 15.4 GB for doing this Delete(and the entire Database Size was 7.2 GB). Just Make sure….you are good here before taking this approach for a Medium-Large Database. Once you are done with this, do not forget to bring down your T-Log size accordingly.

Hope this helps!