LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 09-17-2003, 05:48 AM   #1
linux_pioneer
Member
 
Registered: May 2003
Distribution: Solaris 10, Solaris 8.0, Fedora Core 3
Posts: 203

Rep: Reputation: 30
Oracle 9i Start Up Script w/ Redhat 9


I'm running redhat 9 and installed Oracle 9i release 2. I need a start up script so the database and listeners start up everytime I boot up. I've tried a few but get errors each time. Does anyone know of a good start up script for redhat 9 and Oracle 9i R2?

Here is what I've tried:
#!/bin/bash
#
# starts and stops oracle 9i database, listener & http server
# fix kernel parameters for oracle

#oracle environment
export ORACLE_HOME=/opt/app/oracle/product/9.2
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export NLS_LANG='american_america.we8iso8859p2'
export ORACLE_SID=ora9ip

export DISPLAY=:0
oracle_user=oracle

case $1 in
start)
# fix kernel parameters
echo 250 32000 100 128 > /proc/sys/kernel/sem
echo 536870912 > /proc/sys/kernel/shmmax
echo 4096 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 65536 > /proc/sys/kernel/fs/file-max
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range

# start listener, apache and database
su - "$oracle_user"<<EOF
lsnrctl start
apachectl start
sqlplus /nolog<<EOL
connect / as sysdba
startup
EOL
EOF
;;

stop)
# stop listener, apache and database
su - "$oracle_user"<<EOF
lsnrctl stop
apachectl stop
sqlplus /nolog<<EOL
connect / as sysdba
shutdown immediate
EOL
EOF
;;

*)
echo "Usage: ora9ip [start|stop]"
;;

esac

and I've also tried this one:

#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance

ORA_HOME="/u01/app/oracle/product/9.2.0.1.0"
ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0

The 1st gives me a few compiler errors. This second one gives me the Usage error saying that it does not understand the parameter that rh9 is giving it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to start oracle 10g jakkals Linux - Software 6 07-24-2005 09:28 AM
Oracle Start Up Script linux_pioneer Linux - Software 1 09-16-2003 05:44 AM
Oracle Startup Script linux_pioneer Linux - Software 0 09-15-2003 07:55 PM
Auto Start Script for Oracle sikandar Linux - Software 0 09-12-2003 10:43 PM
init to Start Oracle GAVollink Linux - Software 0 08-18-2003 03:41 PM


All times are GMT -5. The time now is 03:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration