Autoloader Backup Example

If you are using Backup with Automatic Tape Changers, this example shows how to integrate an autoloader, HP 48AL, into the backup strategy for BRBACKUP or BRARCHIVE.

The configuration of the mount and dismount commands is your complete responsibility. Consult your hardware partner if in doubt.

During this the mtx command is used for the mounting and dismounting of the tapes. We assume that the autoloader has 20 slots. The fifth and sixth characters of the tape name are used for the number of the slot:

Slot 1-10:    tapes C11A01,.C11A02,......,C11A10.
Slot 11-20:  tapes C11B11, C11B12,......,C11B20.

The backup of the database C11 with BRBACKUP and the backup of the offline redo log files each require one tape. Automatic tape administration is switched on.

An extract from the profile initC11.sap might look like the following:

...

backup_dev_type = tape_box

tape_address = /dev/rmt/0mn

tape_address_rew = /dev/rmt/0m

tape_address_ctl = /dev/scsi/3

mount_cmd = mount_tape.csh $ $ $

dismount_cmd = dismount_tape.csh $ $

volume_archive = (C11A01, C11A02,....,C11A10)

volume_backup  = (C11B11, C11B12,....,C11B20)

...

C shell script mount_tape.csh:

#!/bin/csh -f
set slot=`echo $3 | cut -b 5-6`
mtx -d $2 -l $slot
echo $slot > $SAPDATA_HOME/sapbackup/.slot

C shell script dismount_tape.csh:

#!/bin/csh -f
set slot=`cat $SAPDATA_HOME/sapbackup/.slot`
mtx -d $2 -u $slot

These scripts must be executable and be located in the directory /usr/sap/C11/SYS/exe/run.

Procedure for a BRBACKUP backup with mount and dismount commands:

After BRBACKUP is started, the automatic tape administration of BRBACKUP chooses a tape (for example, C11B11) from the backup volume list. Internally the mount command is called up to mount the chosen tape in the tape device:

mount_tape.csh C11-B /dev/scsi/3 C11B11

In this script the following mtx command is executed:

mtx -d /dev/scsi/3 -l 11

This command causes the tape to be mounted from the 11th slot in the tape device. If the command is performed without an error message and with exit code 0, BRBACKUP assumes that the tape has been mounted successfully. After a tape label check, BRBACKUP starts the backup to the tape.

After the backup has finished the tape is again dismounted in the tape device:

dismount_tape.csh C11-B /dev/scsi/3

In this script the following mtx command is executed:

mtx -d /dev/scsi/3 -u 11

This command dismounts the current tape and returns it to slot 11.

The BRARCHIVE backup procedure is similar to the BRBACKUP backup described here. In this case, a tape C11A01,....,C11A10 is chosen from the slots 1-10.

For simplification neither the first option (ORACLE-SID) nor the last option (mount_par_file) of the mount or dismount command has been used in the example described here. You can make use of these options in more demanding scripts or programs, such as to perform parallel backups on several tapes, or to backup several databases and form sub-pools for these in a tape robot.