December 4, 2013

Shell script to bounce siebel server after incremental compile


Whenever you make changes to repository objects (SIFs) you will have to move the SRF to your dev environment.

The steps we follow are:
    - Compile your objects on top of the latest SRF from server
    - Stop Siebel Server
    - Stop Gateway Name Server
    - Move your new SRF
    - Start Gateway Name Server
    - Start Siebel Server
    - Run genbsrcipt utility

Below is the shell script that helps you to do the above tasks in a single shell script. Save it as .sh (SIEBEL_STOP_MOVESRF_START.sh) file.
- CHANGE THE PATHS ACCORDINGLY

Here are the steps you need to follow:
1) Copy latest SRF from server(/siebsrvr/objects/enu) into your machine.

2) Compile your objects on top of that.

3) Place the compiled SRF in /u01/SRF folder. If you are using folder with different name make sure you update the variable "SRF_DIR" in the script. DO NOT MISS THIS!

4) Run SIEBEL_STOP_MOVESRF_START.sh
    - Stops Siebel Server
    - Stops Gateway Name Server
    - Takes the backup of existing SRF (/u01/Siebel_8.2.2/siebsrvr/objects/enu) (Renames to siebel_sia_YYYY_MM_DD_hh_mm.srf)
    - Copies latest SRF from "/u01/SRF" to "/u01/Siebel_8.2.2/siebsrvr/objects/enu"
    - Starts Gateway Name Server
    - Starts Siebel Server
    - Runs genbsrcipt utility
    - Deletes the SRF from SRF_DIR


#####################################################

#! /bin/bash

# CONSTANTS
ROOT="/u01"
//location where you place your compiled SRF
SRF_DIR="/u01/SRF"

//SRF directory
SBL_SRF_DIR="/u01/Siebel_8.2.2/siebsrvr/objects/enu"

//Siebel server
SBL_SRVR="/u01/Siebel_8.2.2/siebsrvr"
SBL_BIN="/u01/Siebel_8.2.2/siebsrvr/bin"

//Web server
SBL_WS="/u01/app/oracle/mwhome_1/Oracle_WT1/opmn/bin"

//Gateway server
SBL_GW="/u01/Siebel_8.2.2/gtwysrvr"
SBL_GW_BIN="/u01/Siebel_8.2.2/gtwysrvr/bin"

echo "Stopping Webserver"
cd $SBL_WS
./opmnctl stopall

echo "Setting up Siebel environment"
cd $SBL_SRVR
. ./siebenv.sh

echo "Stopping Siebel Server" 
cd $SBL_BIN
stop_server all

echo "Setting up Gateway Name Server environment"
cd /u01/Siebel_8.2.2/gtwysrvr
cd $SBL_GW
. ./siebenv.sh 

echo "Stopping Gateway Name Server" 
cd /u01/Siebel_8.2.2/gtwysrvr/bin 
cd $SBL_GW_BIN
stop_ns 

echo "Killing additional Siebel processes" 
pkill -9 -f Siebel

echo "Waiting for 60 Seconds for Siebel Server to shut down completely"
sleep 60

#### Set Date and Time Stamp into File Names ####
DATE_TIME=`date +%Y_%m_%d_%H_%M`

# Migration of SRF file
cd $ROOT
chmod 777 SRF
echo "Full permissions given to SRF folder"

cd $SBL_SRF_DIR
echo "Renaming old SRF file"
mv siebel_sia.srf siebel_sia_$DATE_TIME.srf

echo "Copying new SRF file"
cp $SRF_DIR/siebel_sia.srf $SBL_SRF_DIR/siebel_sia.srf

echo "Waiting for 10 Seconds before starting the services"
sleep 10

echo "Setting up Gateway Name Server environment"
cd /u01/Siebel_8.2.2/gtwysrvr
cd $SBL_GW
. siebenv.sh

echo "Starting Gateway Name Server"
cd /u01/Siebel_8.2.2/gtwysrvr/bin
cd $SBL_GW_BIN
start_ns

echo "Setting up Siebel environment"
cd /u01/Siebel_8.2.2/siebsrvr
cd $SBL_SRVR
. siebenv.sh

echo "Starting Siebel Server"
cd /u01/Siebel_8.2.2/siebsrvr/bin
cd $SBL_BIN
start_server all

echo "Generating browser scripts"
./genbscript "/u01/Siebel_8.2.2/siebsrvr/bin/enu/publicsector.cfg" /u01/Siebel_8.2.2/siebsrvr/webmaster

echo "Starting Webserver"
cd $SBL_WS
./opmnctl startall

echo "Removing SRF file from SRF_DIR"
cd $SRF_DIR
rm siebel_sia.srf

echo "Please wait for a few minutes for the Siebel server to startup"

#####################################################

2 comments:

  1. Hi,
    I'm looking for a batch script file which can compile siebel objects incrementally. i.e. we have a excel where users enter their respective objects like BC,Applet etc. for incremental compilation. batch file should take the object's name from that excel file and compile them on incrementally on server SRF and replace the SRF in server,

    could you please help me with this ?

    Thanks,
    Vivek Mishra

    ReplyDelete
  2. i think there is no way to automate the incremental compilation. you can defiantly compile the full repo

    ReplyDelete