You are here: Installation > Move Data to Shared Disk and LifeKeeper

Move Data to Shared Disk and LifeKeeper

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.

  1. Change directory to /usr/sap/DEV, then change to each subdirectory and copy the data.

  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.

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

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

  1. Repeat this previous step for each subdirectory as shown in the relationship above.

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

  2. 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)

  1. Start the NFS server using the rcnfsserver start command (this is for SLES; for Redhat, perform service nfs start).  If the NFS server is already active, you may need to do an "exportfs -va" to export those mount points.

  2. 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,intr,udp

mount {virtual ip}:/exports/saptrans /usr/sap/trans -o rw,sync,bg,intr,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 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.

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

  1. su to stcadm and enter command “stopsap sap{No.}”

  2. su to orastc and enter command  “lsnrctl stop LISTENER_STC”

  3. su to orastc and enter "sqlplus sys as SYSDBA" and enter "shutdown at the command prompt"

  4. enter command “stopsap sap{No.}

  5. killall sapstartsrv as root

  6. kill process left over for sap and oracle user

  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 command “rcnfsserver stop” 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.

  2. 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).

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

  2. Extend to the original primary.

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

                  LKGUIDEVInstance.JPG                  

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.