............ Have a nice day............

Friday 26 July 2013

SQL Server 2005 Backup

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.
source:dbalink.wordpress.com

No comments:

Post a Comment