6
Best Practices for SQL Server Backups

Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

Best Practices for SQL Server Backups

Page 2: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

2 | © 2015 Dell, Inc. All rights reserved | Share:

IntroductionThe only reason for performing backups is to ensure that you can restore data. Therefore, organizations need to have a solid disaster recovery (DR) strategy that ensures their backups are available, valid and restorable.

A sound DR strategy will help you to:

• Minimize data loss — How much data you lose in a disaster depends on how current your backup is. For example, if you back up your data nightly and a disaster occurs late the next day, you stand to lose nearly a day’s worth of data. Determining how much data you are willing to lose — your recovery point objective (RPO) — will help you choose an appropriate disaster recovery strategy.

• Minimize downtime — You also need to determine how long you are willing to be down — your recovery time objective (RTO). How much time it will take to recover your data depends in part on the DR strategy you choose.

This document details best practices for developing a good disaster recovery strategy, with specific additional guidelines for Microsoft SQL Server backups. Then it offers specific details for using two Dell backup and recovery solutions, AppAssure and NetVault Backup.

Page 3: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

3 | © 2015 Dell, Inc. All rights reserved | Share:

Best practices for backupsThe following best practices apply to any backup strategy:

Choose an appropriate location for your backups.

Backups should not be stored in the same physical location as the database files. If your physical drive goes bad, you should be able to use the other drive or remote location that stores the backups to perform a restore.

Establish an appropriate backup schedule.

Establish a backup schedule that meets the needs of the application and the business. For example, a business-critical transactional database that is frequently updated may need to be backed up more frequently than a relatively static system that holds less important data, such as an Active Directory server, a domain controller or a web server.

Remember that backups age, so determine appropriate retention settings and archiving criteria so you can ensure that data is retained in compliance with business practices and applicable regulations.

Verify each backup.

Each time a database backup operation completes, it is crucial to verify that the backup can be restored — including both the system databases and all

user databases. This best practice is particularly important for business-critical transactional databases.

Many DBAs verify the backup was successful by actually performing a restore of the backup to a development or test server under the same options and conditions used during a planned or unplanned downtime. Some DBAs also work with their backup administrators to perform rebuilds and restores on a quarterly basis. Backup sizes, speed, times and costs for each database server are documented and reported to management. With these metrics, the organization can identify and evaluate inefficiencies and other problems so they can improve their DR strategy.

Practice restoring from backup.

To minimize the risk of a restore operation failing, be sure to schedule regular testing of your restore procedures. Restore the backups on a test server, being sure to verify that you can restore with all the options you would need during various conditions, including both planned and unplanned downtime.

Choose the right hardware and monitor it for problems.

It is strongly recommended that the storage associated with both your data and your backup repository reside on media with some form of redundancy, such as RAID 5, 6, 10 or 50.

It is also critical to ensure that the hardware running your backups and the drives storing them do not have errors. If your hardware and drives support Self-Monitoring Analysis and Reporting Technology (SMART), be sure to enable it. Also configure email or SNMP alerts so that you are notified when a threshold has been reached.

In addition, be sure to review the Windows systems and hardware event logs, as well as any vendor-specific hardware logs, for errors on a regular basis.

Consider replication and archiving.

Replicating your backups to an offsite location helps ensure they will be available in case of disaster. Archiving is an efficient, cost-effective method for long-term retention of backups, since older backups can reside on less expensive storage in an offsite location.

To minimize the risk of a restore operation failing, be sure to schedule regular testing of your restore procedures.

Page 4: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

4 | © 2015 Dell, Inc. All rights reserved | Share:

Best practices for SQL Server backupsIn addition to the best practices that apply to any disaster recovery strategy, be sure to keep in mind these best practices specific to SQL Server:

Choose an appropriate recovery model.

SQL Server provides three recovery models: simple, full and bulk-logged. The recovery model defines how database backups and restores are performed and how the transactions are logged and maintained, so it is critical to choose the right model for each database. Most environments use either the simple or full model, so we will explore those two options here.

• Simple recovery model — If a database is in simple mode, the logs are automatically truncated and space is reclaimed. Since there are no log backups, changes made since the most recent backup are not protected. Simple mode is best for SQL environments that do not require the ability to restore transactions or to roll forward or cancel non-committed transactions.

Granular backups and restores are supported by some data protection tools using Microsoft Volume Shadow Copy Service (VSS) writers. These tools can take snapshots at a scheduled frequency, providing granular backups that can be mounted to enable point-in-time recoveries. Backup solutions may give you the option to truncate the log files nightly.

• Full recovery model — If a database is set to full recovery mode, the database administrator will need to have procedures in place for manual log truncation. Backup solutions will not truncate the log files in full mode. This model requires transaction logs to ensure that no work is lost due to lost or damaged data files. Full mode is best for

environments that require the ability to restore transactions or to roll forward or cancel non-committed transactions.

Organizations that need to use SQL in full recovery mode can use the native SQL backup utility to back up the database and transaction logs to a location on the protected agent (a directory or another local volume), and then use a data protection solution like Dell AppAssure to snapshot that volume. This gives them the flexibility and fine-grained recovery control of a native SQL backup, along with the deduplication, compression and live recovery abilities of AppAssure.

Keep an eye on your transaction logs.

Every SQL Server database has a transaction log that records all transactions and the database modifications made by each transaction. The transaction log must be truncated on a regular basis to keep it from filling up. However, some factors can delay log truncation, so it is important to monitor log size. Also keep in mind that some operations can be minimally logged to reduce their impact on transaction log size.

The transaction log is a critical component of the database — if there is a system failure, the transaction log might be required to bring your database back to a consistent state. Never delete or move the transaction log unless you fully understand the ramifications.

The recovery model defines how database backups and restores are performed and how the transactions are logged and maintained, so it is critical to choose the right model for each database.

Page 5: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

5 | © 2015 Dell, Inc. All rights reserved | Share:

Best practices for using AppAssure and NetVault BackupWith those best practices in mind, here are key requirements for optimizing your SQL Server backups with AppAssure and NetVault Backup:

AppAssure

Microsoft requires a full licensed copy of SQL Server installed on the AppAssure core server. If you are performing attachability checks with multiple SQL Server versions, install one copy of the latest version.

Having two storage locations on the same physical disk array can degrade performance. To avoid this issue, go to the registry and change the allocation policy from striped to sequential.

AppAssure supports log truncation for simple mode databases.

NetVault Backup

Before installing the NetVault Backup plug-in for SQL Server, ensure that the following software is installed and configured on the machine that is hosting SQL Server:

• NetVault Backup software — At a minimum, the client version of NetVault Backup software must be installed on the machine configured as the SQL Server.

• A supported version of SQL Server — The machine must be running a supported version of SQL Server. For a list of supported versions, refer to the Dell NetVault Backup Plug-in Compatibility Guide.

• SQL Server VSS Writer Services — If you want to implement a VSS backup strategy for SQL Server databases (versions 2005 and later), the SQL Server VSS Writer service must be running. This service is automatically installed with SQL Server 2005 and later; however, it is not set to start automatically. To enable VSS backups, use the Windows Services utility. Dell recommends that you set the startup type for this service to automatic.

Before initiating a backup, you must configure the plug-in’s authentication details, which include authentication mode, user name and password.

ConclusionEvery organization needs a solid disaster recovery plan. By following the best practices in this document, you can help ensure that your backups are available, valid and restorable, as well as minimize data loss and downtime.

Learn more at software.dell.com/solutions/backup-and-recovery

Page 6: Best Practices for SQL Server Backups...Best practices for backups The following best practices apply to any backup strategy: Choose an appropriate location for your backups. Backups

6 | © 2015 Dell, Inc. All rights reserved | Share:

© 2015 Dell, Inc. ALL RIGHTS RESERVED. This document contains proprietary information protected by copyright. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording for any purpose without the written permission of Dell, Inc. (“Dell”).

Dell, Dell Software, the Dell Software logo and products — as identified in this document — are registered trademarks of Dell, Inc. in the U.S.A. and/or other countries. All other trademarks and registered trademarks are property of their respective owners.

The information in this document is provided in connection with Dell products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Dell products. EXCEPT AS SET FORTH IN DELL’S TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR THIS PRODUCT, DELL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR

PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL DELL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Dell makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Dell does not make any commitment to update the information contained in this document.

About Dell Software

Dell Software helps customers unlock greater potential through the power of technology—delivering scalable, affordable and simple-to-use solutions that simplify IT and mitigate risk. The Dell Software portfolio addresses five key areas of customer needs: data center and cloud management, information management, mobile workforce management, security and data protection. This software, when combined with Dell hardware and services, drives unmatched efficiency and productivity to accelerate business results. www.dellsoftware.com.

If you have any questions regarding your potential use of this material, contact:

Dell Software 5 Polaris Way Aliso Viejo, CA 92656 www.dellsoftware.com

Refer to our Web site for regional and international office information.

For More Information

Ebook-SQLBestPractices-US-GM-26395