Backup, Restore and Options for SQL Server
Housekeeping Please be sure to answer survey (above video window) Ask questions at any time
Viewing Tip Enlarge Slides Now You can enlarge the window with the slides just click Enlarge Slides below. Get the slides
Agenda Overview of Backup/Recovery Planning Wizards Available Quick Overview of Jobs and Backups Restores how they work, how they re done The Cloud Options and Directions
Very similar A Note About Versions Will try to outline differences Look and feel more than Functionality Moving target and evolving technologies (esp. the Cloud pieces)
Using Azure or AWS/Cloud Services? Still need backup. MUST understand differences and approaches Trust, but verify, as with all backups procedures
Backup and Restore Purposes Broad catastrophic Oops corrections Targeted restores Business Intelligence You may want/need a plan for each of these.
Backup Plan Test Because it s not IF it s WHEN
Reliance on Wizards Incomplete strategy Food for Thought Database, Transaction logs, System Databases, no follow-up or testing
Key Questions How often do I need to backup? How many copies do I need to keep? How will they be restored/used? These determine your strategy and what you need to establish in terms of backup and recovery.
Understanding Backup Models Full Simple Bulk-Logged
Recovery Model: Full Full transaction log restore Restore the baseline db Restore the transaction logs in order Restored up to last tran. log backup Tail backups Watch the transaction log physical devices Beware total reliance on tran. log Best production environment option
Recovery Model: Simple Backup/restore at the database level Good for development environments Disaster recovery, but not transaction recovery since the last backup All or nothing restore Possible data warehouse application
Recovery Model: Bulk_logged Better for bulk operations Select into, etc. Good for a migrating database If the data exists elsewhere Can be rebuilt from other source Good for DTS move operations control log size build-up Restore to last transaction log backup Re-bulk-operation to get current again Switch to better model for production
Setting Recovery Models Database, Properties, Options
Best Practices Development to Production Development use a SIMPLE model Backup nightly/weekly depending on changes and your needs Production use a FULL model Backup nightly Determine interval for transaction log backups Be sure to remember to change when your database goes into production!
Planning Your System Disk space CPU utilization Split backup plans Database-by-database Filegroups Cloud impacts your backups (more later)
Overview of SQL Server Backups How do they work? Define a destination ( Backup Device ) Disk, tape, URL/Azure (SQL 2014) Decide what you want to accomplish Backup only Reorganize/defragment, etc. Setup a schedule Handle logging
Using the Wizards Wizard benefits Scheduling Other maintenance options (defrag, etc.) Backup vs. Maintenance Plan Wizards Great learning tool SQL Statements Scheduling Error handling
Database Maintenance Plan Wizard-Based Management, Maintenance Plans, Maint. Plan Wizard Suggestion: All user db s Make sure you setup system DBs Demo Demo Sample Maint Plan Output/SQL
Backup Considerations Keep in mind that verify integrity option = CPU stress Watch the retention values you provide Disk space usage Other storage usage (billable)
Notification and Reporting Options Consider emailing an operator
Understanding the Job System SQL Server Agent, Jobs You ll see different jobs for each plan you set up. Descriptive titles are helpful. DB Backup, Tran log backup, optimization, integrity checks Double-click any to review Scheduling and other options Demo Review the Agent Job
Setting Up Error Handling Don t ignore this step your backups are at stake During the wizard, or after the fact, set up operators to receive notifications Consider success AND failure notifications to start, then move to exceptions (errors)
Establishing a Reporting Operator Set up operator Reference in job Properties for the job Consider writing bread crumbs to the event log as well Demo Set Up Operator, Reference
Backups Manual Process If you backup the db directly (manually), you ll be shown the options differently Demo Backup Options
Restores The Process Restore the database Restore the logs In order, oldest first You ll not have the data entered since the last backup; whether that s the last transaction log backup or the last database backup
Restores How-To Right-click db, tasks, restore Or Right-click Databases, Restore option Select the db to restore Select the set to use for the restore Consider restoring to a new database rather than the source if you have ANY question Script button Tail-log backups full or bulklogged only Demo Restores
Restore Notes Check the generated SQL if you re having trouble Note that you can change the destination from the original new file location, new db, etc.
Managed Backups SQL Server determines frequency You set up retention and it manages the rest Azure-storage only
The Cloud CAN be very big differences in recoverability Remember the types of objectives (next slide) Some recovery options don t make sense in the cloud (log shipping) Know the system recovery process, e.g. AWS Stop/Start Know how a hybrid (cloud/on-premise) situation impacts your solutions
Backup and Restore Purposes Broad catastrophic Oops corrections Targeted restores Business Intelligence You may want/need a plan for each of these. Demo Cloud Restore Options Differences Example
Disaster Planning and Testing Test your restores on a development instance Learn what happens to your applications after a cold restore Test your media, your backup strategy, your retention time tables
Final Thoughts, Best Practices Document your plan, media passwords, recovery steps (and test them) Don t be the single point of failure just because it s all in your head T-SQL for your systems (script it out) Encryption of backups Key management User accounts, jobs, other system-level items Test your restores, test the process of getting back online Have multiple fall-back positions Like firing a weapon 50-60% of your training is retained under pressure learn it cold, take it slow
Thank you! Questions??????????????? Please be sure to fill out the survey and feel free to ask questions in the Q&A tool.