You are on page 1of 11

White Paper: Oracle Database Administration

Backup Strategy for Oracle

February 2008

SAP AG Neurottstrae 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com

SAP Copyrights and Trademarks


Copyright 2008 SAP AG. All rights reserved.

Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, PartnerEdge,

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, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. 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.

ByDesign, SAP Business ByDesign, 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 in several other countries all over the world. 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.

Where to Find this Documentation You can find this documentation at the following address:
http://www.sdn.sap.com/irj/sdn/ora

Typographic Conventions
Type Style Example Text Represents Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation. Example text Emphasized words or phrases in body text, graphic titles, and table titles. Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. Keys on the keyboard, for example, F2 or ENTER.

Icons
Icon Meaning Caution Example Note Recommendation Syntax

EXAMPLE TEXT

Example text

Example text

<Example text>

EXAMPLE TEXT

Backup Strategy for Oracle

Contents
Introduction ....................................................................................................... 5 Example 1 .......................................................................................................... 6 Example 2 .......................................................................................................... 8 Example 3 .......................................................................................................... 9 Summary.......................................................................................................... 10 Additional Information ..................................................................................... 11
SAP Library ...................................................................................................................... 11 SAP Notes ........................................................................................................................ 11

February 2008

Backup Strategy for Oracle

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.

February 2008

Backup Strategy for Oracle

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 locked: retention period = 28 days 2 1 Key: free locked

total: (56+x) tapes

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 days Number of tapes for redo logs Tape re-use possible locked: retention period = 28 days 3 2 1 total: (52+x) tapes

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 days

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 28 days and consequently 27 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 2 x (52 + x) tapes in the redo log tape pool. The number of tapes required depends on the hardware implemented and the tape capacity available, as shown in the table below:

February 2008

Backup Strategy for Oracle

Capacity and Performance of Tape devices Type IBM 3590/Magstar DLT 7000 DST 310 / 312 Capacity (GB) 20 - 40 35 70 50 Transfer Rate (GB / hour) 10 - 15 15 20 30 - 50

February 2008

Backup Strategy for Oracle

Example 2
The database is too large for a complete daily offline or online backup and has to be available 24 hours a day on 5 working days. Therefore, an online backup is chosen and spread over two days, 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)
Key: Number of tapes for database data 8 Tape re-use possible locked: retention period = 10 days A +
4

free

locked

total: (40+x) tapes

B A B A B A B A B

So Number of tapes for redo logs


3 2 1

Mo

Tu

We

Th

Fr

Sa

So

Mo

Tu

We

days

Tape re-use possible locked: retention period = 10 days total: (19+x) tapes

days 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 days, 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.

February 2008

Backup Strategy for Oracle

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.

Do not follow this example. It is included to illustrate a faulty backup approach. Faulty Security Strategy
Number of tapes for database data 4 Key: free locked

Tapes only locked briefly because retention period = 1 day Danger: possible loss of all data Tapes re-used each day total: 2 tapes

Sa Number of tapes for redo logs 2 1

So

Mo

Tu

We

Th

Fr

Sa

So

Mo

Tu

days

No backup of redo information Danger: possible loss of daily transactions

Sa

So

Mo

Tu

We

Th

Fr

Sa

So

Mo

Tu

days

February 2008

Backup Strategy for Oracle

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 days, preferably 28 or 30 days 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

February 2008

10

Backup Strategy for Oracle

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 Release SAP NetWeaver Process Integration 7.1 of the SAP Library. 1. Call up the SAP Help Portal at help.sap.com/nwpi71 KNOWLEDGE CENTER FOR SAP NETWEAVER PROCESS INTEGRATION 7.1 SAP NetWeaver Process Integration Library English. 2. Choose Administrators Guide Technical Operations for SAP NetWeaver Administration of Databases Database Administration for Oracle. 3. Choose one of the following: o SAP Database Guide: Oracle Choose one of the following: o 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

CCMS: Oracle

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

SAP Notes
You can find SAP Notes at: service.sap.com/notes

February 2008

11

You might also like