90 likes | 162 Views
SQL Server 2008 – B ac kup and Restore Da tabase. Learningcomputer.com. Why Backup?. Hard Disk failure Motherboard failure Power outage or surge Accidental deletion of data Malicious deletion of data Personally for me I do it to Keep my Job!. Terminology.
E N D
SQL Server 2008 – Backup and Restore Database Learningcomputer.com
Why Backup? • Hard Disk failure • Motherboard failure • Power outage or surge • Accidental deletion of data • Malicious deletion of data • Personally for me I do it to Keep my Job!
Terminology • Backup means to make a copy of the database either full or partial • Restore means to replace your current database with a backup • Disk is referred to a storage medium like physical hard drive • Device can refer either to a Disk or Tape • Backup types are Full, Differential, Log and Filegroup
Types of Database Backups • Full Database Backup • Transaction Log Backup – A sequence of log backups provides for a continuous chain of transaction information • Differential Database Backup – backup data since last backup – faster in case of many transactions • Filegroup Backup – lets you backup to different filegroups and is very fast
Full Database Backup • This re-creates the database as it was when the backup operation completed • There is no way to recover any modifications made to the database after the most recent database backup • Use this method when you need to implement simple maintenance procedures • Use this for a read-only database
Differential Database Backup • A differential database backup records only those data changes made to the database after the last full database backup • Unlike the log backup, it cannot be restored to a particular point in time • A differential database backup is smaller and takes less time to complete than a full database backup
Transaction Logs Backup • Allows you to re-create the database without a full db backup • This saves time when restoring the db • Transaction log can be cleaned after a log backup • Lets you restore to a certain point in time • Database changes are frequent
Filegroup Backup • This lets you backup database to filegroups • This helps you backup in a short time • This method is typically used to backup VLDB • Also need to backup transaction log
Backing Up database in SQL Server • Three options • SQL Server Management Studio • Transact SQL • Maintenance Plan • Demo: • We will backup AdventureWorks2008 to our local disk • We will do a Full database backup, change information, do a differential backup, change more information, do one log backup, make final changes and then do a last log backup