Oracle Database Administration
Oracle Database Administration
February 2012
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
TABLE OF CONTENTS
2
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
3
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
INTRODUCTION TO BR*TOOLS
The database server plays an important role in the server technology of SAP Business Solutions. In
response to customers requesting support for administrative tasks, SAP has included several database
administration tools in the standard SAP System package.
These tools can be used, for example, for backup and recovery. For a long time, only basic backup programs
(for example dd, cpio, tar) were available for open operating systems like UNIX. These are not suitable for
backing up a relational database because they do not:
Deal with special problems that might occur during database backup
Provide tape management
Therefore, SAP offers its own backup programs. These tools enable you to easily and completely back up
the SAP system, so that your system runs smoothly. There is also a BACKINT interface that integrates the
most common client/server backup programs.
SAP provides the following BR*Tools for Oracle database administration:
BRBACKUP, BRARCHIVE, BRRESTORE, and BRRECOVER
Database backup, restore and recovery
BRCONNECT
BRSPACE (database statistics, database check, cleanup logs and traces)
Database administration (for example, database startup or shutdown, tablespace extension, space
management, reorganization. You can access the entire functionality of BR*Tools using a graphical user
interface (BRGUI) or a character interface (BRTOOLS).
For more information, see “References” [page 37].
The following platforms are supported:
HP-UX, AIX, Solaris, Windows, Linux
1
MKS and MKS Toolkit are trademarks of Mortice Kern Systems Inc.
4
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
External backup programs accessed using the BACKINT interface program – see figure “Backup of the
Oracle Database Using an External Backup Tool” [page 8]
Oracle Recovery Manager (RMAN)
Oracle Backup (Native) Using cpio or dd
Oracle Database
Control files Data files Online redo Offline redo
log files log files
BRRECOVER
BRBACKUP BRARCHIVE
BRRESTORE
Backup Backup
Media Media
BRBACKUP and BRARCHIVE log all actions in the file system and database tables, and also save backup
logs and profiles to backup media.
BRBACKUP and BRARCHIVE enable comprehensive volume management. To use the functions provided,
you must initialize the volumes with BRBACKUP or BRARCHIVE to ensure that they include an SAP-specific
label. You cannot overwrite volumes that have not been released for use if the label specifies that they are
still locked.
You can determine the names and number of volumes required for BRBACKUP or BRARCHIVE in advance
using the query mode, without starting a backup. The programs let you verify completed backups in detail.
You can use BRRESTORE and BRRECOVER to restore and recover an Oracle database that was backed
up using BRBACKUP and BRARCHIVE.
BRBACKUP
BRBACKUP enables an online or offline backup of the control file, of data files in some or all tablespaces
and, if necessary, of the online redo log files. See figure “Oracle Backup (Native) Using cpio or dd” [page 5].
BRBACKUP also saves the profiles and logs relevant to the backup. In addition to the actual backup,
BRBACKUP also:
Automatically changes the state of the database (opened or closed), depending on the type of backup
(online or offline)
5
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
BRARCHIVE
BRARCHIVE lets you back up the offline redo log files. These are the online redo log files saved to the
archiving directory by Oracle. See figure ““Oracle Backup (Native) Using cpio or dd” [page 5]. BRARCHIVE
also saves all logs and profiles relevant to the backup. It supports tapes and disks as storage media.
We recommend backing up offline redo log files because:
In the event of failure, a consistent database status can only be recovered if all the relevant redo log files
are available.
The database system of a productive SAP System has to run in ARCHIVELOG mode (to prevent
overwriting online redo log files not yet saved). To protect the archive directory against overflowing, it
must be emptied regularly.
An online backup of data files is of no use if the related redo log files are missing. Therefore, it is
necessary to back up the offline redo log files generated during the online backup immediately after
running BRBACKUP.
For security reasons, BRARCHIVE in native mode (with cpio or dd) offers duplicate archiving of offline redo
log files – redundant serial or parallel archiving is possible. Serial duplication is also available for BACKINT.
Using the logs, BRARCHIVE can ensure that redo log files are not deleted before they have been backed up
and that these files are saved either once or twice.
BRARCHIVE lets you continuously back up offline redo log files. This means that the backup directory,
where Oracle stores the offline redo log files, can be kept clear by continuously backing up and then deleting
current redo log files.
BRRESTORE
BRRESTORE lets you restore files of the following type:
Database data files, control files, and online redo log files saved using BRBACKUP
Offline redo log files backed up using BRARCHIVE
Non-database files saved used BRBACKUP
Profiles and logs (normally only necessary in the event of a disaster)
6
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
You can specify files, tablespaces, complete backups, log sequence numbers of redo log files, or the position
of a file on tape. BRRESTORE automatically determines the corresponding backup tape and the position of
the files on the tape. BRRESTORE checks whether the required free disk space is available to allow the files
to be restored and then restores the directory and link structure automatically. Directory $SAPDATA_HOME
and mount points sapdata<n> must exist.
BRRECOVER
BRRECOVER offers menu options for restore or recovery specially designed to reflect user needs.
BRRECOVER can:
Recover the database to the current state after media error in several files, for example, due to a disk
failure
Restore the entire database for a point–in–time recovery or reset the database to a previous state
BRRECOVER evaluates the backup logs to decide whether the specified recovery can be performed using
the selected backups. For example, for a point-in-time recovery, BRRECOVER determines whether any
actions that would prevent the recovery have taken place between the time of the backup and the selected
recovery end time. If BRRECOVER cannot perform a recovery, it rejects the selected backup or the specified
recovery procedure. Data can only be recovered automatically using BRRECOVER if BRBACKUP and
BRARCHIVE (in native mode or with the BACKINT interface) were used for the backup. In this respect, the
SAP tools BRBACKUP, BRARCHIVE, BRRESTORE, and BRRECOVER function as an integrated solution:
Integrated Solution for Backup, Restore, and Recovery
Oracle Database
Online redo Offline redo
Control files Data files
log files log files
Restore and
Recovery
BRRECOVER
Control files
Data files
Online redo log files
Offline redo log files
Backup Media
7
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Oracle database
External backup /
restore program External BACKUP server
Media
BR*Tools are responsible for all database-related tasks. For backup and restore, they send requests to the
BACKINT interface. BRRECOVER can request restore of profile and log files in the event of disaster
recovery.
BACKINT is generally implemented and sold by the vendor of the external Media Management Software
(MMS). SAP is responsible for defining BACKINT and guarantees the functionality of BR*Tools.
We recommend using BACKINT to implement a company-wide, uniform backup strategy. A major advantage
is that it allows easy database administration using BR*Tools, particularly for database recovery.
8
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
An overview of all backups performed using BRBACKUP or BRARCHIVE – see figure “Backup Overview
in DBA Cockpit” [Page 9] below.
All details – see figure “Backup Details in DBA Cockpit” [page 10] below, including the action runtimes
and the amount of data processed
Backup Overview in DBA Cockpit
9
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
10
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Interface Functions
The BACKINT interface supports the following functions (see figure “Backup of the Oracle Database Using
an External Backup Tool” [page 8] above):
Backup
Restore
Inquire
In all cases, the mandatory user ID (UID) option is used as an identifier for the SAP database. After a
function has been executed, the interface program always returns an integer return code indicating whether
the call was successful.
The user ID plays a significant role during a database copy. In this case BRRESTORE can request a restore
of a backup with a given user ID on another server.
Backup Function
This defines a backup request including all files specified in a list. If the backup request cannot be processed
completely, the interface program informs the user which files have been backed up successfully (partial
backup). MMS determines the sequence in which the files are saved. On return, MMS generates a backup
ID (BID) for each saved file, clearly identifying the backup. A backup file is uniquely identified by:
User ID
Backup ID
File name
Restore Function
This is used to pass a restore request to MMS, consisting of a user ID (UID), backup ID (BID), a list of files to
be restored, and a list of directories where files should be created. The last parameter is optional. If it is not
set, the file is restored to its original location. If the backup ID is not set, the last backup of the related file is
used. The return information indicates which files were restored successfully and which backup IDs were
used.
Inquire Function
This provides information about the backups managed by the Media Management Software (MMS). This
function is called using the UID, BID, and the file name (the last two parameters are optional). If both optional
parameters are specified, the system checks whether this file was saved with a specific BID. If the BID is not
set, a list of available backup IDs (BIDs) is provided, including the specified file. If a file name is not specified,
a list of files belonging to a specific BID is generated. If neither of the two parameters is set, a list of available
backups with BIDs is generated. In general, the BID does not always identify a backup run, although this is
normally true. It can also identify the backup of a single file or a group of files.
The BACKINT interface does not distinguish between Oracle single instance and Real
Application Cluster (RAC) installations. Based on this distinction, BR*Tools alone executes the
required database handling.
11
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
BR*Tools sets the environment dynamically (using putenv), and BACKINT, as the child process, inherits
these variables (using getenv) and can use them to control further processing.
For example, we recommend that you do not change the order of the offline redo log files (BI_BACKUP =
ARCHIVE) during the backup. The best practice is to back up the offline redo log files in the order specified in
the input file (see option –i). This lets BRARCHIVE empty the archive directory as quickly as possible.
Basic Parameters
Option Parameter Description Default
-u <user_id> <user_id> (UID) None
Backup tool user, normally database instance name
(ORACLE_SID)
-f <function> <function>: backup|restore|inquire backup
Type of operation – see figure “Backup of the Oracle
Database Using an External Backup Tool” [page 8] above
-t <type> <type>: file|file_online file
Backup type: backup of individual files, directories,
character special devices
12
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
On some platforms Oracle files do not start on raw partitions from byte 0, but rather with a
certain offset (for example, 4 KB for AIX).
This offset, used for control data of the logical volume manager, must be taken into account
when backing up files from raw partitions. The offset must be skipped or added to the file size
set in the input file. In addition, while restoring database files to raw partitions, the control
information at the beginning of the partition must not be overwritten – it must be skipped.
When directories are saved, only objects at the root of the directory are saved, not the contents of the
subdirectories. If the directory object is a subdirectory, only the definition is saved, not the contents of the
subdirectory. BRBACKUP expands the directory structure itself if necessary. An error should be reported if
such a directory backup is not supported by the Media Management Software (MMS).
BACKINT has to check if the name stands for a file, directory or raw partition. Since profiles and logs remain
in a file system and are backed up, the list of objects can be mixed.
Parameter <type> = file_online
The backup type file_online allows BRBACKUP to switch the tablespace into BEGIN / END BACKUP
mode only when backup of the related files actually occurs.
Backup type file_online uses the following files:
Note the location of the .switch.* files defined in the column headings of the above table.
Communications are described by specifying the tasks for BACKINT and BRBACKUP.
BACKINT creates a switch-list file whenever it wants to back up a file (#BACKUP) or whenever it wants to
indicate that a backup is finished (#END):
#BEGIN | #END <file1>
[#BEGIN | #END <file2>]
13
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
...
...
BACKINT must not send multiple #BEGIN / #END messages to BRBACKUP (actually, to
BRCONNECT) for the same file. If you need to restart a file backup during a backup session,
you must do this within a single #BEGIN – #END interval.
You can put multiple lines into a single switch-list file, mixing #BEGIN and #END lines. Therefore,
it is a good idea to put as many files into a single switch-list file as possible. Normally, it is best
to put the first files of all parallel BACKINT backup processes in the first switch-list file. During
the backup, when BACKINT is about to back up the next file, put both files, the previous one and
the next one, into the switch-list file:
#END <previous_file>
#BEGIN <next_file>
This lets BRBACKUP (actually, BRCONNECT) minimize the number of tablespace BEGIN/END
BACKUP switches.
After the switch-list file has been created and closed, BACKINT creates the empty switch-semaphore file and
waits – the wake-up period is determined by BACKINT, approximately 1 to 4 seconds – until this file has
been deleted by BRBACKUP (actually, BRCONNECT).
It can take several minutes to put a tablespace into the backup state. Therefore, BACKINT
should wait at least 20 minutes before reporting timeout and aborting processing.
After the switch-semaphore file has been deleted, BACKINT opens and reads the switch-log file. The
operation is successful and BACKINT continues processing if it finds a single line in this file that includes:
#SUCCESS
However, the operation has failed and BACKINT terminates with an error if it finds a single line that includes:
#ERROR
All lines except those with the keywords #SUCCESS or #ERROR are copied to the output file (see -o option).
BACKINT deletes the switch-log file after reading it.
Messages written to the output file should be flushed after each line.
BRBACKUP (actually, BRCONNECT) periodically checks if such a switch-semaphore file exists and sets the
wake-up period.
If BRBACKUP (actually, BRCONNECT) detects a switch-semaphore file, it opens and reads the switch-list
file, then issues and logs the appropriate begin/end backup statements in the switch.log file. After
completion, it deletes the switch-semaphore file and the switch-list file. BACKINT is then allowed to proceed.
BRBACKUP (actually, BRCONNECT) decides when to put a tablespace into BEGIN/END BACKUP mode by
using a history of former requests. This is necessary because only BRBACKUP (actually, BRCONNECT)
knows when any of the data files of one specific tablespace are backed up.
During a backup run, only one process can communicate with BRBACKUP (actually,
BRCONNECT) in order to perform the tablespace status switch. If you are using multiple parallel
14
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
processes or sessions to back up the files, you must coordinate this through a master process
(normally the BACKINT process) to avoid unpredictable results.
All handles to the switch files should be released (that is, closed) before giving up the hand-
shake control to BRBACKUP (actually, BRCONNECT). This lets BRBACKUP (actually,
BRCONNECT) delete these files without problems.
Control Parameters
Option Parameter Description Default Type
-p <par_file> <file> none
Parameter file for backup utility containing
parameters that determine the backup
procedure – specific to the backup utility.
The SAP tools specify the location of this
utility parameter file in their own parameter
file (parameter
util_par_file|util_vol_par_file),
but they do not evaluate its contents.
-i <in_file> <file> STDIN See table “Input File
Text file that defines the objects of the Format” [page 15].
function (backup, restore, or inquire). If this
parameter is not set, data is read from the
standard input.
-o <out_file> <file> STDOUT See table “Output
Output file for processing messages and Message Format”
the results of the executed function. If this [page 16].
parameter is not set, the messages are
written to the standard output.
Input File Contents
The contents of the input file <in_file> depend on the backup function:
Input File Format
Function Input Entries
backup Names of files and directories to be <file1>
saved. [<file2>]
<special_file1> <size1>
Character special file [<special_file2> <size2>]
restore Names of files to be restored using BIDs: <backup_id> <file1> [<dest_dir1>]
#NULL: last backup [#NULL <file2> [<dest_dir2>]]
optional: use changed target
directories or raw disks
inquire Names of files and/or BIDs about which #NULL
information is requested. [<backup_id>]
#NULL: no backup ID [#NULL <file1>]
See also table “Correlation of Input and [<backup_id> <file2>]
Output Values for the “Inquire” Function”
15
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
[page 17].
<backup_id> Backup ID assigned by the MMS, passed on as a return value in connection with the backup
function; can only be set in the input file using the restore and inquire functions.
For comments on the size of the raw partition to be backed up, see “Caution” on page 13.
When restoring the raw partition to a different one than the original, the <dest_dir> means
the new raw partition, not the directory containing the special file.
Output File Contents
In addition to the messages with fixed format defined below, the file might contain other messages that are
simply passed on to the user. If the output file is not specified, the output is sent to the standard output
(STDOUT).
The contents of the <out_file> output file depend on the backup function:
Output Message Format
Function Successful Messages Error Messages
backup #SAVED <backup_id> <file> [<backup_vol>] #ERROR <file>
restore #RESTORED <backup_id> <file> #NOTFOUND <file>
#ERROR <file>
inquire #BACKUP <backup_id> #NOTFOUND <file>
#BACKUP <backup_id> <file> #ERROR <file>
See also table “Correlation of Input and Output
Values for the “Inquire” Function” [page 17].
BACKINT should avoid writing any other lines starting with the character “#” to the output file.
This can disturb the work of BRRECOVER tool, which is sensitive to such lines generated by
BRBACKUP and BRARCHIVE. If needed, write such lines only to your own logs.
Variable Definition
All entries have a variable character format as described in the following table:
Type of Entries
Entry Description Type (maximum length)
<file> File, directory char(255)
<special_file> Raw device char(255)
<dest_dir> Directory char(255)
<size> File size in bytes char(16)
<backup_id> Backup ID char(16)
16
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
<backup_id> can be any character string up to a length of 16 not containing any white spaces.
Input/Output File Correlation
The contents of the output file for the inquire function depend greatly on the type of request. We can
distinguish the following cases:
Correlation of Input and Output Values for the “Inquire” Function
Case Input Output
A BID and file name not List of BIDs for UID sorted by creation date (most
specified (#NULL) recent backup first). One list line consists of one BID.
B BID specified, file name not List of BIDs and related files in the specified backup.
specified One list line consists of the specified BID and one file
name.
C BID not specified (#NULL), file List of BIDs related to the specified file, sorted by
name specified creation date (most recent backup first). One list line
consists of one BID and the specified file name.
D BID and file name specified BID and file name, if available, in the specified backup.
One list line consists of one BID and one file name. It
should be only one line in the list.
Examples
Below you can find examples for using BACKINT to back up and restore a SAP/Oracle database instance
identified by SID = C11, assuming a file named dummy contains the file name:
/oracle/C11/sapdata1/user1i_1/user1i.data1
Backup
Call BACKINT as follows for a backup:
OS> backint -u C11 -f backup -t file -p
17
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
18
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Perform the inquire by setting the tag #NULL in front of the file name in dummy (list of all backups in
which this file was saved):
#NULL /oracle/C11/sapdata1/user1i_1/user1i.data1
Call BACKINT as follows for an inquire:
OS> backint -u C11 -f inquire -t file -p
/oracle/C11/dbs/initC11.utl -i dummy -o dummy.out
The output file dummy.out might look as follows:
********************* dummy.out **************************************
Program: backint
Parameters:
Client node: RC1
Function: backup
Input File: dummy
Output File: dummy.out
Profile: /oracle/C11/dbs/initC11.utl
Parallel sessions: 1
#BACKUP SAP___9409020458 /oracle/C11/sapdata1/user1i_1/user1i.data1
#BACKUP SAP___9409020450 /oracle/C11/sapdata1/user1i_1/user1i.data1
***********************************************************************
Only the line starting with the keyword #BACKUP is interpreted by SAP programs as described in “Formal
Definition of the Interface Program for the Backup Utility” [page 12]. The rest is normally copied to the log
file of the SAP program.
In this example, two backups with different backup IDs were found. Generally, the backup ID includes a
unique key that can consist, for example, of a class of objects and the time of the backup. This enables
unique backup identification.
19
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
copy on another host. This requirement to enable a restore on a host that differs from the backup host can
also be indicated in another way, for example, by a special parameter in the parameter file.
Configuration and Function of the External Backup Tool
Experience has shown that some additional functions of the backup tool not subject to certification can be
useful, particularly with respect to data security. We recommend that tool manufacturers offer the following
functions:
Backup verification
You can use this to make sure that all backup tapes are readable in the event of a recovery.
Ability to create two copies of the offline redo log files
The backup tool should write the copies to separate tapes. The message (#SAVED), indicating that both
files have been backed up successfully, should be output only once after both copies have been made.
This procedure allows you to create two copies of the offline redo log files with one BRARCHIVE call, for
example, brarchive –sd, BACKINT call using the environment variables BI_CALLER= BRARCHIVE. It
also improves security for a database recovery.
An acceptable INQUIRE query time. This often takes too long, up to several minutes. The result is to
lengthen the recovery process and the system downtime, which is particularly critical when many offline
redo log files have to be restored.
Tape label checking
The backup tool should prevent unintentional overwriting of the tapes using a tape label and suitable
locks.
Support for Offline Backups with the Parameter file_online
Starting with BR*Tools Release 6.10, the backup type file_online is also supported for offline backups.
In this scenario, the database is stopped and started not before and after the BACKINT call, but during the
BACKINT run. The database is:
Stopped by the first #BEGIN message in the .switch.lis file
Started again by the last #END message in the file
This procedure enables split-mirror and snapshot scenarios for offline backups to be fully implemented in
BACKINT. The following shows a typical sequence:
1. BRBACKUP is started with the following parameters:
backup_type = offline and backup_dev_type = util_file_online
2. BRBACKUP starts BACKINT with the option -t file_online, without first stopping the database.
3. BACKINT passes the .switch.lis file to BRBACKUP (actually, to BRCONNECT), containing the
#BEGIN message for all files to be backed up.
4. BRBACKUP (actually, BRCONNECT) then stops the database and deletes the .switch.sem file.
5. BACKINT splits the disk and passes the .switch.lis file to BRBACKUP (actually, to BRCONNECT)
with the #END message for all files that are to be backed up.
6. BRBACKUP (actually, BRCONNECT) then starts the database and deletes the .switch.sem file.
7. BACKINT backs up the split files and passes the #SAVED messages to BRBACKUP.
This extension to BRBACKUP functionality does not change the BACKINT specification.
20
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Concepts
By “disk volume” we normally mean a “logical volume” (file system / mount point / drive). This is the smallest
unit that can be backed up with a snapshot or clone. Depending on the hardware and implementation, the
smallest volume unit might also be bigger – for example, a “logical volume group”. The BR*Tools Parameter
util_vol_unit defines which volume unit is used in a specific configuration (for more information, see
“util_vol_unit = disk_vol | sap_data | all_data | all_dbf” [page 27] below).
In the event of a restore, the database files are normally reset to the state of a selected snapshot or clone,
which is known as “snap-back” or “clone-back”. However, it’s often necessary to access such backups
without overwriting the original files – for example, for verification purposes or to copy back into other
directories. This type of additional access is controlled by the BR*Tools parameter util_vol_access. For
more information, see “util_vol_access = none | copy | mount | both” [page 28]. This access normally uses a
separate mount. But, depending on the implementation, the copying of individual files might be possible.
To make the handling of disk volume backups easier, SAP recommends only complete backups. However,
partial backups are still permitted. For partial backups BRBACKUP extends the list of database files to be
backed up so that it always includes all database files on the selected volume units. See also “New Values
volume and volume_online for BACKINT Option -t (type)” [page22].
Prerequisites
To create backups at disk-volume level, you need to meet the following prerequisites:
All database files are in sub-directories of sapdata directories or in sapraw for raw disks.
All online redo log files are in origlog or mirrlog directories, or in sapraw for raw disks.
All control files are in sapdata, origlog, or mirrlog directories, or in sapraw for raw disks.
Normally sapdata, origlog, or mirrlog are mount points (UNIX) or are on separate drives (Windows).
There are no other non-database files in these directories.
If database files from these directories are backed up at disk-volume level, no other files from other
directories can be backed up in the same BACKINT call.
It must be possible to back up files from other directories (for example, saparch, sapbackup, sapreorg)
with a separate BACKINT call at file level in the same backup run.
The use of the new functionality is only allowed with the corresponding certified backup tools.
21
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
The input file still contains a list of file names, not a list of volume names.
BACKINT checks that the file list in the input file is complete. This list must contain all files located on the
volume units that need to be backed up. If there are files on the volume units that are not in the list, these
files are reported with the following error message in the output file:
#ERRFILE <file name>
Then BACKINT terminates immediately with an error exit code, without having performed a backup. Note the
following about #ERRFILE errors:
The fixed files, specified by the file system or by snapshot/clone software (for example, lost+found,
.snapshot, and so on) are not reported in #ERRFILE.
In the new option –n <nlist_file> there is an option to pass a text file to BACKINT. The text file
contains a negative list of non-database files. For more information, see “New BACKINT Option –n
(negative)” [page 23].
Also for these files, there is no #ERRFILE message, although they can be located on the backup volumes
and are not specified in the input file.
If several hundred or thousand such files are found, only the first hundred should be reported.
This check is also made for the restore function, not for mount, dismount, and inquire functions. Particularly
with the restore function only some of the files on the volume units might be requested for restore. Other files
on the backed-up volume, which were in the backup request (that is, they were in the file list of the input file)
and which are not on the negative list, are reported in the #RESTORED messages when the entire volume is
reset with snap-back or clone-back. The recovery procedure (BRRECOVER) is prepared for all files on the
volume units to be overwritten.
Files on the volumes to be overwritten, which are not in the restore request and were not in the backup
request, and which are not on the negative list, are reported in the #ERRFILE messages. In this case,
BACKINT terminates immediately with an error exit code, without having performed a restore.
The completeness check of the input list is deactivated if the option –n no_check is set. For more
information, see “New BACKINT Option –n (negative)” [page 23].
The logic of –t volume_online has not changed. It remains like the logic of –t file_online. However,
note that, when backing up a disk volume, all files from the input list on this volume should be written to a
single .switch.list file.
The function –f restore to restore a disk volume expects that all files from the input list are reset by snap-
back or clone-back. The disk volumes to be reset are defined like the backups. It is possible that other files
on these disk volumes, which are not in the input list, are also reset. This happens when the original disk
volumes are replaced by a snapshot or clone. However, if they need to be copied back to other locations –
that is, when <dest_dir> is set in the input file – then individual files need to be copied from a volume
backup, without overwriting other files. This is also true when <dest_dir> points to the original sub-
directory. Since this functionality is optional, the backup utility does not have to support it. BR*Tools
parameter util_vol_access specifies whether this functionality is available:
Available: util_vol_access = copy | both
22
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
23
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
where <nlist_file> is a text file containing a list of non-database files or directories in the following
format (one file name per line):
<nfile_name1>
<nfile_name2>
…
The files in the list are normally non-database files that are located on the database disk volumes, but are
not explicitly specified in the input file, and are therefore not part of the backup/restore action. They can be
implicitly processed but are never reported in the BACKINT interface messages #SAVED, #RESTORED,
#BACKUP, #MOUNTED, #DISMOUNTED, #NOTFOUND, #ERROR, and #ERRFILE. Especially during a restore,
they might be overwritten without prior warning. If a directory name is given, this is valid recursively for all
files and sub-directories in the given directory.
For each entry in the negative list, the overlying directories are implicitly part of the negative list, but not their
content. Unlike directories mentioned in the negative list, these directories are not recursively processed.
24
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
25
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
2. BACKINT waits for confirmation from BRBACKUP via the .switch.sem and .switch.log files.
3. BACKINT sends a #SUSPEND DATABASE message in the .switch.lst file to BRBACKUP.
4. BRBACKUP (in fact, BRCONNECT) suspends the database with the SQL command ALTER SYSTEM
SUSPEND.
5. BACKINT waits for confirmation from BRBACKUP via the .switch.sem and .switch.log files.
6. BACKINT splits the disks and creates a clone or snapshot.
7. BACKINT sends a #RESUME DATABASE message in the .switch.lst file to BRBACKUP.
8. BRBACKUP (in fact, BRCONNECT) activates database I/O with the SQL command ALTER SYSTEM
RESUME.
9. BACKINT waits for confirmation from BRBACKUP via the .switch.sem and .switch.log files.
10. BACKINT takes all files with the #END message out of backup mode.
All files to be backed up should be written to a single .switch.lis file.
11. BACKINT waits for confirmation from BRBACKUP via the .switch.sem and the .switch.log files.
12. Optionally, BACKINT backs up all files from the clone or snapshot to a tertiary medium, if the clone or
snapshot alone is insufficient as backup.
13. BACKINT reports all successfully backed up files with the #SAVED message to BRBACKUP.
Only use the above produce when it is absolutely necessary to suspend database I/O for the
split. The database suspend phase should be no longer than a few seconds, since all
applications are stopped during this phase and all users must wait.
26
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
This variable specifies the database backup mode. Only BRBACKUP sets this variable.
o ALL whole database backup: backup_mode = all
o FULL full database backup: level 0 incremental, backup_mode = full
o INCR incremental database backup: level 1 incremental, backup_mode = incr,
not for volume backup
o NONDB non-database backup:
backup_mode = <non_db_file_list>|<non_db_dir_list>,
not for volume backup
o PARTIAL partial database backup:
backup_mode = <db_tsp_list>|< db_file_list>,
normally not for volume backup
In addition, environment variables are set for SAPARCH, SAPBACKUP, SAPCHECK, SAPREORG, and
SAPTRACE, which point to the relevant log directory of BR*Tools or Oracle.
27
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
This value is used when a snapshot or clone is created at logical-volume or volume-group level, and the
volumes are mounted on sapdata, origlog, or mirrlog. This means that the disk configuration is
such that all the directories sapdata, origlog, or mirrlog are mount points that can be separately
and independently split. If the split is done on volume-group level, only one logical volume can be created
for each volume group.
all_data – specifies that the smallest unit is all sapdata, sapraw, all origlog, or all mirrlog
directories
This value is used when many or all sapdata directories are located on logical volumes belonging to the
same volume group and the split can only be performed at volume group level. With this configuration,
and directories must be on separate volume groups. Therefore, in this category there are at least three
volume groups.
all_dbf – specifies that the smallest unit is all database files
This value is used when all and all and directories are located on a volume group and the volume group
as a whole can be split. This means that there is only one split for all database files.
This is allowed but does not conform to SAP conventions because it contradicts the SAP
recommendation on the separation of data files and redo log files.
util_vol_access = none | copy | mount | both
Default: none
This new parameter defines the type of access to the files backed up with util_vol, in addition to the
obligatory restore of the files on the original location (snap-back, clone-back) mainly for the purpose of a
verification. See “New Values volume and volume_online for BACKINT Option -t (type)” [page 22]. The
values copy and both also enable a restore to other directories.
none – there are no additional access possibilities on the local computer. In this case such access on
another computer is required for verification.
copy – specifies that the backup utility can copy saved files individually to another target directory. This can
be a temporary location for verification purposes or a new restore location.
mount – specifies that the saved files can be mounted locally by the backup utility with other paths, where
they can be accessed for verification purposes. See “New Values mount and dismount for BACKINT Option -
f (function)” [page 23].
both – specifies that both access types, copy and mount, are possible.
During a restore, these files (and possibly fixed files) might be overwritten without prior warning.
This check makes sure that the backup volumes do not contain either non-database files or database files
belonging to a database other than the one to be backed up. no_check deactivates the BACKINT check of
the backup volumes. When no_check is set, the user takes responsibility for making sure that the database
volumes (directories sapdata, origlog, and mirrlog) only contain database files of the database to be
28
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
backed up. Or, if the database volumes contain either non-database files or database files from a database
other than the one to be backed up, the user accepts that such files can be overwritten without warning.
util_vol_options = “< backint_volume_backup_options>”
Default: value of util_options if set.
util_options = < backint_options>
No default.
These new parameters define additional BACKINT options, which BR*Tools places after the standard
command-line options when calling the BACKINT program. See “User-Defined Additional Options for
BACKINT” [page 25].
util_vol_options is used for volume backup; util_options is used for file backup.
util_vol_path = <backint_volume_backup_directory>
Default: value of util_path if set, otherwise the standard directory for SAP executables
util_path = <backint_directory>
Default: standard directory for SAP executables
These new parameters define the path name to the directory from which BR*Tools calls the BACKINT
executable.
util_vol_path is used for volume backup; util_path is used for file backup.
The customer and backup partner are responsible for making sure that the values of these
parameters do in fact correspond to the actual configuration of the disk storage and BACKINT
functionality.
29
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
BRRECOVER calls the BACKINT inquire function twice with –t file and –t volume to check the
availability of all backups.
From the point of view of the BACKINT interface this functionality is optional.
30
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
BRBACKUP calls BACKINT with –f backup –t volume and a list of all database files in the input file
(for an offline backup the list also contains the online redo log files).
Only for verification, BRBACKUP calls BACKINT with –f restore –t volume and a list of all
database files (plus destination directory, such as sapreorg) in the input file:
<backup_id1> <file1> <dest_dir1>
<backup_id2> <file2> <dest_dir2>
...
BACKINT restores the files from the disk volume backup from the first step into the restore directory
(sapreorg).
Only for verification, BRBACKUP verifies the restored backup files using the Oracle DBVERIFY tool.
After verification, BRBACKUP deletes the restored files in the restore directory (sapreorg).
BRBACKUP calls BACKINT with –f backup –t file and the names of profiles and log files in the
input file.
Complete Recovery with BRRECOVER after the Loss of a Database File on Database
Host
brrecover –t complete
util_vol_unit = sap_data
util_vol_access = mount (not relevant here)
BRRECOVER mounts the database and checks the status of the database files.
BRRECOVER calls BACKINT with –f inquire –t file and #NULL in the input file, to receive a list of
valid BACKINT backup IDs (possibly with backup volume information) of the backups taken at file level.
BRRECOVER calls BACKINT with –f inquire –t volume and #NULL in the input file, to receive a
list of valid BACKINT backup IDs (possibly with backup volume information) of the backups taken at disk
volume level.
BRRECOVER stops the database and saves a control file to a working subdirectory of sapbackup.
BRRECOVER calls BACKINT via BRRESTORE with –f restore –t volume and <backup_id>
<file_name> in the input file to restore the destroyed file. BACKINT restores these file, for example,
using a snap-back or clone-back, thereby overwriting in the same sapdata directory other data files and
possibly also a control file.
BRRECOVER copies the previously saved control file to the original location.
Optionally BRRECOVER imports an incremental backup, if available.
BRRECOVER applies the available offline redo log files
BRRECOVER opens the database after a successful recovery.
Verification of a Disk-Volume Backup with BRRESTORE on Backup Host with
“mount” Access
brrestore -c force -m full -d util_vol -w use_dbv -b last
util_vol_unit = sap_data
util_vol_access = mount
The prerequisite is the existence of the relevant BRBACKUP logs in the sapbackup directory and an
appropriately configured backup utility.
BRRESTORE calls BACKINT with –f mount –t volume and a list of all database files in the input file.
BACKINT mounts the files from the corresponding disk-volume backups and reports the mount
subdirectories to the output file.
31
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
BRRESTORE verifies the mounted backup files with the Oracle DBVERIFY utility.
BRRESTORE calls BACKINT with –f dismount –t volume and a list of all database files with mount
subdirectories in the input file. BACKINT dismounts the files and releases the mount resources.
BRRESTORE calls BACKINT with –f restore –t file and the names of the control file copy and the
new restore directory <dest_dir> in the input file.
BRRESTORE verifies the restored control file copy in the restore directory (normally sapreorg).
32
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
33
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Installation of BR*Tools
Copy the executables for BRBACKUP, BRARCHIVE, BRRESTORE, BRRECOVER, BRCONNECT, and
BRTOOLS to the following directory:
/usr/sap/C11/SYS/exe/run
The parameter file /oracle/C11/dbs/initC11.sap contains all the backup parameters:
Set the defaults (backup device, mode, and so on), to use BACKINT. For example, specify the backup
device type as util_file:
backup_dev_type = util_file
Specify the BACKINT parameter file util_par_file and/or util_vol_par_file.
For more information, see the documentation SAP Database Guide: Oracle in “References” [page 37].
Installation of BACKINT
Copy the BACKINT executable to /usr/sap/C11/SYS/exe/run.
The parameter file /oracle/C11/dbs/initC11.utl contains parameters for BACKINT and the backup
server such as node names, passwords (if necessary), expiration period, and so on. Since the profile name
is part of the interface description, it has to be known to BRBACKUP, BRARCHIVE, BRRESTORE, and
BRRECOVER.
34
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
SAPARCH = <DRIVE2>\oracle\C11\saparch
SAPREORG = <DRIVE2>\oracle\C11\sapreorg
Access rights should include full control. If you have changed the standard password for the Oracle user
SYSTEM, start BRBACKUP, BRARCHIVE, and BRRECOVER with the option
–u system/<password>
Installation Information
A complete SAP System is not necessary to implement and test the BACKINT interface. To get started as
quickly as possible, you can use BRBACKUP, BRARCHIVE, or BRRESTORE without BRRECOVER. Refer
to the examples as described in the BACKINT interface description. You can even perform the test with a
sample Oracle database without meeting SAP-specific requirements such as special tablespace names and
so on.
You only need to create empty directories as follows:
<SAPDATA_HOME>\sapbackup
<SAPDATA_HOME>\saparch
<SAPDATA_HOME>\sapreorg
Then copy the executables BRBACKUP, BRARCHIVE, BRRESTORE, BRRECOVER, BRCONNECT, and
BRTOOLS to a location where they can be accessed by a user with the proper Oracle environment.
You must also create database user SAPR3 and in its schema the tables SDBAH and SDBAD, as shown in
the following script:
create table sapr3.sdbah
(beg varchar2(14) not null,
funct varchar2(3) not null,
obj varchar2(16) not null,
rc varchar2(4) not null,
ende varchar2(14) not null,
actid varchar2(10) not null)
storage (initial 64K next 64K pctincrease 0 minextents 1 maxextents 100);
35
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
Testing Information
As mentioned above, it is useful to test the examples described in the BACKINT interface description. In
addition, also try to perform a backup/restore/recovery using BRRECOVER. In general, perform the
following:
1. Backup tests for data files:
To perform a complete backup (offline and online), use BRBACKUP with the option -d util_file
Repeat with option -d util_file_online.
2. Backup tests for offline redo logs:
To back up offline redo log files, use BRARCHIVE with the option -s
3. Inquire tests for backups:
Use BRRESTORE with the –w|-verify option and check the output. This checks the inquire function.
4. Restore tests for data files and offline redo logs:
o For a complete restore of data files, use BRRESTORE with the option –m full
o For a restore of offline redo log files, use BRRESTORE with the option –a <seq1>-<seq2>
Complete Test Sequence
1. Back up data files.
2. Produce offline redo log files. For example, you can use the following statement with SQLPLUS:
ALTER SYSTEM SWITCH LOGFILE;
3. Perform a backup of these offline redo log files using the BRARCHIVE option –sd for “save and delete.”
4. Move and rename one or more data files to make them unknown to the database and then perform a
complete database recovery in BRRECOVER to check, find backups, and restore and recover the
database.
For more information on the certification test, see APPENDIX B: BACKINT INTERFACE TEST [page 37].
36
BC-BRI BACKINT INTERFACE FOR ORACLE DATABASES February 2012
References
You can find this document and Split-Mirror Disk Backup for Oracle at:
www.sdn.sap.com/irj/sdn/ora SAP on Oracle Knowledge Center Backup and Recovery
You can find more information on Oracle database administration in the SAP Library as follows:
37
www.sap.com
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.
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, B2B 360°, and B2B 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.