Transcript
Page 1: Are the Native SQL Server Backup Utilities Holding You Back?

Are the Native SQL Server Backup Utilities Holding You Back?

Jason Hall Manager, Database Systems Consulting

Page 2: Are the Native SQL Server Backup Utilities Holding You Back?

2 Confidential Dell Software

Agenda • Introductions

– Speaker

– Topic

• Native Backup/Restore Limitations and Considerations – Full vs. Diff Backups

– Backup Job Management

– Backup Reporting

– Backup Reliability

– Always On Availability Groups

– Restoring Only What You Need

– Backup Security

• Q&A Taken Throughout via GoToMeeting

Page 3: Are the Native SQL Server Backup Utilities Holding You Back?

3 Confidential Dell Software

Who Are These Guys?

• Jason Hall: Manager, Database Systems Consulting

• David Gugick: Senior Product Manager, Backup and Recovery Solutions

• Started w/ LiteSpeed in 2004

• Helped customers architect backup and recovery solutions

• Frequent speakers at SSUG’s and Conferences

• Always available – @jasonfhall or [email protected]

– @davidgugick or [email protected]

Page 4: Are the Native SQL Server Backup Utilities Holding You Back?

4 Confidential Dell Software

What Are We Going to Talk About?

• Microsoft has always provided a very capable B&R solution

• Comes with limitations

• Several facts that must be considered when implementing

• Explore what those limitations and considerations are while offering suggestions on how to work around

• Lots of demo’s!!!

Page 5: Are the Native SQL Server Backup Utilities Holding You Back?

5 Confidential Dell Software

Native Backup Limitations

Page 6: Are the Native SQL Server Backup Utilities Holding You Back?

6 Confidential Dell Software

Full vs. Differential Backups

Page 7: Are the Native SQL Server Backup Utilities Holding You Back?

7 Confidential Dell Software

Full vs. Differential Backups

• Deduplication?

• Seems like a no brainer right?

• Differential backup challenges – Reliance on full backup

– Effectiveness is dependent on amount of data change

– Backup retention gets much more complex

Page 8: Are the Native SQL Server Backup Utilities Holding You Back?

8 Confidential Dell Software

Reliance on Full Backup

• A differential backup without its associated full is useless

• Scenarios that can affect the full backup – File is mistakenly deleted

– File is moved to an unknown or inaccessible location

– File moved to tape and shipped offsite

– A new full backup (w/out COPY_ONLY) is taken

– File has become corrupted or unrecoverable

Page 9: Are the Native SQL Server Backup Utilities Holding You Back?

9 Confidential Dell Software

Amount of Data Change

• Differential backups only make sense when a small % of data has changed

• Situations where data can change: – Unusual application activity

– Unscheduled data loads/purges

– Database Maintenance (Index Rebuilds)

• Lots of change means large Differential backups – You don’t save time, space, and…

– It can double (or worse) your recovery time

Page 10: Are the Native SQL Server Backup Utilities Holding You Back?

10 Confidential Dell Software

File Retention

• Ensure that you are not deleting Full’s that are required for Diff/Log restores

• Full on Sunday, Diff’s Mon – Sat, Don’t delete older than 3 days

• If 2nd Full Backup fails, make sure previous full is not deleted. – F

– D

– D

– D

– F (failed) – D

– D (still good, just points back to first full)

Page 11: Are the Native SQL Server Backup Utilities Holding You Back?

11 Confidential Dell Software

Tips & Tricks

• If you are going to incorporate Differential backups…

• For out of cycle Full backups, use COPY_ONLY – Or ensure that new full is a part of retention policy

– BACKUP DATABASE AdventureWorks TO DISK=…. WITH COPY_ONLY

• Perform data loads/purges before scheduled Full – Or perform out of cycle full after complete

• For large index maintenance operations, perform before scheduled Full – Or perform out of cycle full after complete

• If verifying or testing restores, test going back to full

• Make sure retention policies are set to not delete full backups until new successful full

Page 12: Are the Native SQL Server Backup Utilities Holding You Back?

12 Confidential Dell Software

Backup Job Management

Page 13: Are the Native SQL Server Backup Utilities Holding You Back?

13 Confidential Dell Software

Backup Job Management

• Many ways to run scheduled database backups – SQL Server Agent Jobs

– SQL Server Maintenance Plans

– Custom Scripted TSQL Jobs

– Windows Scheduled Tasks – Typically only used for SQL Express

– Centralized 3rd Party Scheduler

– Enterprise Backup System – IBM Tivoli TSM

– Symantec NetBackup

– Dell NetVault Backup

Page 14: Are the Native SQL Server Backup Utilities Holding You Back?

14 Confidential Dell Software

SQL Server Agent Jobs

• Need to be managed on a per server basis – Can be very challenging in large environments

• SQL Server Maintenance Plans cannot be easily transferred between servers – SSIS Packages w/ hard coded connection strings

– Manually create them on each server

• TSQL Scripts can provide portability – Might need to run differently per version of SQL Server

– Need a solution to copy/deploy

– May be complex depending on amount of custom logic required

Page 15: Are the Native SQL Server Backup Utilities Holding You Back?

15 Confidential Dell Software

Example Script DECLARE db_cursor CURSOR FOR SELECT name FROM master.dbo.sysdatabases WHERE name NOT IN ('master','model','msdb','tempdb') -- exclude these databases OPEN db_cursor FETCH NEXT FROM db_cursor INTO @name WHILE @@FETCH_STATUS = 0 BEGIN SET @fileName = @path + @name + '_' + @fileDate + '.BAK' SET @backupstr = 'BACKUP DATABASE ' + @name + ' TO DISK = ' + char(39) + @fileName + char(39) EXECUTE (@backupstr) FETCH NEXT FROM db_cursor INTO @name END CLOSE db_cursor DEALLOCATE db_cursor

Page 16: Are the Native SQL Server Backup Utilities Holding You Back?

16 Confidential Dell Software

Ways to Deploy

• SSMS has Group Execute – Add the script as a job to one SQL Server

– Export Job as a TSQL Script

– Group Execute against all, or a sub group of servers

Page 17: Are the Native SQL Server Backup Utilities Holding You Back?

17 Confidential Global Marketing

Demo

Page 18: Are the Native SQL Server Backup Utilities Holding You Back?

18 Confidential Dell Software

Backup Job Management Considerations

• Different backup directories for different servers

• Spreading or staggering backup schedules

• Notification

• Different database types

Page 19: Are the Native SQL Server Backup Utilities Holding You Back?

19 Confidential Dell Software

Backup Reporting

Page 20: Are the Native SQL Server Backup Utilities Holding You Back?

20 Confidential Dell Software

Backup Reporting

• SQL Server stores backup statistics in a set of local MSDB tables.

• SSMS has a very inflexible report available – Easier and more powerful to query yourself

• Backup failures are logged locally to: – SQL Agent Job Step Logs

– SQL Server Error Logs

– Windows Event Logs

Page 21: Are the Native SQL Server Backup Utilities Holding You Back?

21 Confidential Dell Software

Backup Reporting Challenges

• Backup statistics are only stored locally on the instance being backed up

• If you have 100 servers and you want to report on all of your backups, have to run 100 reports

• SSMS Group Execute can help here

• Or you can build a reporting architecture to aggregate this data

Page 22: Are the Native SQL Server Backup Utilities Holding You Back?

22 Confidential Dell Software

Example Backup Report Query

• Query msdb.dbo.backup… tables adding filtering and sorting

Page 23: Are the Native SQL Server Backup Utilities Holding You Back?

23 Confidential Dell Software

Demo

Page 24: Are the Native SQL Server Backup Utilities Holding You Back?

24 Confidential Dell Software

Backup Reliability

Page 25: Are the Native SQL Server Backup Utilities Holding You Back?

25 Confidential Dell Software

Backup Reliability

• Native SQL Server backups and restores can be very “fragile”

• Any IO related issue whether network or local will cause a failure – Only choices are:

– Do we take a backup that conflicts w/ production workload?

– Or, do we go the day without a backup and keep our fingers crossed?

Page 26: Are the Native SQL Server Backup Utilities Holding You Back?

26 Confidential Dell Software

Backup Reliability Tips

• When backing up over the network: – Make sure the network is reliable

– Stagger backups that share the same network to avoid saturation

– Look into possibly routing backups over a dedicated network infrastructure

• If you cannot backup over the network: – Make sure you have plenty of local disk allocated

– Backup to a disk other than where your data/log files are

– Copy the backup across the network – Consider using a more robust option than COPY

– ROBOCOPY

– Provides fault tolerance and multi threading

Page 27: Are the Native SQL Server Backup Utilities Holding You Back?

27 Confidential Dell Software

AlwaysOn Availability Groups

Page 28: Are the Native SQL Server Backup Utilities Holding You Back?

28 Confidential Dell Software

AlwaysOn Availability Groups

• Against Secondary Replica’s – Only Full (COPY_ONLY) and Log backups are supported

– No differential backups or standard full’s are allowed.

• Backup preference should be set to enforce policy or avoid license violation

• Backup preference can be enforced through a MP – Not through BACKUP DATABASE

– Not through Backup Wizard

• Check sys.fn_hadr_backup_is_preferred_replica

Page 29: Are the Native SQL Server Backup Utilities Holding You Back?

29 Confidential Dell Software

Demo

Page 30: Are the Native SQL Server Backup Utilities Holding You Back?

30 Confidential Dell Software

Restoring Only What You Need

Page 31: Are the Native SQL Server Backup Utilities Holding You Back?

31 Confidential Dell Software

All Or Nothing Restore

• Restore types mirror backup types – Full

– Diff (Full + Diff)

– Log (Full + Log(s))

– Filegroup (Full + Log)

• What if you only need a subset of data (i.e. Table, Stored Proc, Record, etc...)?

Page 32: Are the Native SQL Server Backup Utilities Holding You Back?

32 Confidential Dell Software

Recovery Tips

• Restore to separate server and grab what you need – Requires time and space

• Proactive Solutions – AlwaysOn?

– No

– Log Shipping Load Delay

– Database Snapshots

Page 33: Are the Native SQL Server Backup Utilities Holding You Back?

33 Confidential Dell Software

Demo

Page 34: Are the Native SQL Server Backup Utilities Holding You Back?

34 Confidential Dell Software

Backup Security

Page 35: Are the Native SQL Server Backup Utilities Holding You Back?

35 Confidential Dell Software

Backup Security

• Native SQL Server backups are created in plaintext

• Can be read by any hexeditor (even notepad)

• Used to be able to password protect backups (no longer available in 2012)

• Compression can make it harder to read, but still possible

• TDE Encrypts whole database (including backup) – Has many implications

• Consider if and how backup data should be secured/encrypted

Page 36: Are the Native SQL Server Backup Utilities Holding You Back?

36 Confidential Dell Software

Demo

Page 37: Are the Native SQL Server Backup Utilities Holding You Back?

37 Confidential Dell Software

How Can Third Party Solutions Help

• Backup Templates and Enterprise Reporting

• Object Level Recovery

• Up to AES 256 Encryption

Page 38: Are the Native SQL Server Backup Utilities Holding You Back?

38 Confidential Dell Software

Summary

• Hopefully we’ve given a lot of food for thought!!

• How can we (Dell Software) help? – NetVault LiteSpeed for SQL Server

– http://www.quest.com/webcast/litespeed-for-sql-server-demonstration819145.aspx

Page 39: Are the Native SQL Server Backup Utilities Holding You Back?

39 Confidential Dell Software

Q&A

Thank You!!!


Recommended