The following steps are an example using Oracle. Note: In this example STC is being used as the DB ID as well as the SAP SID. All occurrences of “STC” or “stc” in these commands (e.g., /usr/sap/STC or user orastc) should be replaced with the actual DB ID or SAP SID being used in the user’s cluster configuration.

  1. Change directory to /usr/sap/STC, 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

  1. Change the temporary directories to the correct user permission.

chown stcadm:sapsys /tmp/m1 (repeat for m2 and m3)

  1. Unmount the three temp directories using umount /tmp/m1 and repeat for m2 and m3.
  1. Re-mount the device over the old directories.

mount /dev/sap/ASCS{No.} /usr/sap/STC/ASCS{No.}

mount /dev/sap/SCS{No.} /usr/sap/STC/SCS{No.}

mount /dev/sap/DVEBMGS{No.} /usr/sap/STC/DVEBMGS{No.}

  1. 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

mount /dev/oracle/oraarch /tmp/m12

mount /dev/oracle/oraflash /tmp/m13

  1. Change the directory to /oracle/STC and copy the data.

a. Change to each subdirectory (cd cd sapdata1 and perform cp –a * /tmp/m1)

  1. Repeat this previous step for each subdirectory as shown in the relationship above.
  1. Change the temporary directories to the correct user permission.

chown orastc:dba /tmp/m1 (repeat for m2 to m12)

  1. Unmount all the temp directories.

umount /tmp/m*

  1. Re-mount the device over the old directories.

mount /dev/oracle/sapdata1 /oracle/STC/sapdata1

  1. Repeat the above for all the listed directories.
  1. Edit the /etc/exports file and insert the mount points for SAP’s main directories.

/exports/sapmnt *(rw,sync,no_root_squash)

/exports/saptrans *(rw,sync,no_root_squash)

  1. Start the NFS server using systemctl start nfs-server.service. If the NFS server is already active, you may need to do an “exportfs -va“ to export those mount points.
  1. Execute the following mount commands (note the usage of udp; this is important for failover and recovery).

mount { virtual ip }:/exports/sapmnt/< SID > /sapmnt/< SID > -o rw,sync,bg,udp

mount { virtual ip }:/exports/saptrans /usr/sap/trans -o rw,sync,bg,udp

  1. Log in to Oracle and start Oracle (after su to orastc).

lsnrctl start LISTENER_STC

sqlplus / as sysdba

startup

  1. Log in to SAP and start SAP (after su to stcadm).

startsap sap{No.}

  1. 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 MCC (Microsoft Management Console Snap-In for SAP) is an SAP-supplied Windows client that can be used to administer SAP instances. A corresponding version for Unix/Linux called SAP MC (SAP Management Console) is also available.

  1. Stop SAP and the Oracle Listener. (Note: 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 any leftover processes still associated to the stcadm and orastc users (e.g., ps -u stcadm and ps -u orastc)

  1. 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.}

  1. Stop the NFS server using the systemctl stop nfs-server.service command and perform the unmounts.

umount /exports/sapmnt

umount /exports/saptrans

  1. Copy /etc/exports to the backup system.

scp /etc/exports (backup ip):/etc/exports

  1. Deactivate the logical volumes on the primary.

lvchange –an oracle

lvchange –an sap

  1. Create the corresponding SAP directories on the backup system.

mkdir –p /exports/sapmnt

mkdir –p /exports/saptrans

  1. 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.

  1. 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

  1. Switch over the IP addresses to the backup system via LifeKeeper.
  1. Mount the NFS exports on the backup

mount sap{No.}:/exports/sapmnt/STC /sapmnt/STC

mount sap{No.}:/exports/saptrans/trans /usr/sap/trans

  1. Log in to Oracle and start Oracle (after su to orastc).

lsnrctl start LISTENER_STC

sqlplus / as sysdba

startup

  1. Log in to SAP and start SAP (after su to stcadm).

startsap sap{No.}

  1. Log in to LifeKeeper and switch primary and backup priority instances (make backup higher priority).
  1. 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)

  1. Create “file system” resources, all the 17 mount points (5 for SAP and 12 for Oracle) one by one.
  1. Extend to the original primary.

LifeKeeper resource hierarchy and SAP cluster are set up. (Note: This is a screen shot from the DEV instance.)

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment