You are on page 1of 16

Creation and Administration Of Replication Instance (ERS)

Table of Content
Introduction.....................................................................................................................3 Creation of Instance subdirectlry .....................................................................................4 Build Kernel for ERS ......................................................................................................5 Profile Parameter change.................................................................................................6 1.1 Default profile..................................................................................................6 1.2 Start Profile......................................................................................................7 1.3 Instance Profile ................................................................................................8 Starting and Stopping ERS Instance ................................................................................9 Checking ERS status .....................................................................................................10 Use ........................................................................................................................10 Prerequisites ..........................................................................................................10 Procedure ..............................................................................................................10 Monitoring the Lock Table at Failover ..........................................................................11 Use ........................................................................................................................11 Prerequisites ..........................................................................................................11 Procedure ..............................................................................................................11 Monitoring the Standalone Enqueue Server ...................................................................13 Purpose..................................................................................................................13 Prerequisites ..........................................................................................................13 Procedure ..............................................................................................................13 Example ................................................................................................................15

Version Control
Version 1 Date
07/04/2010

Change Request

Changed By B K Sinha

Appro ved

Description of Change Initial Version

Introduction
This section describes how to add Enqueue Replication Services (ERS) to a system that has SAP kernel 4.6,6.x or 7.0 ASCS and/or SCS instances. The section can be skipped for SAP kernel 7.10 and higher. Usethe installation routines for ERS instances as provided by the SAP installer instead. The ASCS (ABAP) or SCS (JAVA) instance will be accompanied with an ERS instance that permanently keeps a mirror of the [A]SCS internal state and memory. As a result, no information gets lost due to failing SAP System Central Services, if the SGeSAP package that includes [A]SCS fails over to the node that runs ERS during runtime.

Creation of Instance subdirectlry


Create filesystem /usr/sap/<SID>/ERS<S.N> which should switch among the nodes during failover.
su - <sid>adm cd /usr/sap/<SID>/ERS<INSTNR> mkdir data log exe work profile Starting with SAP kernel 7.0, the following subdirectory structure also needs to be created: mkdir -p exe/servicehttp/sapmc

Build Kernel for ERS


A couple of required SAP executables should be copied from the central executable directory /sapmnt/<SID>/exe to the instance executable directory /usr/sap/<SID>/ERS<INSTNR>/exe For SAP kernel 6.40 the list includes: enqt, enrepserver, ensmon, libicudata.so.30, libicui18n.so.30, libicuuc.so.30,libsapu16_mt.so, libsapu16.so, librfcum.so, sapcpe and sapstart. For some releases, the shared library file extension .so is replaced by .sl. Apart from this, the procedure remains the same. Copy these files and add a file named ers.lst in the instance executable directory. The ers.lst should include these lines
enqt enrepserver ensmon libicudata.so.30 libicui18n.so.30 libicuuc.so.30 libsapu16_mt.so libsapu16.so librfcum.so sapcpe sapstart ers.lst For SAP kernel 7.00 or higher, the following executables need to be copied in addition: sapstartsrv sapcontrol servicehttp/sapmc/sapmc.jar servicehttp/sapmc/sapmc.html servicehttp/sapmc/frog.jar servicehttp/sapmc/soapclient.jar For SAP kernel 7.00 or higher, the ers.lst file needs to have additional lines: sapstartsrv sapcontrol servicehttp

Profile Parameter change


Create the Start and Instance Profile in /usr/sap/<SID>/ERS<INSTNR>/profile and
copy the same to /sapmnt/<SID>/profile.

1.1 Default profile Set the following parameter in DEFAULT.PFL located at /sapmnt/<SID>/profile as given in example below:
#.********************************************************************* ********************************************************* #.* * #.* Default profile DEFAULT * #.* * #.* Version = 000005 * #.* Generated by user = BASIS * #.* Generated on = 06.03.2010 , 18:04:12 * #.* * #.********************************************************************* ********************************************************* #parameter created by: BASIS 06.03.2010 18:03:29 rdisp/no_statistic = PLUGIN #parameter created by: BASIS 06.03.2010 18:03:15 icm/accept_remote_trace_level = 0 #parameter created by: BASIS 06.03.2010 18:03:01 gw/accept_remote_trace_level = 0 #parameter created by: BASIS 06.03.2010 18:02:50 rdisp/accept_remote_trace_level = 0 #parameter created by: BASIS 06.03.2010 18:02:38 rdisp/elem_per_queue = 4000 #parameter created by: BASIS 06.03.2010 18:02:19 rdisp/tm_max_no = 2000 #parameter created by: BASIS 06.03.2010 18:02:06 gw/max_sys = 2000 #parameter created by: BASIS 06.03.2010 18:01:52 gw/max_overflow_size = 25000000 #parameter created by: BASIS 06.03.2010 18:01:34

gw/max_conn = 2000 #parameter created by: BASIS 18:01:15 rdisp/max_comm_entries = 2000 #parameter created by: BASIS 18:00:54 rdisp/wp_ca_blk_no = 1000 #parameter created by: BASIS 18:00:37 rdisp/appc_ca_blk_no = 2000 #parameter created by: DDIC 12:45:56 rslg/collect_daemon/host = ascsERP #parameter created by: DDIC 12:45:27 rdisp/btcname = ascsERP_ERP_00 #parameter created by: DDIC 12:44:58 rdisp/vbname = ascsERP_ERP_00 #parameter created by: DDIC 12:44:08 rdisp/sna_gateway = ascsERP SAPSYSTEMNAME = ERP SAPDBHOST = dbERP rdisp/mshost = ascsERP #give message server hosts #Give message server port as defined in /etc/services file rdisp/msserv = sapmsERP rdisp/msserv_internal = 3901 #check for correct port enque/process_location = REMOTESA enque/serverhost = ascsERP #Give enque host enque/serverinst = 01 #Give Enque system number login/system_client = 999 enque/deque_wait_answer = TRUE login/no_automatic_user_sapstar = 0

06.03.2010

06.03.2010

06.03.2010

03.03.2010

03.03.2010

03.03.2010

03.03.2010

1.2 Start Profile Create start profile as given in example below at /usr/sap/<SID>/ERS<S.N>/profile Profile name: START_ERS10_ers10ERP as per naming convention:START_ERS<S.N>_<ERS_HOST>
SAPSYSTEMNAME = ERP SAPSYSTEM = 10 INSTANCE_NAME = ERS10 ##################SETTINGS FOR MANUALLY SET_UP INSTANCE SCSID = 01 DIR_CT_RUN = $(DIR_EXE_ROOT)/run DIR_EXECUTABLE = $(DIR_INSTANCE)/exe SAPLOCALHOST = ascsERP DIR_PROFILE = $(DIR_INSTANCE)/profile _PF = $(DIR_PROFILE)/ERP_ERS10_ers10ERP SETENV_00 = PATH=$(DIR_INSTANCE)/exe:%(PATH) SETENV_01 = LD_LIBRARY_PATH=$(DIR_EXECUTABLE)

#---------------------------------------------------------------------# Copy SAP Executables #---------------------------------------------------------------------_CPARG0 = list:$(DIR_CT_RUN)/scs.lst Execute_00 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG0) #---------------------------------------------------------------------# start enqueue replication server #-------------------------------------------------------------------_ER = er.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME) Execute_01 = immediate rm -f $(_ER) Execute_02 = local ln -s -f $(DIR_EXECUTABLE)/enrepserver $(_ER) Restart_Program_00 = local $(_ER) pf=$(_PF) NR=$(SCSID)

1.3 Instance Profile Profile Name: ERP_ERS10_ers10ERP as per naming convention:<SID>_ERS<S.N>_<ERS_HOST>


#-------------------------------------------------------------------# system settings #-------------------------------------------------------------------SAPSYSTEM = 10 SAPSYSTEMNAME = ERP INSTANCE_NAME = ERS10 #-------------------------------------------------------------------# Special settings for this manually set up instance #-------------------------------------------------------------------DIR_EXECUTABLE = $(DIR_INSTANCE)/exe DIR_PROFILE = $(DIR_INSTANCE)/profile DIR_CT_RUN = /usr/sap/ERP/SYS/exe/runU #-------------------------------------------------------------------# Settings for enqueue monitoring tools (enqt, ensmon) #-------------------------------------------------------------------enque/process_location = REMOTESA rdisp/enqname = $(rdisp/myname) #-------------------------------------------------------------------# standalone enqueue details from (A)SCS instance #-------------------------------------------------------------------SCSID = 01 SCSHOST = ascsERP enque/serverinst = $(SCSID) enque/serverhost = $(SCSHOST) enque/repl/shadow_file_name = /usr/sap/ERP/ERS10/data/SHM_FILESETS_BACKUP

Starting and Stopping ERS Instance


After making above changes you are ready to start the ERS instance.
su - <sid>adm startsap <ERS_HOST> ERS<S.N> (To start ERS instance) stopsap <ERS_HOST> ERS<S.N> (To Stop ERS instance) Check the log at /usr/sap/<SID>/ERS<INSTNR>/work in case of any issue.

Checking ERS status


Use
You can use the command line program ensmon to check the connection between the enqueue server and the replication server.

Prerequisites
You have started the (A)SCS instance of your SAP system. With an ABAP+Java system both the SCS instance and the ASCS instance must be running. Start program ensmon on the host on which the replication server is installed.

Procedure
To determine the replication server enter the following command: ensmon pf=<ERS_instance_prodfile> 2 The output tells you about the connection from the replication server to the enqueue server. The following options are available:
The connection is ok. This would look like:

Try to connect to host <Virtual (A)SCS host> service sapdp01 get replinfo request executed successfully Replication is enabled in server, repl. server is connected Replication is active ...
The connection is not ok. This would look like:

Try to connect to host <Virtual (A)SCS host> service sapdp01 get replinfo request executed successfully Replication is enabled in server, but no repl. server is connected ... If the connection is not ok, first check whether the replication server has been started at all (using the operating system or the cluster software.) If the replication server has been started, check files dev_enqrepl on the enqueue server or dev_enrepsrv on the replication server (in the work directory of the (A)SCS or ERS instance). Here you will see, amongst other messages, network error messages (for example, "connection refused"),. Use the error messages and profile files here to narrow down the cause of the problem. If this does not work, restart the enqueue or replication server and set the profile parameter rdisp/TRACE = 3. Open a problem message on component BC-CST-EQ and attach files dev_enqrepl and dev_enrepsrv to it.

Monitoring the Lock Table at Failover


Use
By running the tests in program enqt you can check and monitor the fill level and the ID of the Lock Table.

Prerequisites
You have started the (A)SCS instance of your SAP system. With an ABAP+Java system both the SCS instance and the ASCS instance must be running. Start program enqt on the server on which the replication server is installed.

Procedure
Then use the enqt options described here. Otherwise you could damage the content of the lock table.

Monitoring the Fill Level of the Lock Table at Failover


...

1.

Enter the command below to fill the lock table of the enqueue server with 20 locks.

enqt pf=<ERS_instance_profile> 11 20 Here <ERS_instance_profile> is the profile that was created when the
replication server was installed. 2. Monitor the fill level of the lock table by executing the command below:

enqt pf=<ERS_instance_profile> 20 1 1 9999


This command permantly reads the content of the lock table and shows the number of lock entries on the console. 3. Trigger a failover of the (A)SCS (the exact procedure depends on the cluster solution used). The output will look like this: Number Number Number Number Number Number Number Number Number Number Number ... of of of of of of of of of of of selected selected selected selected selected selected selected selected selected selected selected entries: entries: entries: entries: entries: entries: entries: entries: entries: entries: entries: 20 20 20 20 20 0 20 20 20 20 20

(failover) (enqueue server is running again)

4. Make sure that the number of lock entries is the same both before and after the failover. If the enqueue ID changes, or the number of locks is zero after the failover, the

replica was not copied. Using level 3 trace you have to run a detailed analysis of the failover (in particular of the enqueue server that was restarted).

You can now check whether the instance number of the replication server and the instance number of the enqueue server matches. If it doesnt, there is a configuration error. Use showipc to check whether there is a shared memory segment with number 66. Check whether the enqueue server has been started on the correct host (the host on which the replication was running before). Search in trace files dev_enqsrv (after the failover) and dev_enrepsrv (before the failover) for error messages. Consult with SAP Support.

Monitoring Lock Table ID at Failover


...

1.

Enter the following command to output the lock table ID before the failover.

enqt pf=<ERS_instance_profile> 97 Here <ERS_instance_profile> is the profile that was created when the
replication server was installed. 2. Trigger a failover of the (A)SCS instance. 3. Enter the command enqt pf=<ERS_instance_profile> 97. The result should look like: Before the failover:

enqt =<ERS_instance_profile> 97 ---REQ--------------------------------------------------------EnqId: EnqTabCreaTime/RandomNumber = 25.10.2005 11:15:59 1130231759 / 9288 ...


After the failover:

enqt =<ERS_instance_profile> 97 ---REQ--------------------------------------------------------EnqId: EnqTabCreaTime/RandomNumber = 25.10.2005 11:15:59 1130231759 / 9288 ...


4. Make sure that the lock table ID is the same before and after the failover. If it isnt, the replica has not been copied (see above).

Monitoring the Standalone Enqueue Server

Purpose
You can monitor the enqueue server and the enqueue replication server using the program ensmon (ensmon.exe under Windows).

Prerequisites
The standalone enqueue server is running. In the following sections <profile> is the profile file that has been used to start one of the application servers. This contains the information required by the monitoring program.

Procedure
The ensmon process connects to the enqueue server across the network. You must specify the name of the host on which the enqueue server is running, either by specifying the profile file pf=<profile> or using the call option -H <hostname>. You can specify the instance number of the enqueue server in the parameter -I <server instance>. If you want to start ensmon on a server on which the SAP standard services sapdpXX (XX= instance number) are not configured, you can specify the port directly using the option -S <serverport> (standard: 32XX).
If you call up ensmon without specifying any parameters, a short help text is displayed about the parameters: standalone enqueue server monitor ================================= usage: ensmon [--help|-help|-h] [pf=<profile>] [-H <hostname> [-I <serverinstance>|-S <serverservicename/serverport>]] [<opcode>] [<parameters (depending on opcode)>]

Operation Codes
The behavior of the ensmon program is controlled using numerical operation codes (opcodes). If you enter ensmon help, an overview of these operation codes is displayed. There are more parameters for most operation codes. The most important operation codes are 2 and 3. With operation code 3 you can fetch a file from the enqueue server and save it on your local hard drive.

Monitoring
With operation code 2 you can determine the status of the enqueue server and the replication. This code can also be used by the HA software to monitor the enqueue server

and the replication server This operation code has the following return codes, which can be evaluated directly.
0: Everything O.K. The enqueue server is running, the replication server is active (provided it has been configured) 4: Warning: The enqueue server is running, the replication server has been configured (that is, parameters defined), but the replication server is still not active (possibly because of an error). 8: Error: ensmon cannot connect to the enqueue server. The cause may be a network problem or an enqueue server problem.

ensmon also uses this operation code to display the replication status in plain text.The enqueue server keeps this status internally. Depending on the current value of the replication status, ensmon delivers a new return code, which can be evaluated by the HA software. Possible statuses are:
Description of Replication Statuses Status Message Replication is disabled in server Replication is enabled in server, but no repl. server is connected Replication is enabled in server, repl. server is connected Still needs a copy of the repl. table Replication is enabled in server, repl. server is connected The state transfer is currently getting prepared Replication is enabled in server, repl. server is connected The state transfer is currently getting collected Meaning Replication mechanism is disabled: profile parameter enque/server/replication has value false. The replication mechanism is enabled (enque/server/replication = true), but no replication server is connected to the enqueue server. Return Value 0

The replication server has opened the connection to the enqueue server, but still has to request the state transfer. The replication server has requested the state transfer, but the enqueue server still has to prepare it.

The enqueue server has started collecting the data for transferring the state. At this moment the enqueue server cannot process any requests (but, because of its multithreaded architecture, the enqueue server can accept further requests and collect them in an internal queue). The enqueue server has transferred the state of the lock table to the replication

Replication is enabled in server, repl.

server is connected State transfer is sent, but still waiting for confirmation Replication is enabled in server, repl. server is connected, replication is active Replication is enabled in server, repl. server is connected, Shutdown command was sent to replication server Replication is enabled in server, repl. server is connected but the replication was suspended due to errors during state transfer

server, but is still waiting for confirmation that the state has arrived successfully. From this state lock table changes are already sent in further requests to the replication server. Replication functions as normal
0

The replication server has been shut down by the enqueue server.

Replication has the status "suspended"

The return code cannot be seen in the ensmon output. The value is stored (in UNIX) in the shell variable $?, and can be displayed with echo $?.

You can set ensmon to automatic or use it interactively. If you set If you set This is shown in the example below:

Example
When you enter ensmon pf=<profile>, you will get the following output: Try to connect to host binmain service sapdp54 Enqueue Server monitor main menu ================================ 1: Dummy request 2: Get replication information 3: Get a file from the enqueue server q: quit h: help ==> If you now enter the operation code 2, you will get: get replinfo request executed successfully

Replication is enabled in server, but no repl. server is connected =========================================================== = Information from the enqueue server side: ========================================= . . . . .

You might also like