Sep 2, 2010

Digg v4? WTF?

I haven’t been on Digg.com too much lately. I used to frequent it pretty regularly when I as submitting a lot of stuff there, and fellow Bauer-Power contributor FreedomChicken and I decided we would try our hands at creating a Digg army, and try to game the system. I stopped hanging out there when they got rid of the shout feature. After that I found it was just too hard to try to game the system.

Well lately I have been seeing a lot of activity on Twitter. Mainly it is directed at Digg founder Kevin Rose, and almost all of it is really negative! I was wondering what was going on, so I decided to check out Digg. There it was, Digg version 4! With this new version they have tried to make it so that Power Diggers cannot possibly control the front page. In fact, just about all of your stories come from RSS feeds from other popular sites like Mashable, Engadget and others. The rest are articles of the people you are following on Digg. Did I say following? Sounds Twitter like doesn’t it? Well it is exactly that, a complete rip-off of Twitter!

digg.com

Now if you go to the site, you see a bunch of Reddit submissions dominating the front page. If you didn’t know, Reddit is probably Digg’s biggest competitor in social news. These submissions from Reddit are of course in protest to the new fangled Digg v4. in fact one article boasts that Digg v4 has caused Reddit traffic to spike, and registrations to soar!

Besides the changes that sort of make Digg different than what made people love it in the first place, it is also full of bugs. Logging into it this morning I was greeted by numerous errors, and problems. Here is one of them:

digg broken axleI think I can push through the changes. In fact, this might be good for gaming Digg again because in theory, the more followers to can acquire, the more diggs your submissions will get. Also, you can add your site’s RSS feed to Digg so that your stuff gets auto-submitted.

What do you think? Do you like the new changes? Do you hate them? What is your least favorite feature of the new Digg? Let us know in the comments.

Technorati Tags: ,

Sep 1, 2010

How To Restore Multiple SQL Databases At One Time

At my day job we are getting ready to move our hosting environment from one colocation facility to another. Sounds easy enough right? Well it is if you can afford some down time, or of you have some money to buy more equipment to replicate your environment. If you are working on a shoe string budget though, then you have to get creative.

One of the things I have been working on lately is migrating SQL data from a very large Microsoft SQL server that has multiple instances, each with about 100 databases or so. These four instances were originally stored on one physical server with no redundancy. Bad idea right? Well, at our new data center I have configured two fail-over SQL clusters to house all of this data. I am moving two instance per cluster. I would have built two more clusters, but I just don't have enough SAN space at the new data center yet. Anyway, In order to migrate the data relatively quickly, I hooked up a USB hard drive to the physical SQL server and created a maintenance job on each instance to backup all the databases to the USB drive. Now with all that data on the USB drive, I drove it over to the new data center, and hooked it up to a server there and shared it out. Now the tricky part, restoring all those friggin' databases! All friggin' 400 some odd databases!

Now I'm not a DBA, so I don't know T-SQL scripting at all, but I was able to figure out something. If you go through GUI (Microsoft SQL Manager) and go through all the steps to do the restore, right before you restore there is an option so save that job as a T-SQL script! Boom!



So now that I have gone through the motions of restoring one, I get a little bit of code similar to this:

RESTORE DATABASE [DB_RESTORE] FROM DISK = N'\\<FILESERVER>\<FILESHARE>\DB_Backup.bak' WITH FILE = 1, MOVE N'DB_Backup' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE.mdf', MOVE N'DB_Backup_log' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE_1.LDF', NOUNLOAD, STATS = 10

GO

Cool, now all I had to do to restore multiple databases was to copy and paste the above code (Before the GO line) over and over again, and changing the database information to match the other database names and backup files. For example, restoring three databases at once would look like this:

RESTORE DATABASE [DB_RESTORE1] FROM DISK = N'\\<FILESERVER>\<FILESHARE>\DB_Backup1.bak' WITH FILE = 1, MOVE N'DB_Backup1' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE1.mdf', MOVE N'DB_Backup1_log' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE1_1.LDF', NOUNLOAD, STATS = 10

RESTORE DATABASE [DB_RESTORE2] FROM DISK = N'\\<FILESERVER>\<FILESHARE>\DB_Backup2.bak' WITH FILE = 1, MOVE N'DB_Backup2' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE2.mdf', MOVE N'DB_Backup2_log' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE2_1.LDF', NOUNLOAD, STATS = 10

RESTORE DATABASE [DB_RESTORE3] FROM DISK = N'\\<FILESERVER>\<FILESHARE>\DB_Backup3.bak' WITH FILE = 1, MOVE N'DB_Backup3' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE3.mdf', MOVE N'DB_Backup3_log' TO N'E:\MSSQL10_50.SQLSERVER\MSSQL\DATA\DB_RESTORE3_1.LDF', NOUNLOAD, STATS = 10

GO

After I had my script in order, all I had to do after that was to create another maintenance job on the new cluster to run my T-SQL script above. I had to set the timeout to about 60000, and just let it run. After about ten minutes or so I had all the databases restored! It actually took me longer to generate the script than it did to restore all the databases!

Make sure that if you are using the above code to change it to fit your environment!

Now if you know of an easier, or better way of doing this, I am all ears. All though creating the script was fairly easy, it was tedious as a mother f**ker to copy and paste all the info needed for 400 some odd databases. Please let me know in the comments if you have done this before, and did it differently.