Operating System - HP-UX
1753797 Members
6872 Online
108799 Solutions
New Discussion юеВ

Re: Init scripts for Oracle startup/shutdown on reboot

 
SOLVED
Go to solution
Yogeeraj_1
Honored Contributor

Re: Init scripts for Oracle startup/shutdown on reboot

hello,

this is how i do it!

1. in /sbin/init.d
file oracle
(see attachment)

2. Create links to look as below:
yd: /sbin>ll rc*/*oracle*
lrwxr-xr-x 1 root sys 19 Dec 16 2001 rc1.d/K100oracle -> /sbin/init.d/oracle
lrwxr-xr-x 1 root sys 19 Dec 16 2001 rc2.d/S900oracle -> /sbin/init.d/oracle


3. Config file
yd: /etc/rc.config.d>more oracle
#YD/CMT-16/12/2001
# ORACLE DATABASE configuration
#
# ORACLE_START_STOP : Set to 1 to start ORACLE DATABASE
#
ORACLE_START_STOP=1
yd: /etc/rc.config.d>


Hope this helps!

best regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
pc123_1
Frequent Advisor

Re: Init scripts for Oracle startup/shutdown on reboot

Thank you!
I will try your script and update you on the results.
Steven E. Protter
Exalted Contributor

Re: Init scripts for Oracle startup/shutdown on reboot

You might find this utility useful as well.

It determines your first /etc/oratab database marked Y(auto start), you need to have /etc/oratab set up with a Y flag or the standard dbstart script won't start anything.

This guy if run . /usr/contrib/bin/oracle.default

It will set an very useful environment variable. Name it what you want by changing the script, but it is very useful so your backup and startup scripts know what the boxes primary database is. If you have a primary databse. Most useful on our prod box, which we switch instances every time we put a new deliverable into production. This methodoloy aids in testing.

code of oracle.default

#!/usr/bin/sh

# oracle.info A script to get oracle instance and other information
# from the first entry on the /etc/oratab file
#
# Created: Shmuel Y. Protter
# 05-29-2002
# Modifications
# FML MM-DD-YYYY Description of the changes ......
#
#
#



# if [ "$LOGNAME" = "oracle" ]
# then
# oktorun="Y"
# echo "User oracle detected"
# fi

# if [ "$LOGNAME" = "oraoper" ]
# then
# oktorun="Y"
# echo "User oraoper detected"
# fi

# if [ "$oktorun" = "Y" ]
# then
# echo "user is authorized...$LOGNAME"
# else
# echo "user must be oracle or oraoper: $LOGNAME"
# exit 1
# fi

SetOptions=$-
set +u

export ORATAB=/etc/oratab; [ -f $ORATAB ] ||
export ORATAB=/var/opt/oracle/oratab


sidfile=/utmp/sids.file

# awk -F: '/^[^#*]+:/ {print $1 " " $3}' $ORATAB > $sidfile
# awk -F: '/^[^#*]+:/ {print $1}' $ORATAB > $sidfile

inum=1

cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;;#comment-line in oratab
*)

if [ "`echo $LINE | awk -F: '/^[^#*]+:/ {print $3}' -`" = "Y" ] ; then
if [ $inum -eq 1 ]
then
ORA_INSTANCE=`echo $LINE | awk -F: '{print $1}' -`
ORA_HOME=`echo $LINE | awk -F: '{print $2}' -`
# echo "checking oracle sid: $ORA_INSTANCE "
# echo "checking oracle hme: $ORA_HOME "
export ORA_INSTANCE
export ORA_HOME
fi
# /usr/contrib/bin/shutsid.sh $ORACLE_SID
((inum = inum + 1 ))
fi


esac

done
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com