Jul 29, 2010

Restoring Deferential backups in SQL Server (T-SQL)

In my previous post I demonstrated, how to restore deferential backups with SQL Management Studio. In this post, I'll show the same thing with T-SQL.

  1. Select the Master database.
    USE Master
    GO
  2. Restore the latest full back up with REPLACE and RECOVERY option
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\backup_201007282300.bak'
    WITH REPLACE,NORECOVERY;
  3. Restore all deferential backups except last one
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\201006110800.incr'
    WITH NORECOVERY;
  4. Restoration of Last back up file should be like this.
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\201006111200.incr'
    WITH RECOVERY;

Jul 26, 2010

Restoring Deferential backups in SQL Server

Did you have ever restored a SQL data base? If you are a developer probably not. With this post I'm going to show how to restore deferential backups step by step.

  1. One important thing, to restore deferential backups, you need to have latest full backup and subsequent deferential backups.

    Go to the SQL Server Management Studio, and select "Restore Database..." option by right clicking on Databases node in the Object Explorer. Follow the steps as shown in following screen shot.
  2. Figure 1
  3. Select "Options" from the left of the dialog and select the following option.
  4. Figure 2
  5. Now, note your data base's status has been changed to "Restoring".
  6. Figure 3
  7. Restore the number of subsequent deferential backups, except the last one, only with "RESTORE WITH NORECOVERY" option on.
  8. Restore last backup with default values of the option dialog box. That is with "RESTORE WITH RECOVERY" option. And also note the database status has changed back to normal.

Considerations:
  • This demonstration was done with SQL Server 2005 with SP2
  • Adhere necessary procedures with you company if you are going touch live data base.

Jun 8, 2010

Social Networks: The Other Aspect

As we know, social networks increasingly becoming new communication tool among us. Surprisingly the Public adopt such tools more quickly even without training. According to the Forrester Research two third of internet users (total internet users 625 million1 ) have joined a social network.

Why this becomes so popular? We can find very old friends, probably haven’t been meet them after high school, which is very good thing . Also social networking can use as mechanism of promoting your business. We have to pay less than TV or printed media advertisements.

Well, did you think about its other side?
  1. This will be affected to the country's productivity.
    Most of the companies in the world now blocking them in working hours. Some countries completely blocked such tools.
  2. People losing their privacy.
    It is found that more than 85% of users has crossed their line and suffering or will suffer consequence. This is a great place for being Identity theft. Also, I read some news someone had been robbed, because he or she put everything in the network including days he/she out of the town.
    Had several cases ended up with death.
  3. Law Enforcement
    Who will be the responsible for cases such as defamatory, obscene work? We can clearly see rules and regulations completely differ from country to country. Hence no guarantee for protecting such cases.
  4. Protection of Data
    The most important thing is, do these social networks can protect or have compliances on their users’ data. Very recently, one social network had information flaw and it’s been there since first release.
Ok. What we can do then? Should be completely dined?
  1. Don’t expose your too much information.
  2. Don not trusts anybody in the cyberspace.
  3. Avoid giving personal data.
  4. Limit the use of them and don’t be addicted.

1. It is expected that internet users will increase by 45% by 2013. (IT NOW Jan 2010)

May 30, 2010

New Look

It took me only 5 minutes to make complete change of my blog's look and feel. Blogger has cool feature "Pick Template" which makes our life easier.

Thanks for the blogger and guys who creating templates.

Mar 31, 2010

Skinput - Turns your body into an interface

Microsoft and Carnegie Mellon University, doing research for Skinput and showing how it can turn your body into an interface.   This product is still only POC. Check this video.



Sources:
http://www.bcs.org/server.php?show=conWebDoc.34927
http://www.msnbc.msn.com/id/35708587

Inside Microsoft Chicago data center

Microsoft opened its Chicago Data Center late last year. In its first phase, the ground floor of the facility is designed to hold up to 56 containers, each filled with anywhere from 1,800 to 2,500 servers.

Further said , building the data center required 2,400 tons of copper, 3,400 tons of steel, 26,000 cubic yards of concrete, and 190 miles of conduit.


More...

Mar 4, 2010

Calculating Elapsed Time Accurately (C#)

To calculate elapsed time in our code, we normally do ,

DateTime stTime = DateTime.Now;
.....
// Do some work here
....
DateTime etTime = DateTime.Now;
TimeSpan ts = etTime – stTime;
But, this method won’t always give accurate value. I found Stopwatch class in System.Diagnostics namespace to calculate accurate elapsed time. Should look into it.

using System;
using System.Diagnostics;
using System.Threading;
class Program
{
    static void Main(string[] args)
    {
        Stopwatch stopWatch = new Stopwatch();
        stopWatch.Start();
        Thread.Sleep(10000);
        stopWatch.Stop();
        // Get the elapsed time as a TimeSpan value.
        TimeSpan ts = stopWatch.Elapsed;

        // Format and display the TimeSpan value.
        string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
            ts.Hours, ts.Minutes, ts.Seconds,
            ts.Milliseconds / 10);
        Console.WriteLine(elapsedTime, "RunTime");
    }
}

Above example directly taken from MSDN. For more information check this link, http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx

MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...