LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2008, 01:46 AM   #1
Anshul Pathak
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Oracle boot time startup


I know how to startup Oracle database(connect sys as sysdba with sqlplus; startup; ) but I can do this only manually. What I want is to put this into a script that runs when the server boots. If the server is rebooted I have to manually start the database and I want to make a script to do that for me.
 
Old 12-16-2008, 08:16 AM   #2
Uxinn
Member
 
Registered: May 2008
Location: Iceland
Distribution: Ubuntu Hardy
Posts: 47

Rep: Reputation: 16
$ORACLE_HOME/bin/dbstart and dbshut are scripts to start and stop the database
they will also stop and start the tns listener.

You might want to make sure that the dbshut scripts uses "shutdown immediate" instead of shutdown, because that can take forever on busy databases.

Here is a script i snatched, and only needs the correct owner and path to work
and if you are running redhat you can copy the scipt to /etc/init.d and run /sbin/chkconfig --add <script_name>


Code:
#!/bin/sh
# chkconfig: 35 99 10
# description: Oracle auto start-stop script.
#
# Set ORACLE_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORACLE_OWNER to the user id of the owner of the
# Oracle database in ORACLE_HOME.
ORACLE_HOME=/oracle/product/10g
ORACLE_OWNER=oracle
export ORACLE_HOME ORACLE_OWNER
if [ ! -f ${ORACLE_HOME}/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - ${ORACLE_OWNER} -c
'ORACLE_HOME_LISTNER=$ORACLE_HOME;${ORACLE_HOME}/bin/dbstart
${ORACLE_HOME}';ret=$?
if ((ret==0))
then
echo "OK"
else
echo "FAILED"
fi
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - ${ORACLE_OWNER} -c
'ORACLE_HOME_LISTNER=$ORACLE_HOME;${ORACLE_HOME}/bin/dbshut
${ORACLE_HOME}';ret=$?
if ((ret==0))
then
echo "OK"
else
echo "FAILED"
fi
;;
esac
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql startup at boot time tekmann33 Linux - Software 2 06-19-2007 01:46 AM
hot to auto start oracle application server on Redhat AS3 at the boot time procfs Linux - Software 2 05-23-2007 12:42 AM
Help...Kicker Failed at boot time. KDE startup not complete. swamprat SUSE / openSUSE 3 02-04-2007 11:01 AM
How to avoid pppoe connection automatically startup at boot time in UBUNTU? kevin_chn Ubuntu 4 01-01-2007 12:29 AM
make a deamon startup at boot time kernelvn Fedora 4 10-20-2004 07:50 PM


All times are GMT -5. The time now is 12:57 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration