Skip to content

SQL Server 2005 Backup

January 22, 2008

Most of the people, if not all, who work around the SQL Server know how to backup their databases by heart. They can even do the task in their sleep. Some may find this article useful, though.

What we’re going to do here is do the 3 backup types: Full, Differential, and Transaction Log Backups.

Here’s how to backup a SQL Server Database (suppose we’re backing up the AdventureWorks Database):

1. Create a directory: C:\myBackUpDir (you may want to create this in a separate physical disk)

2. Open SSMS, and connect to the instance. Open a new query.

3. Execute a Full Backup:

BACKUP DATABASE AdventureWorks TO DISK = ‘ C:\myBackUpDir\ADVWRKS.BAK’

4. Since we also want to create a Differential backup, make any change to one of the tables in the AdventureWorks Database. Next, we want to backup the Transaction Log and capture the change that has been made. Execute:

BACKUP LOG AdventureWorks TO DISK = ‘C:\myBackUpDir\ADVWRKS01.TRN’

5. Let’s just say we want to do another change to the same table on # 4 [for the purpose of creating our Differential Backup]. To execute a Differential Backup:

BACKUP DATABASE AdventureWorks TO DISK = ‘C:\myBackUpDir\ADVWRKSdiff.BAK’ WITH DIFFERENTIAL

6. Since we want to practice backing up with all the 3 types of backup, we may want to do another change to the same table on # 4. Then we perform the Full Transaction Log Backup by executing:

BACKUP LOG AdventureWorks TO DISK = ‘C:\myBackUPDir\ADVWRKS02.TRN’

To sum up, we have performed the three types of SQL Server 2005 Backups, namely, Full Backup, Differential Backup & Transaction Log Backup.

Advertisements
4 Comments leave one →
  1. Jack Hills permalink
    February 6, 2008 3:41 PM

    Thanks for your guide.
    It covers the basics, and shouldn’t be missed!

    In our company for a year or so for regular sql backups we’ve been using LiteSpeed.
    It works perfect in our environment, supports like 10 levels of compression and encryption and includes a ton of built-in features. For example, it has the ability of creating self-extracting database backups. This way they can be easy shared with company divisions that may not be using backup compression software.

Trackbacks

  1. Automated SQL Server Back: Poor Man’s Edition « Dangling On The Shoulders Of Giants

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Archives


  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Business Career DBA Tool Events free ebook Humor IT News Members Only Microsoft MySQL Operating System Oracle Personal Reporting Services SQL Server SQLServerPedia Syndication SSC SSIS TSQL Tutorial Uncategorized Video

  • Software Blogs - BlogCatalog Blog Directory
  • %d bloggers like this: