0 Votes

Startup

Last modified by Jeff McDonald on 2021/11/17 07:34

Here's a sample startup script...

Call it "oracle" and place it in the /etc/init.d directory.

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.

ORACLE_BASE="/home/oracle/app/oracle"
ORACLE_HOME="/home/oracle/app/oracle/product/12.1.0/dbhome_1"
ORACLE_SID="ora12c"
ORACLE_HOME_LISTNER=$ORACLE_HOME

export PATH=$ORACLE_HOME/bin:$PATH

case "$1" in
    'start')
          su - oracle -c  "nohup $ORACLE_HOME/bin/dbstart $ORACLE_HOME > /tmp/startup.log 2>&1 &"
       ;;
    'stop')
       su - oracle -c  "nohup $ORACLE_HOME/bin/dbshut $ORACLE_HOME > /tmp/shutdown.log 2>&1 &"
        ;;
esac

Enable it with:

sudo chkconfig oracle on