LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 08-05-2007, 12:39 PM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 504

Rep: Reputation: 31
Question startup script not working in RHEL 4


Dear Friends,
I have to use the follwoing script for auto startup oracle database in my Redhat ent. 4 server , but its not working . I have to keep it into the follwoing directory :

"/etc/rc.d/"
"/etc/rc.d/init.d/"
"/etc/rc.d/rc3.d/"
"/etc/rc.d/rc5.d/"
and give the permission 755 & also change the follwing :

vi /etc/oratab

*:/u01/app/oracle/product/10.2.0/db_1:y
orcl:/u01/app/oracle/product/10.2.0/db_1:y

And . my oracle .bash_profile is the following :

##################bash_profile#################################
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH "


###############SCRIPTS#############################

#!/bin/sh
#
# Startup script for the Newton Application
#
# chkconfig: 345 56 50
# description: Starts/Stops the Oracle DB, the Oracle Listener,
# the Cobol Licence Manager and the Newton Tuxedo Servers.

# Source function library.
. /etc/rc.d/init.d/functions

# Used variables
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
DBSTART=$ORACLE_HOME/bin/dbstart
DBSHUT=$ORACLE_HOME/bin/dbshut
LSNRCTL=$ORACLE_HOME/bin/lsnrctl
RETVAL=0

startora()
{
echo -n $"Starting Oracle DB: "
daemon --user oracle $DBSTART
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/oradb
return $RETVAL

startlsnr()
{
echo -n $"Starting Oracle Listener: "
daemon --user oracle $LSNRCTL start
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/oranet
return $RETVAL
}

stoplsnr()
{
echo -n $"Stopping Oracle Listener: "
daemon --user oracle $LSNRCTL stop
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/oranet
return $RETVAL
}

stopora()
{
echo -n $"Stopping Oracle DB: "
daemon --user oracle $DBSHUT
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/oradb
return $RETVAL
}

# See how we were called.
case "$1" in
start)
startora
startlsnr
;;
stop)
stoplsnr
stopora
;;
restart)

stoplsnr
stopora
startora
startlsnr
;;
*)
echo $"Usage: $prog {start|stop|restart}"
exit 1
esac

exit $RETVAL
##########################################################

plz give me some suggestions .............
 
Old 08-05-2007, 05:44 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
its not working
What does it say? If nothing, maybe run as "sh -x /path/to/script 2>&1 | tee /tmp/script.log".
 
Old 08-05-2007, 08:28 PM   #3
misconfiguration
Member
 
Registered: Apr 2007
Location: Indianapolis, Indiana
Distribution: RHEL, Fedora, AIX, HP-UX, FreeBSD, Slackware
Posts: 62

Rep: Reputation: 19
chkconfig <script_name> on
 
Old 08-09-2007, 01:13 PM   #4
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
I have a small oracle RAC cluster running here on RHEL4.5, I didn't build it, but if you need the content of any files, just ask me.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add applicaton/s in startup using RHEL cjagdish69 Linux - Newbie 3 04-24-2007 07:10 AM
Startup script not working in rc.local crackerB Linux - Software 9 10-09-2006 07:55 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration