The following steps are an example using Oracle.
Note Before Beginning: Primary and backup have been specified for the two servers. At the end of this procedure, the roles will be reversed. It is recommended that you first read through the steps, plan out which machine will be the desired primary and which will be the intended backup. At the end of this procedure, the role of primary and backup should become interchangeable. Understanding that in certain environments some machines are intended to be primary and some the backups, it is important to understand how this is structured.
- Change directory to /usr/sap/DEV, then change to each subdirectory and copy the data.
- cd ASCS{No.}
- cp –a * /tmp/m1
- cd ../SCS{No.}
- cp –a * /tmp/m2
- cd ../DVEBMGS{No.}
- cp –a * /tmp/m3
- Change the temporary directories to the correct user permission.
chown stcadm:sapsys /tmp/m1 (repeat for m2 and m3)
- Unmount the three temp directories using umount /tmp/m1 and repeat for m2 and m3.
- Re-mount the device over the old directories.
mount /dev/sap/ASCS{No.} /usr/sap/STC/ASCS{No.}</font?
mount /dev/sap/SCS{No.} /usr/sap/STC/SCS{No.}
mount /dev/sap/DVEBMGS{No.} /usr/sap/STC/DVEBMGS{No.}
- Mount the thirteen temp directories for Oracle.
mount /dev/oracle/sapdata1 /tmp/m1
mount /dev/oracle/sapdata2 /tmp/m2
mount /dev/oracle/sapdata3 /tmp/m3
mount /dev/oracle/sapdata4 /tmp/m4
mount /dev/oracle/mirrlogA /tmp/m5
mount /dev/oracle/mirrlogB /tmp/m6
mount /dev/oracle/origlogA /tmp/m7
mount /dev/oracle/origlogB /tmp/m8
mount /dev/oracle/saparch /tmp/m9
mount /dev/oracle/sapreorg /tmp/m10
mount /dev/oracle/saptrace /tmp/m11</font?
mount /dev/oracle/oraarch /tmp/m12
mount /dev/oracle/oraflash /tmp/m13
- Change the directory to /oracle/STC and copy the data.
a. Change to each subdirectory (cd cd sapdata1 and perform cp –a * /tmp/m1)
- Repeat this previous step for each subdirectory as shown in the relationship above.
- Change the temporary directories to the correct user permission.
chown orastc:dba /tmp/m1 (repeat for m2 to m12)
- Unmount all the temp directories.
umount /tmp/m*
- Re-mount the device over the old directories.
mount /dev/oracle/sapdata1 /oracle/STC/sapdata1
- Repeat the above for all the listed directories.
- Edit the /etc/exports directory and insert the mount points for SAP’s main directories.
/exports/sapmnt *(rw,sync,no_root_squash)
/exports/saptrans *(rw,sync,no_root_squash)
- Start the NFS server using the rcnfsserver start command (this is for SLES; for Red Hat, perform service nfs start). If the NFS server is already active, you may need to do an “exportfs -va“ to export those mount points.
- Execute the following mount commands (note the usage of udp; this is important for failover and recovery).
mount {virtual ip}:/exports/sapmnt/ /sapmnt/ -o rw,sync,bg,intr,udp
mount {virtual ip}:/exports/saptrans /usr/sap/trans -o rw,sync,bg,intr,udp
- Log in to Oracle and start Oracle (after su to orastc).
lsnrctl start LISTENER_STC
sqlplus / as sysdba
startup
- Log in to SAP and start SAP (after su to stcadm).
startsap sap{No.}
- Make sure all processes have started.
ps –ef | grep en.sap (2 processes)
ps –ef | grep ms.sap (2 processes)
ps –ef | grep dw.sap (17 processes)
“SAP Logon” or “SAP GUI for Windows” is an SAP supplied Windows client the Windows client. The program can be downloaded from the SAP download site. The virtual IP address may be used as the “Application Server” on the Properties page. This ensures that a connection to the primary machine where the virtual ip resides is active.
- Stop SAP and the Oracle Listener. (Note: The users specified here are examples, e.g. SID “STC”. In your environment, the userid would be different based on your SID, e.g. xxxadm or oraxxx, where xxx is the SID. Also note in Step c, we use the SQL*Plus utility from Oracle to log in to Oracle and shut down the database.)
a. su to stcadm and enter command “stopsap sap{No.}”
b. su to orastc and enter command “lsnrctl stop LISTENER_STC”
c. su to orastc and enter “sqlplus sys as SYSDBA” and enter “shutdown at the command prompt”
d. enter command “stopsap sap{No.}”
e. killall sapstartsrv as root
f. kill process left over for sap and oracle user
- Unmount all the file systems.
umount /usr/sap/trans
umount /sapmnt/STC
umount /oracle/STC/*
umount /usr/sap/STC/DVEBMGS{No.}
umount /usr/sap/STC/SCS{No.}
umount /usr/sap/STC/ASCS{No.}
- Stop the NFS server using the command “rcnfsserver stop” and perform the unmounts.
umount /exports/sapmnt
umount /exports/saptrans
- Copy /etc/exports to the backup system.
scp /etc/exports (backup ip):/etc/exports
- Deactivate the logical volumes on the primary.
lvchange –an oracle
lvchange –an sap
- Create the corresponding SAP directories on the backup system.
mkdir –p /exports/sapmnt
mkdir –p /exports/saptrans
- Activate the logical volumes on the backup system.
lvchange -ay oracle
lvchange -ay sap
Note: Problems may occur on this step if any rearranging of storage occurred on the primary when the volume groups were built. A reboot of the backup will clear this up.
- Mount the directories on the backup machine.
mount /dev/sap/sapmnt /exports/sapmnt
mount /dev/sap/saptrans /export/saptrans
mount /dev/sap/ASCS00 /usr/sap/STC/ASCS{No.}
mount /dev/sap/SCS01 /usr/sap/STC/SCS{No.}
mount /dev/sap/DVEBMGS02 /usr/sap/STC/DVEBMGS{No.}
mount /dev/oracle/sapdata1 /oracle/STC/sapdata1
mount /dev/oracle/sapdata2 /oracle/STC/sapdata2
mount /dev/oracle/sapdata3 /oracle/STC/sapdata3
mount /dev/oracle/sapdata4 /oracle/STC/sapdata4
mount /dev/oracle/origlogA /oracle/STC/origlogA
mount /dev/oracle/origlogB /oracle/STC/origlogB
mount /dev/oracle/mirrlogA /oracle/STC/mirrlogA
mount /dev/oracle/mirrlogB /oracle/STC/mirrlogB
mount /dev/oracle/oraarch /oracle/STC/oraarch
mount /dev/oracle/saparch /oracle/STC/saparch
mount /dev/oracle/saptrace /oracle/STC/saptrace
mount /dev/oracle/sapreorg /oracle/STC/sapreorg
- Switch over the IP addresses to the backup system via LifeKeeper.
- Mount the NFS exports on the backup
mount sap{No.}:/exports/sapmnt/STC /sapmnt/STC
mount sap{No.}:/exports/saptrans/trans /usr/sap/trans
- Log in to Oracle and start Oracle (after su to orastc).
lsnrctl start LISTENER_STC
sqlplus / as sysdba
startup
- Log in to SAP and start SAP (after su to stcadm).
startsap sap{No.}
- Log in to LifeKeeper and switch primary and backup priority instances (make backup higher priority).
- On the original primary, save the original directories as such:
mv /exports /exports-save
mv /usr/sap/STC/DVEBMGS{No.} /usr/sap/STC/DVEBMGS{No.}-save (repeat for SCS{No.} and ASCS{No.})
mv /oracle/STC/sapdata1 /oracle/STC/sapdata1-save (repeat for sapdata2, sapdata3, sapdata4, mirrlogA, mirrlogB, origlogA, origlogB, sapreorg, saptrace, saparch, oraarch)
- Create “file system” resources, all the 17 mount points (5 for SAP and 12 for Oracle) one by one.
- Extend to the original primary.
LifeKeeper resource hierarchy and SAP cluster are set up. (Note: This is a screen shot from the DEV instance.)
Post your comment on this topic.