Backup and restore

353 views

Published on

1. Script backup
2. Recovery models
3. Backup type(Full,differential, transactional)
4. Transactional logs
5. Point in time restore
6. Transactional log shipping
7. Recovery of deleted data without any backup

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
353
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Backup and restore

  1. 1. Backup And Restore Sql Server
  2. 2. Why database backup?  Is it possible to recover program?  Is it possible to recover data?  Large size of data.
  3. 3. Script Backup  Schema Only Backup  Good if database size is big  Data Only Backup  Good if database size is less  Schema and Data Backup  Useful in data migration  Auto schedule script backup
  4. 4. Transaction Log  Sql server keeps logs of every DML, DDL etc statements.  SELECT * FROM sys.fn_dblog(NULL,NULL)  If you do not back up the log frequently enough, the transactional log can expand until it runs out of disk space.  Recovery model control the transactional log backup.
  5. 5. How to create database backup  During the backup process sql server remains online.  Task which are not allowed:  Alter database with either the ADD FILE or REMOVE FILE option  Shrink database  Creation or deletion of database file.  Backup of File and File group
  6. 6. Recovery Models  Simple  Database Backup:Yes  Transactional Log Backup: No  Point InTime Restore: No  Full  Data Backup:Yes  Transactional Log Backup:Yes  Point InTime Restore:Yes  Bulk Logged  Data Backup:Yes  Transactional Log Backup:Yes  Point InTime Restore: No
  7. 7. Schedule database backup  Transaction Log Shipping  Create copy only backup  Maintenance Plan  By Sql Scrip And Agent Job  BACKUP DATABASE AdventureWorks2008 TO DISK = 'Z:SQLServerBackupsAdventureWorks2008.Bak‘
  8. 8. Point In Time Backup (Simple Recovery Model)
  9. 9. Point In Time Backup(Full Recovery Model)
  10. 10. Backup Types  Full Backup  Backs up the whole database.  As a database increases in size full it take more time to finish.  Differential Backup  First backup must be a full backup.  It captures only the data that has changed since that full backup.  Transactional Log Backup  Not possible in simple recovery model.
  11. 11. Restore Database  Restore database backup  Backup of recent version will not be restored in earlier version.  Backup of older version can be restored in recent version.  The whole database is offline for the duration of the restore  Recovery Mode:  WITH RECOVERY  WITH NORECOVERY  WITH STANDBY  Restore data file
  12. 12. Restore to Point of Failure
  13. 13. How to recover deleted data Without Any Backup?
  14. 14. Thank You

×