How to perform a Oracle-Offline-Backup started from within SAP in Cluster
807567Aug 13 2004 — edited Dec 23 2004Hello,
I didn't find a solution on web (at SAP/SUN/newsgroups) for the following problem:
environment
- offline-backup of Oracle-database (database of an SAP-R/3 ERP-system)
- Sun Cluster 3.1 environment (SUNW.oracle_server:3.1, SUNW.oracle_listener:3.1, SUNW.sap_ci_v2)
- backup should be started from within the SAP R/3 scheduler (SAP transaction: db13)
- Oracle-RMAN-backup with Legato networker 7.1
- SID of SAP-system: Q22
problem
When SAP starts the backup-job (scheduler: db13, type: Full database offline backup >> option: offline_force) the brbackup commands shuts down the database and starts RMAN-backup. But then the Sun Cluster sees that the database is down and starts it up. This action of the cluster crashes the backup.
Now I found a tricky solution for that problem:
1.
Install sudo because the following script will not be run as root...
2.
run visudo and add this line (the scheduler db13 uses the OS-user <SID>adm)
q22adm ALL=NOPASSWD: /usr/cluster/bin/
3.
make a shell-script which should reside on a global mount:
/sapmnt/Q22/MB/offline_backup_Q22.sh
#!/bin/sh
/usr/local/bin/sudo /usr/cluster/bin/scswitch -n -j Q22db-srv
sleep 10
/usr/sap/Q22/SYS/exe/run/brbackup -u / -c force -t offline_force -m full -p initQ22rmanoffline.sap
/usr/local/bin/sudo /usr/cluster/bin/scswitch -e -j Q22db-srv
4.
edit the table sapr3.sxpgcotabe in the Oracle-database and add an entry like:
NAME: ZOFFLINEBACKUP_Q22
OPSYSTEM: ANYOS
OPCOMMAND: /sapmnt/Q22/MB/offline_backup_Q22.sh
this is not possible via SAP, use Oracle-tools!
5.
edit table sdbac via SAP-transaction se16, select DBSYS=ORACLE and add an entry like:
SHORTCUT ZOFF
DBSYS ORACLE
OPSYS *
LANGUAGE E
SHORTNAM FullOffClu
LONGNAME Full database offline backup >SunCluster
HOST $DBHOST
CTYPE EXT
CNAME ZOFFLINEBACKUP_Q22
6. Schedule the offline-backup via SAP-transaction (new type available: Full database offline backup >SunCluster)
I hope that maybe helps someone...
cu, Otmar