16
Split Mirror Disk Backup for Oracle White Paper: Oracle Database Administration February 2012

Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle White Paper: Oracle Database Administration February 2012

Page 2: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

2

TABLE OF CONTENTS

INTRODUCTION ................................................................................................................. 3

ARCHITECTURE ................................................................................................................ 4

SCENARIOS ....................................................................................................................... 5

BACKUP PROCESS ........................................................................................................... 6

SPLIT MIRROR OFFLINE DISK BACKUP ......................................................................... 7 Split Command Scenario .............................................................................................................. 7 SPLITINT Scenario ........................................................................................................................ 7

SPLIT MIRROR ONLINE DISK BACKUP ........................................................................... 8 Split Command Scenario .............................................................................................................. 8 SPLITINT Scenario ........................................................................................................................ 8

SOFTWARE CONFIGURATION ......................................................................................... 9

PROFILE PARAMETERS AND COMMAND OPTIONS FOR INIT<DBSID>.SAP ........... 11

HIGH AVAILABILITY ........................................................................................................ 12

SPECIAL FEATURES ....................................................................................................... 13 Implementing the SAP System on the Backup Server ............................................................. 13 Implementing BRARCHIVE to Backup Redo Log Files ............................................................ 13 Scheduling Backup Sessions from CCMS ................................................................................ 13 Scripts and Programs for the split_cmd Parameter ................................................................. 13

ADDITIONAL INFORMATION .......................................................................................... 15 SAP Library ................................................................................................................................. 15 SAP Service Marketplace ........................................................................................................... 15 SAP Notes ................................................................................................................................... 15

Page 3: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

3

INTRODUCTION

If you want to perform an offline backup for large systems, but your Oracle data and SAP System always need to be online, you can back up files using a split mirror disk backup. The SAP backup tool BRBACKUP supports this configuration. BRBACKUP also supports online backups using this configuration.

Instead of backing up the production database on the production server, BRBACKUP is started in this configuration on a backup server, to back up the database files of the split mirror disks. Therefore, the backup load is moved from the production server to the backup machine and so does not affect the performance of the SAP System during the backup. BRBACKUP can be used to control the splitting and later synchronization of the disks.

In addition, BRBACKUP also communicates with the production database to obtain information about the database structure and store the results of the backup. This allows the Computing Center Management System (CCMS) to monitor the backups in the SAP production system.

The actual splitting and later synchronization of the disks is executed by a script or program supplied not by SAP, but by the manufacturer of the operating system, disk, or backup software. The BACKINT interface can also be used in this configuration, as the split mirror disk configuration is transparent to BACKINT.

If you want to perform an offline backup, the database must be stopped for a short period – usually only a few minutes – while the system splits the disks.

This paper provides an overview of split mirror disk backup for Oracle. For more information on split mirror solutions, see the following on SAP Service Marketplace:

service.sap.com/split-mirror

Page 4: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

4

ARCHITECTURE

Backup

database

host

BRBACKUP

Automatic

tape

changer

Production

database

host

SAP System

SQL* Net

Storage System

Page 5: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

5

SCENARIOS

There are two basic scenarios:

Split command

This uses split_cmd and resync_cmd to split and resynchronize the mirror disks. BRBACKUP controls

the splitting and later synchronization of the disks.

SPLITINT

This uses the SPLITINT interface program with split_options and split_resync to split and

resynchronize the mirror disks. BRBACKUP calls SPLITINT to actually split and resynchronize the disks. SPLITINT executes the split and resync requests from BRBACKUP using the appropriate disk subsystem calls.

Database handling with the SPLITINT scenario is considerably faster than with the split command scenario. This is the recommended approach.

For each scenario, there is an online and an offline variant.

Page 6: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

6

BACKUP PROCESS

The following graphic shows how split mirror backup works:

B

Backup

database

host

BRBACKUP

4

Resynchronization

Automatic

tape

changer

..

Remount

5

A’ B’A

..

Production

database

host

Database

File system

SAP shadow process

31

Mirroring2

B

File system

Split Mirror Online Backup Split Mirror Offline Backup

1 Tablespaces set to status BACKUP Production database shut down

2 Mirror disks (A' and B' in the graphic) split and connected to backup server using:

Split command scenario: split_cmd

SPLITINT scenario: SPLITINT program

3 Tablespaces reset to normal status Production database restarted

4 Mirror disks backed up on backup host

5 Optional: Primary and mirror disks resynchronized using:

Split command scenario: resync_cmd

SPLITINT scenario: SPLITINT program

Page 7: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

7

SPLIT MIRROR OFFLINE DISK BACKUP

In an offline backup, the database is stopped while the mirror disks are split. All of the following steps are automatically executed by BRBACKUP. Therefore, you must already have started BRBACKUP on the backup server.

Split Command Scenario

You start BRBACKUP on the backup host using the following command:

brbackup -t offline_split

BRBACKUP performs the following steps: ...

1. Shuts down the database on the productive host, in order to guarantee the consistency of the database for an offline backup.

2. Splits the mirror disks using split_cmd.

3. Restarts the database on the production host, so that it is again available for the SAP System.

4. Backs up the mirror disks on the backup host.

5. If you have set resync_cmd, synchronizes the mirror disks with the originals.

The resynchronization process does not normally use the CPU on the production server.

For more information, see the detailed plan below.

SPLITINT Scenario

You start BRBACKUP on the backup host using the following command:

brbackup -t offline_mirror

BRBACKUP and SPLITINT then perform the following steps: ...

1. BRBACKUP calls SPLITINT without stopping the database.

2. SPLITINT prepares the split. When complete, SPLITINT sends a message to BRBACKUP.

3. When BRBACKUP receives the message, it stops the database.

4. SPLITINT executes the split. When complete, SPLITINT sends a message to BRBACKUP.

5. When BRBACKUP receives the message, it restarts the database.

6. SPLITINT completes the split and sends a success message before returning control to BRBACKUP.

7. BRBACKUP starts the actual backup (for example, with BACKINT).

Resynchronization (the next step) occurs after the actual backup (for example, with BACKINT)

has finished. It is optional and only needs to be executed if the setting in init<DBSID>.sap is

split_resync = yes.

8. SPLITINT performs the resynchronization and sends a success message before returning control to BRBACKUP.

9. BRBACKUP cleans up and terminates.

For more information, see the documentation BC-BRI SPLITINT Interface for Oracle Databases, which you can find here:

www.sdn.sap.com/irj/sdn/ora SAP on Oracle Knowledge Center Key Topics Backup and Recovery

Page 8: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

8

SPLIT MIRROR ONLINE DISK BACKUP

During an online backup the system is always available. The tablespaces to be backed up are only

temporarily set to status BACKUP while the disks are split, thus considerably reducing the amount of redo

information. During a normal online backup, the tablespaces have this status during the entire backup.

Split Command Scenario

You start BRBACKUP on the backup host using the following command:

brbackup -t online_split

BRBACKUP then performs the following steps: ...

1. Sets the tablespaces to be backed up to backup status using:

ALTER TABLESPACE <tablespace name> BEGIN BACKUP;

ALTER DATABASE BEGIN BACKUP;

2. Splits the mirror disks using split_cmd.

3. Resets the tablespaces to the normal status using:

ALTER TABLESPACE <tablespace name> END BACKUP;

4. Backs up the mirror disks on the backup host:

ALTER DATABASE END BACKUP;.

5. If you have set resync_cmd, synchronizes the mirror disks with the originals.

SPLITINT Scenario

You start BRBACKUP on the backup host using the following command :

brbackup -t online_mirror

BRBACKUP and SPLITINT then perform the following steps: ...

1. BRBACKUP calls SPLITINT without setting the tablespaces to backup status.

2. SPLITINT prepares the split. When complete, SPLITINT sends a message to BRBACKUP.

3. When BRBACKUP receives the message, it sets the tablespaces to backup status.

4. SPLITINT executes the split. When complete, SPLITINT sends a message to BRBACKUP.

5. When BRBACKUP receives the message, it takes the tablespaces out of backup status.

6. SPLITINT completes the split and sends a success message before returning control to BRBACKUP.

7. BRBACKUP starts the actual backup (for example, with BACKINT).

Resynchronization (the next step) occurs after the actual backup (for example, with BACKINT)

has finished. It is optional and only needs to be executed if the setting in init<DBSID>.sap is

split_resync = yes.

8. SPLITINT performs the resynchronization and sends a success message before returning control to BRBACKUP.

9. BRBACKUP cleans up and terminates.

For more information, see the documentation BC-BRI SPLITINT Interface for Oracle Databases, which you can find here:

www.sdn.sap.com/irj/sdn/ora SAP on Oracle Knowledge Center Key Topics Backup and Recovery

Page 9: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

9

SOFTWARE CONFIGURATION

At least the client software and SQLPLUS components of the Oracle database software must be installed on

the backup server.

The Oracle home directory structure must correspond to the SAP standard installation required by BRBACKUP.

Default Directories

UNIX Windows

$ORACLE_HOME/dbs %ORACLE_HOME%\DATABASE

$ORACLE_HOME/bin %ORACLE_HOME%\BIN

$SAPDATA_HOME/sapbackup %SAPBACKUP%

$SAPDATA_HOME/saparch %SAPARCH%

$SAPDATA_HOME/sapreorg %SAPREORG%

$SAPDATA_HOME/sapcheck %SAPCHECK%

$SAPDATA_HOME/saptrace %SAPTRACE%

The SAPBACKUP directory can be mounted or connected to the backup server and the production server for

BRBACKUP to be able to access the control files on the backup server created by the SQL command alter

database backup controlfile to <filename> on the production server. If this is not the case

BRBACKUP tries to access the control file remotely, using rcp /scp/ftp.

The Oracle and BRBACKUP profiles should be available in $ORACLE_HOME/dbs or

%ORACLE_HOME%\DATABASE.

The backup_type parameter in the profile init<DBSID>.sap must be set to

offline_split|online_split|offline_mirror|online_mirror.

To establish the connection between the backup server and the production server, you must define the

profile parameter primary_db for the SQLNET connection). Before you do this, you must perform the

following steps (required for offline backups and for Oracle RAC):

Create an Oracle password file:

orapwd file=<ORACLE_HOME>/dbs/orapw<DBSID>

password=<internal password> entries=10

You must specify the parameter remote_login_passwordfile = exclusive in all

init<DBSID>.ora profiles.

The user system must have the authorization SYSOPER in the production database. Start SQLPLUS,

connect as sysdba, and execute the following Oracle command:

SQL> grant sysoper to system;

You might need to change the password for user system:

SQL> alter user system identified by <password>;

The directory /usr/sap/<SID>/SYS/exe/run or \\<Hostname>\sapmnt\<SID>\SYS \exe\run

must be accessible from the backup server and should contain at least the programs BRBACKUP, BRCONNECT and BRTOOLS (and optionally BRARCHIVE, BRRECOVER, and BRRESTORE).

Page 10: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

10

The paths of all database files accessed by the production database and backup database should be identical.

Strictly speaking, this restriction no longer applies. It is possible to mount the database files on

the backup host in a different SAPDATA_HOME directory by using the init<DBSID>.sap

parameter orig_db_home. By using this parameter you can even mount the split-off files on the

same host.

Install the external backup tool and configure the BACKINT interface on the backup server if you intend to use it.

Page 11: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

11

PROFILE PARAMETERS AND COMMAND OPTIONS FOR INIT<DBSID>.SAP

backup_type =

offline_split|online_split|offline_mirror|online_mirror|offstby_split|offstby

_mirror

The options offstby_split and offstby_mirror enable split mirror disk backup for

Oracle standby databases.

split_cmd = "<split_cmd> [$]"

<split_cmd> is a program or shell script called by BRBACKUP to split the mirror disks.

resync_cmd = "<resync_cmd> $ "

<resync.cmd> is a program or shell script called by BRBACKUP to resynchronize the mirror disks.

If this parameter is not set, BRBACKUP does not perform the resynchronization. At run-time, BRBACKUP replaces the optional character $ with the name of the text file that contains the names of all files to be backed up.

If split_cmd/resync_cmd is completed successfully, an exit code of 0 is returned. Only

messages beginning with #INFO are accepted, that is, these are the only messages not

interpreted as error messages. If the command is not successful, a return code of >0 is returned as well as messages describing the cause of the error.

primary_db = <conn_name>

<conn_name> is a connection name (alias) in TSNAMES.ORA to the production database that allows

BRBACKUP to connect from the backup server to the production database.

standby_db = <conn_name>

<conn_name> is a connection name (alias) in TSNAMES.ORA to the standby database that allows

BRBACKUP to connect from the backup server to the standby database.

The BRBACKUP call is as follows:

Split command scenario:

o brbackup -t|-type online_split – online backup of mirror disks

o brbackup -t|-type offline_split – offline backup of mirror disks

SPLITINT scenario:

o brbackup -t|-type online_mirror – online backup of mirror disks

o brbackup -t|-type offline_mirror – offline backup of mirror disks

This command line option overrides the backup type set in the backup_type parameter in the

init<DBSID>.sap profile.

Page 12: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

12

HIGH AVAILABILITY

In contrast to a normal offline backup, a configuration using split mirror disks provides users with continuous online operation of the SAP System except for a few minutes required to split the mirror disks. Transactions cannot be performed during this time.

You can also execute an online backup that does not require the system to be offline. The tablespaces to be backed up are only temporarily set to status BACKUP during the time required to split the mirror disks.

Page 13: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

13

SPECIAL FEATURES

Implementing the SAP System on the Backup Server

If the split disks do not have to be resynchronized immediately after the backup, you can use the backup server along with the disks A’ and B’ to operate an independent SAP system on the backup server. For this you must install the entire Oracle server software on the backup server. This independent SAP System contains snapshot data that SAP transactions can use (for example, Data Warehouse).

Implementing BRARCHIVE to Backup Redo Log Files

BRARCHIVE should be running on the production server. If the backup device is connected to the backup

server, you can use the remote device with the pipe option or the BACKINT interface.

For the synchronization of BRBACKUP sessions with BRARCHIVE sessions, note that you can start a BRARCHIVE session immediately after the disks are split and not just at the end of the online BRBACKUP session. At this point, Oracle regards the backup as already finished.

Scheduling Backup Sessions from CCMS

CCMS scheduling in the SAP System on the production server can be used for BRBACKUP as the actions are scheduled for each database server. To achieve this, you have to modify the backup actions parameters in table SDBAC, especially the host name and backup type.

Scripts and Programs for the split_cmd Parameter

Since a flush to clear file buffers must be executed on the operating system or file system before the interface to the storage system can be accessed, most split mirror disk solutions rely on the know-how of the operating system and storage system suppliers. If this fact is disregarded, data inconsistencies can result. Experience has shown that the first step in the splitting of the disks (that is, the assignment of the file names

to physical disk areas – "resolving") can take so long that this action must be run before Begin/End

Backup.

To do this, the BRBACKUP –q (-query) options let you start the split_cmd script and instruct the system

to only complete the first step.

The following diagram illustrates the control of BRBACKUP with the split_cmd parameter:

Page 14: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

14

Control Flow of BRBACKUP and split_cmd

split_cmd2: reads <special file>

and splits disks of relevant files

split_cmd1: resolves names and

stores them in <special file>

brbackup –m all …

-p <special profile> -q

brbackup:

perform actual

backup

brbackup –m all …-p <normal profile>

brbackup:

alter tablespace

begin backup

brbackup:

alter tablespace

end backup

Phase 2Phase 1

This procedure is not necessary if you are using the SPLITINT interface. SPLITINT has full control over when the tablespaces go into BACKUP mode, which lets it postpone this until the end of the first step (“resolving”).

Alternatively you can also use the init<DBSID>.sap parameters pre_split_cmd and

post_split_cmd. To do this, you define a program or script that is called before and after the

disk split. For more information, see the SAP Library [Page 15] documentation or SAP Note 968507.

Page 15: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

Split Mirror Disk Backup for Oracle February 2012

15

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.

2. Choose SAP NetWeaver Library: Function-Oriented View Database Administration Database

Administration for Oracle SAP Database Guide: Oracle Approach to Oracle DBA Database

Backup Advanced Backup and Recovery Split Mirror Backup.

You can also find this 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 Service Marketplace For more information on split mirror solutions, including suppliers, see:

service.sap.com/split-mirror

SAP Notes

You can find SAP Notes at:

service.sap.com/notes

Page 16: Split Mirror Disk Backup for Oracle - Archive · Split Mirror Disk Backup for Oracle February 2012 3 INTRODUCTION If you want to perform an offline backup for large systems, but your

www.sap.com

© Copyright 2012 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, DB2, DB2 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, DB2 Connect, RACF, Redbooks, OS/2, 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 Storm2, 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.