Common SQL Server Backup Problems

907 views

Published on

There are a number of common backup problems that occur within SQL Server. This presentation goes over those problems, how they evidence themselves, and how you go about addressing the issues.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
907
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Common SQL Server Backup Problems

  1. 1. Grant Fritchey | www.ScaryDBA.com www.ScaryDBA.com Common Backup Problems Grant Fritchey, Red Gate Software
  2. 2. Grant Fritchey | www.ScaryDBA.com Goals  Identify common backup issues  Prevent those issues from occurring 2
  3. 3. Grant Fritchey | www.ScaryDBA.com Agenda  SQL Server Backups  File Backups  Drive Space  FullTransaction Log  Network Backups  Differential Only  Broken Backup Chain  TheWrong Server  Backup Load  BackupTesting 3
  4. 4. Grant Fritchey | www.ScaryDBA.com grant@scarydba.com www.scarydba.com @gfritchey www.linkedin.com/in/scarydba Grant Fritchey Product Evangelist, Red Gate Software
  5. 5. Grant Fritchey | www.ScaryDBA.com SQL Server Backups  Complete copy of the database » Not an export » Not a script » Not a file copy  Principal means of protecting the business data  Multiple BackupTypes » Full » Differential » File/FileGroup » Log » Partial 5
  6. 6. Grant Fritchey | www.ScaryDBA.com File Backups  Indications » File backup only » Expected restore from .MDF & .LDF files  Cause » SQL Server locks the files while they’re in use  Remedy » Run a real backup » Stop the server, copy the files, start the server (and no, I’m not serious)  Emergency » Try using ATTACH, but don’t hold out hope 6
  7. 7. Grant Fritchey | www.ScaryDBA.com Drive Space  Indications » Errors on backup » Alerts on drive space » No backups available  Cause » Not monitoring drive space » Database size increased  Remedy » Monitor your drive space » Clean up backups » Monitor database size  Emergency » If the backup failed, no options 7
  8. 8. Grant Fritchey | www.ScaryDBA.com Full Transaction Log  Indications » Log files constantly growing » Transaction errors caused by full file  Cause » Log backups failed » Log backups never implemented  Remedy » Set up scheduled log backups » If FULL RECOVERY not needed, switch to SIMPLE  Emergency » Attach an additional log file — Not always possible 8
  9. 9. Grant Fritchey | www.ScaryDBA.com Network Backups  Indications » Backups extremely slow » Timeout on backups » Resource contention on server  Cause » Backing up across network instead of through dedicated fiber channel  Remedy » Backup to “local” drive » If needed backup locally then copy the file  Emergency » Do it anyway 9
  10. 10. Grant Fritchey | www.ScaryDBA.com Differential Only  Indications » Error, no files ready to roll forward  Cause » No FULL restore run » Full restore run, but database recovered  Remedy » Run a FULL restore » UseWITH NORECOVERY on restore » Make sure you have a FULL backup  Emergency » With no full backup, no options 10
  11. 11. Grant Fritchey | www.ScaryDBA.com Broken Backup Chain  Indications » Error: Database has not been restored to the correct earlier state  Cause » Wrong Full backup » Extra Full backup taken  Remedy » Use correct Full backup » Use SNAPSHOT » Use COPY_ONLY  Emergency » If you have all the log backups, you can use those instead 11
  12. 12. Grant Fritchey | www.ScaryDBA.com The Wrong Server  Indications » Phone is ringing  Cause » Ran a restore on wrong server » UsedWITH ROLLBACK IMMEDIATE  Remedy » Use different security for production » Color code production servers » Don’t use ROLLBACK IMMEDIATE  Emergency » Yes it is 12
  13. 13. Grant Fritchey | www.ScaryDBA.com Backup Load  Indications » Excessive CPU or I/O contention » Waits on backups » Blocking  Cause » Excessive load on server makes backups difficult  Remedy » Backup from AlwaysOn  Emergency » Do what you must 13
  14. 14. Grant Fritchey | www.ScaryDBA.com Backup Testing  “You’re only as good as your last restore” KimberlyTripp (as far as I can determine)  DBCC » Against Production » Against a Backup  CHECKSUM » Added overhead  VERIFYONLY » Header only without checksum  RESTORE » Like nuking from orbit, the only way to be sure 14
  15. 15. Grant Fritchey | www.ScaryDBA.com Goals  Identify common backup issues  Prevent those issues from occurring 15
  16. 16. Grant Fritchey | www.ScaryDBA.com Resources  Scarydba.com/backup  Preventable Backup Errors: http://www.simple- talk.com/sql/database-administration/7-preventable- backup-errors/  Backup and Restore for the Accidental DBA: http://www.simple-talk.com/sql/database- administration/sql-server-backup-and-restore-for-the- accidental-dba/  SQL Server Backups: http://www.simple- talk.com/sql/backup-and-recovery/sql-server-2005- backups/ 16
  17. 17. Grant Fritchey | www.ScaryDBA.com Questions? 17

×