Backup Strategy for Oracle White Paper: Oracle Database Administration February 01
TABLE OF CONTENTS INTRODUCTION... 3 EXAMPLE 1... 4 EXAMPLE... 6 EXAMPLE 3... 7 SUMMARY... 8 ADDITIONAL INFORMATION... 9 SAP Library... 9 SAP Notes... 9
INTRODUCTION SAP data is stored in a relational database. A data backup consists of database files and SAP files such as programs, log files, and so on, which are stored centrally under /usr/sap/.... You use operating system tools to back up this directory tree, which is part of the hierarchical file system. As this data generally only changes when profile parameters are modified or after an upgrade, you only need to perform a backup in such cases. However, for database objects the situation is completely different, as we describe in this document. Since it is generally very dynamic, SAP data requires a comprehensive security strategy. The following examples illustrate two appropriate and one faulty backup strategy. In the event of an error, the faulty strategy results in the complete loss of all business data. In the examples below the tape administration is controlled by BRBACKUP and BRARCHIVE. Nevertheless, the strategies shown in the examples below are valid for other backup strategies such as BACKINT or RMAN. 3
EXAMPLE 1 The size of the database is less than 100 GB and daily backups are possible. As the SAP System does not have to be available after 18:00, you can perform the backup offline. Alternatively, you can perform the backup at a time when the transaction load is low. A full backup of the data (without log redo information) fits onto two tapes, if DLT techniques are used. Backup Strategy with Daily Complete Backups Number of tapes for database data Tape re-use possible Key: free total: (56+x) tapes locked locked: retention period = 8 1 S M T W T F S S M T W T F S S M T W T F S S M T W T F S S Number of tapes for redo logs 3 Tape re-use possible locked: retention period = 8 total: (5+x) tapes 1 S M T W T F S S M T W T F S S M T W T F S S M T W T F S S To be able to deal with a faulty backup, several generations of backups have to be available. Therefore, for this example, the retention period is set to 8 and consequently 7 backup generations are available in the event of database failure. The tape pool ought to contain several reserve tapes, shown as + x in the above graphic. The additional tapes we recommend approximately 30% of the required number are intended as a reserve in case the amount of data to be backed up greatly increases or an extra unplanned backup becomes necessary. Using a separate tape pool, you also need to back up the redo log information generated during the day, which is temporarily stored on a separate large disk until the tape backup. As this data is necessary to recover a database after restoring a data backup, never set the retention period for the redo log tapes to less than the retention period for the data backup tapes. Particularly in the case of an online backup, it is best to always back up redo logs directly after the data backup. Without redo log information the online backup is worthless. As the redo log information is much more dynamic than the database data, even more reserve tapes are required. We recommend you to back up the redo logs twice for extra security, so that you need x (5 + x) tapes in the redo log tape pool. 4
The number of tapes required depends on the hardware implemented and the tape capacity available, as shown in the table below: Capacity and Performance of Tape devices Type Capacity GB Transfer Rate GB / hour IBM 3590/Magstar 0-40 10-15 DLT 7000 35 70 15 0 DST 310 / 31 50 30-50 5
EXAMPLE The database is too large for a complete daily offline or online backup and has to be available 4 hours a day on 5 working. Therefore, an online backup is chosen and spread over two, part A and part B. It runs during the night, as this is the only time when the transaction load is low. Backup Strategy for a Very Large Database with Partial Backups (A) and (B) Number of tapes for database data 8 4 Tape re-use possible locked: retention period = 10 A B A B A B A + B Key: free locked A B total: (40+x) tapes Number of tapes for redo logs 3 1 So Mo Tu We Th Fr Sa So Mo Tu Tape re-use possible locked: retention period = 10 We total: (19+x) tapes So Mo Tu We Th Fr Sa So Mo Tu We This strategy is generally subject to more errors than the one described above in the first example because the database administrator is responsible for the correct distribution of the data to the partial backups (A) and (B). Furthermore, the risk of losing data is greater because online backups are only consistent in combination with redo information. Here, the number of tapes required for the data backup is 40 + x. For security reasons, an additional full offline backup is performed at the weekend. If this strategy is used with a retention period of 7, only 4 generations of backups will be available. The redo log files are even more important than in the first example, as the online backups are absolutely worthless without them. Here it is essential to back up the redo data twice. 6
EXAMPLE 3 As in the first example, a full backup is performed offline once a day. The retention period is set to 1 day so the two tapes required are overwritten each day. In the event of a disk error, this single backup has to be used. If it cannot be read, the database is destroyed. As the redo information has also not been saved separately, in the case of a disk failure which affects data and redo information, all transactions executed since the last backup will be lost. Faulty Security Strategy Do not follow this example. It is included to illustrate a faulty backup approach. Number of tapes for Key: free locked database Tapes only locked briefly because retention period = 1 day data 4 Danger: possible loss of all data Tapes re-used each day total: tapes Number of tapes for redo logs Sa So Mo Tu We Th Fr Sa So Mo Tu No backup of redo information Danger: possible loss of daily transactions 1 Sa So Mo Tu We Th Fr Sa So Mo Tu 7
SUMMARY The strategy described in the first two examples, or any similar strategy based on the same principles, enables you to recover the database to any point in time (that is, you can eliminate application errors, also called logical errors). Without the redo information, an offline backup only enables the state of the database at the time of the last backup to be recovered. An online backup without redo information is worthless. The different situations described above only represent simplified examples intended to illustrate the problems involved. SAP recommends the following for your backup strategy: A retention period of at least 14, preferably 8 or 30 30 % reserve tapes in the tape pool Backup of the redo log information (that is, the archive log files) directly after each database backup and creation of a second copy of archive log files A minimum of 10 generations of complete database backups We recommend that you verify backups, ideally once a week, and at least once in each tape management cycle. 8
ADDITIONAL INFORMATION SAP Library You can find more information on Oracle database administration and the contents of this document in the SAP Library as follows: All paths refer to SAP NetWeaver 7.3. 1. Call up the SAP Help Portal at help.sap.com/nw73 Application Help SAP Library: English.. Choose SAP NetWeaver Library: Function-Oriented View Database Administration Database Administration for Oracle SAP Database Guide: Oracle. 3. Choose one of the following: Approach to Oracle DBA Database Backup or Restore and Recovery BR*Tools for Oracle DBA BR*Tools in Action Backup and Database Copy with BR*Tools BR*Tools for Oracle DBA BR*Tools in Detail BRBACKUP or BRARCHIVE or BRRESTORE or BRRECOVER SAP Notes You can also find these plus selected extracts from the SAP Library at: www.sdn.sap.com/irj/sdn/ora SAP on Oracle Knowledge Center SAP Documentation in Help Portal You can find SAP Notes at: service.sap.com/notes 9
www.sap.com Copyright 01 SAP AG. All rights reserved No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation. IBM, DB, DB Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10, z/vm, z/os, OS/390, zenterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, purescale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB Connect, RACF, Redbooks, OS/, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the United States and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and other countries. Oracle and Java are registered trademarks of Oracle and its affiliates. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems Inc. HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Apple, App Store, ibooks, ipad, iphone, iphoto, ipod, itunes, Multi-Touch, Objective-C, Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. IOS is a registered trademark of Cisco Systems Inc. RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm, BlackBerry Storm, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered trademarks of Research in Motion Limited. Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are trademarks or registered trademarks of Google Inc. INTERMEC is a registered trademark of Intermec Technologies Corporation. Wi-Fi is a registered trademark of Wi-Fi Alliance. Bluetooth is a registered trademark of Bluetooth SIG Inc. Motorola is a registered trademark of Motorola Trademark Holdings LLC. Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, ianywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, BB 360, and BB 360 Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.