Example: Backup with an Autoloader 
This example shows how to integrate an autoloader HP 48AL into the BRBACKUP/BRARCHIVE backup strategy. 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 band 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. The automatic tape administration is switched on.
An extract from the profile
initC11.sap may 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 > $ORACLE_HOME/sapbackup/.slot
C shell script dismount_tape.csh:
#!/bin/csh -f
set_slot=`cat $ORACLE_HOME/sapbackup/.slot`
mtx -d $2 -u $slot
echo $slot > $ORACLE_HOME/sapbackup/.slot
These scripts must be feasible and be located correspondingly 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 (e.g. C11B11) from the data carrier 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 carried out 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 places it back in slot 11.
The BRARCHIVE backup procedure is analog 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/programs, e.g. to carry out parallel backups on several tapes, or to backup several databases and form subpools for these in a tape robot.
The loading of the mount and dismount commands is the complete responsibility of the user.