Configuring the SAPWebAS preonline script

In a clustered environment, the SAP administrator installs and configures SAP Enqueue and SAP Enqueue Replication Server. SAP Enqueue and Enqueue Replication Server have the following requisites:

The SAPWebAS preonline script facilitates proper Enqueue server failover behavior. The existing VCS preonline script calls the SAPWebAS preonline script.

The SAPWebAS preonline script performs the following tasks:

To accomplish this failover behavior, you must configure the VCS preonline script.

The VCS preonline trigger calls an external preonline trigger utility - sapwebaspreonline.exe. The initiated preonline trigger performs the steps necessary for correct failover behavior of the Enqueue servers. The sapwebaspreonline.exe utility is located in the %VCS_HOME%\bin\SAPWebAS directory.

To configure SAPWebAS preonline script

  1. Go to the %VCS_HOME%\bin\Trigger directory.
  2. Skip this step if the preonline file exists in this directory.

    If the preonline file does not exist, copy the sample preonline trigger file from the %VCS_HOME%\bin\Sample_Triggers directory to the %VCS_HOME%\bin\Triggers directory, rename the file to preonline, and then use this file.

  3. Add the following lines to the preonline file:
    #--------------------------------------------------------------
    # Start sapwebas preonline trigger.
    #--------------------------------------------------------------
    # Perl preonline.pl <system> <group> <whyonlining> 
    <systemwheregroupfaulted>
    my $system = $ARGV[0];
    my $group = $ARGV[1];
    my $whyonlining = $ARGV[2];
    my $systemwheregroupfaulted = undef;
    my $sArgs = join(' ', @ARGV);
    VCSAG_LOG_MSG("I", "Arguments [$sArgs]", 15041);
    if(defined $ARGV[3]) {
    	$systemwheregroupfaulted = $ARGV[3];
    }
    my $SAPWebASPreOnlineTrigger = sprintf("%s\\bin\\SAPWebAS\\
    sapwebaspreonline.exe", $vcs_home);
    VCSAG_LOG_MSG("I", 
    "The trigger command is [$SAPPreOnlineTrigger]", 15041);
    if(defined $systemwheregroupfaulted)
    {
    	VCSAG_LOG_MSG("I", "The group is faulted on syetem =
    [$systemwheregroupfaulted]", 15042);
    	$CMD = sprintf("\"%s\" %s %s %s %s", $SAPWebASPreOnlineTrigger,
    	$system, $group, $whyonlining, $systemwheregroupfaulted);
    }
    else {
    	$CMD = sprintf("\"%s\" %s %s %s", $SAPWebASPreOnlineTrigger, 
     $system, $group, $whyonlining);
    }
    system($CMD);
    my $exit_value = $? >> 8;
    VCSAG_LOG_MSG("I", "The exit code from the trigger: [$exit_value].",
     15046, $exit_value);
    if($exit_value == 0) {
    	VCSAG_LOG_MSG("I", "The PreOnline Trigger for SAP executed 
    successfully.", 15046);
    	exit;
    }
    elsif($exit_value == 1) {
    	VCSAG_LOG_MSG("I", "The PreOnline Trigger for SAP FAILED.", 15047);
    	exit;
    }
    else {
    	VCSAG_LOG_MSG("I", "Unknown PreOnline trigger.", 15048);
    }
    #--------------------------------------------------------------
    # End sapwebas preonline trigger.
    #--------------------------------------------------------------
    .
    .
    # give control back to HAD.
    if (defined $ARGV[3]) {
    	'\"$vcs_home\\bin\\hagrp\" -online -nopre $ARGV[1] -sys $ARGV[0] 
    -checkpartial $ARGV[3]';
    	exit;
    }
    
    '\"$vcs_home\\bin\\hagrp\" -online -nopre $ARGV[1] -sys $ARGV[0]';
    exit;
    
    
  4. Use the following command to set the preonline trigger attribute to true for the Service Groups to which the Enqueue and Enqueue Replication server instances belongs:

    C:\> hagrp -modify service_group PreOnline 1 -sys system

The preonline script is now configured to facilitate Enqueue and Enqueue Replication server behavior. You can view the logs in the VCS engine log, engine_A.log.

Note:

Once the preonline trigger is configured, you may see unexpected behavior while manually switching or performing online operations on the Enqueue Replication service group. This behavior is a result of the control logic within the preonline trigger that protects the Enqueue lock table. For system maintenance, if you prefer to perform manual operations on the service groups, you can do so by disabling the preonline trigger.

To disable the preonline trigger, use the following command:

C:\> hagrp -modify service_group PreOnline 0 -sys system