Show TOC

Unattended BackupLocate this document in the navigation structure

Use

With BRBACKUP and BRARCHIVE, you can back up your Oracle database without monitoring or operator intervention. How you do this depends on your operating system.

Features

Unattended Parallel Backup

You can make unattended backups if you have enough backup devices. This means that you need as many backup devices as volumes are required for the backup. BRBACKUP can then back up to these devices in parallel, without operator intervention to change the volumes. For more information, see Parallel Backup.

Automatic Tape Changers

If you want to use automatic tape changers, you must define the rewind_offline parameter appropriately and set backup_dev_type to tape_auto or pipe_auto. For more information, see Backup with Automatic Tape Changers.

Serial Backup

Unattended backup is also possible if fewer parallel copy processes than connected backup devices are possible (for example, due to the impact on performance). To do this, set the parameter exec_parallel to 1. If you need several volumes for a backup, the backup devices are not used in parallel. In this case they are used in accordance with the number of copy processes set.

To make a parallel or serial backup on several tape devices, you must define the addresses of the backup devices in the following init<DBSID>.sap parameters:

Backups with BRBACKUP or BRARCHIVE in One Run

The complete backup of the database files and the offline redo log files can be executed with a single start of BRBACKUP, using command option -a|-archive.

For more information, see BRBACKUP and BRARCHIVE Backups in One Run.

Backup with CRON

For a successful unattended backup using CRON, you must meet the following requirements:

  • The parameters in init<DBSID>.sap must be set correctly.

  • The Crontab entries must be defined under user root.

  • BRBACKUP or BRARCHIVE must run under database user ora<dbsid> or the operating system user <sapsid>adm. No password is needed due to the OPS$ mechanism. This means that no password can be seen in a script.

  • Enough volumes (for example, tape or disk volumes) must be available, as well as a sufficient number of backup devices (if you want to perform a parallel backup).

  • The correct tapes must be mounted in the backup devices. The operator cannot change the tapes during the backup run.

    If automatic tape management is active, first determine the tape names by entering the commands brbackup|brarchive -q.

    Use brbackup|brarchive -q check to verify that the required volumes were actually mounted.

    For more information, see brbackup -q and brarchive -q.

    If automatic tape management is not active, mount tapes for which the expiration period has passed.

Example

These are examples of shell scripts to start unattended backups.

Example

Online backup of the complete database

Unattended operation

Daily, Monday through Friday

Backup to start at 22:00

#Min(0-59) Hrs (0-23) Day (1-31) Mon(1-12) WD (0-Sun,...,6-Sat)

00 22 * * 1-5

su - ora<dbsid> -c "brbackup -t online -c force -u"%system/<password>

or under <sapsid>adm:

su - <sapsid>adm -c "brbackup -t online -c force -u /"

Example

Offline backup of the complete database

Unattended operation

Daily, Monday through Friday

Backup to start at 22:00

SAP system shut down

#Min(0-59) Hrs (0-23) Day (1-31) Mon(1-12) WD (0-Sun,...,6-Sat)

00 22 * * 1-5

/backup1.sh

The script backup1.sh in the root directory might look as follows:

su - <sapsid>adm -c "stopsap R3"

su - ora<dbsid> -c "brbackup -t offline -c force -u" <<END

system/<password>

END

su - <sapsid>adm -c startsap

Example

Offline backup of the complete database

Unattended operation

Daily, Monday through Friday

Backup to start at 22:00

No SAP system shut down

#Min(0-59) Hrs (0-23) Day (1-31) Mon(1-12) WD (0-Sun,...,6-Sat)

00 22 * * 1-5

/backup2.sh

The script backup2.sh in the root directory might look as follows:

su - ora<dbsid> -c "brbackup -t offline_force -c force -u" <<END

system/<password>

END

Example

Archiving the offline redo log files

Unattended operation

Daily, Monday through Friday

Backup to start at 08:00

Parallel archiving to two backup devices.

#Min(0-59) Hrs (0-23) Day (1-31) Mon(1-12) WD (0-Sun,...,6-Sat)

00 8 * * 1-5

su - ora<dbsid> -c "brarchive -ssd -c force -u"%system/<password>