1 Backup, Restore and Options for SQL Server
2 Housekeeping Please be sure to answer survey (above video window) Ask questions at any time
3 Viewing Tip Enlarge Slides Now You can enlarge the window with the slides just click Enlarge Slides below. Get the slides
4 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
5 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)
6 Using Azure or AWS/Cloud Services? Still need backup. MUST understand differences and approaches Trust, but verify, as with all backups procedures
7 Backup and Restore Purposes Broad catastrophic Oops corrections Targeted restores Business Intelligence You may want/need a plan for each of these.
8 Backup Plan Test Because it s not IF it s WHEN
9 Reliance on Wizards Incomplete strategy Food for Thought Database, Transaction logs, System Databases, no follow-up or testing
10 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.
11 Understanding Backup Models Full Simple Bulk-Logged
12 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
13 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
14 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
15 Setting Recovery Models Database, Properties, Options
16 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!
17 Planning Your System Disk space CPU utilization Split backup plans Database-by-database Filegroups Cloud impacts your backups (more later)
18 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
19 Using the Wizards Wizard benefits Scheduling Other maintenance options (defrag, etc.) Backup vs. Maintenance Plan Wizards Great learning tool SQL Statements Scheduling Error handling
20 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
21 Backup Considerations Keep in mind that verify integrity option = CPU stress Watch the retention values you provide Disk space usage Other storage usage (billable)
22 Notification and Reporting Options Consider ing an operator
23 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
24 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)
25 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
26 Backups Manual Process If you backup the db directly (manually), you ll be shown the options differently Demo Backup Options
27 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
28 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
29 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.
30 Managed Backups SQL Server determines frequency You set up retention and it manages the rest Azure-storage only
31 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
32 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
33 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
34 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
35 Thank you! Questions??????????????? Please be sure to fill out the survey and feel free to ask questions in the Q&A tool.