Wednesday, May 8, 2013

Automatic startup and shutdown Oracle R12 on Linux


Automatic start up and shutdown Oracle EBS R12 on Linux
After installation on Linux, when the server restarted, the application will not started automatically.
 To start the application automaticaly, we need to create some scripts.

1. startDB.sh :to start the database,using oracle database user, create a file containing this script:

#! /bin/sh
. /oracle/VIS/db/tech_st/10.2.0/VIS_hostname.env
/oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addbctl.sh start
/oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addlnctl.sh start VIS

Then save it as startDB.sh.

2. stapDB.sh to stop the database using this script:
#! /bin/sh
. /oracle/VIS/db/tech_st/10.2.0/VIS_hostname .env
/oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addbctl.sh stop
/oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addlnctl.sh stop VIS
Then save it as stopDB.sh


3. startAPP.sh To start application use this script as applmgre:
#! /bin/sh
. /oracle/VIS/apps/apps_st/appl/VIS_hostname.env
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
Then save it as startApps.sh

4.stopAPP.sh To stop application, use this script:
#! /bin/sh
. /oracle/VIS/apps/apps_st/appl/VIS_hostname.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps

5. As root, create a file on /etc/init.d named startVIS containing this script:
#! /bin/sh
#
# /etc/init.d/R12_VIS
#

### BEGIN INIT INFO
# Provides: Oracle Applications
# Required-Start: $syslog $network $xvfbserver
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the Oracle Applications server
### END INIT INFO

case "$1" in
start)
su oracle -c "/home/oracle/startDB.sh"
su applmgr -c "/home/applmgr/startAPP.sh"
#rc_status -v
;;
stop)
su applmgr -c "/home/applmgr/stopAPP.sh"
su oracle -c "/home/oracle/stopDB.sh"
#rc_status -v
;;

*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

6.to add startVIS to the services list. Use this command as root:
chkconfig --add startVIS

1 comment:

  1. Thanks for your scripts, but i found some problems implementing them, I would suggest:
    1) In stopDB.sh change /oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addbctl.sh stop
    with
    /oracle/VIS/db/tech_st/10.2.0/appsutil/scripts/VIS_oracle/addbctl.sh stop immediate

    2) In case of some linux the chkconfig --add startVIS is not enough to make the server to execute the script at shutdown, i found that in oracle linux o redhat you had to have a lock file in /var/lock/subsys in order to have the script runt at shutdown, so in startVIS it should be added a touch /var/lock/subsys/startVIS in case of start, and in case of stop a rm -r /var/lock/subsys/startVIS

    regards

    ReplyDelete