Sunday, September 10, 2006

BackUp and Restore SQL Server Databases:
Backing up the SQL Server Database:
BackUp Types:
Full backups:
This back up type backs up the entire database including part of the transaction log
Full differential backups :
A full differential backup records only the data that has changed since the last database backup.
Partial backups:
A partial backup is similar to a full database backup, but need contain only the primary filegroup and all read-write filegroups.
Partial differential backup:
A partial differential backup contains only data that has changed in the primary and all read-write filegroups.
File and filegroup backup:
A filegroup backup is a single backup of all files in the filegroup and is equivalent to explicitly listing all files in the filegroup when creating the backup. Files in a filegroup backup can be restored individually or as a group.
Simple Backup Command:
BACKUP DATABASE [DATABASENAME]
TO DISK=[BACKUPPATH]
Its always recommeded to save the backup with the .bak file extension.
Backup options:
MIRROR TO: Creates the another backup in the MirrorTo disk.
BACKUP DATABASE [DATABASENAME]
TO DISK=[BACKUPPATH]
MIRROR TO DISK=[MIRROR TO PATH NAME]
WITH [OPTIONS]

WITH OPTIONS:
FORMAT NOFORMAT
BLOCKSIZE
CHECKSUM NO_CHECKSUM
EXPIREDATE
RETAINDAYS
PASSWORD
INITNOINIT
SKIPNOSKIP
REWIND NOREWIND
UNLOAD NOUNLOAD
RESTART
STATS
COPY_ONLY