Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: starting and stopping Database 10g on SuSE linux 9.3 Professional

Re: starting and stopping Database 10g on SuSE linux 9.3 Professional

From: <fitzjarrell_at_cox.net>
Date: 6 May 2005 05:54:34 -0700
Message-ID: <1115384074.274049.255100@g14g2000cwa.googlegroups.com>

Tamer Higazi wrote:
> Hi!
> I have installed Oracle 10g RDBMS on SuSE Linux 9.3 Professional with

> start / stop scripts. But I dont understand something...
>
> How do I start up the database itself?
>
> After I have runed up the Enterprise Manager from Oracle 10g, and I
> loaded the Oracle10 em, from the browser, the page displayed that I
have
> to enter a user id (on both fields) with password to fireup the DB.
>
> Which username and password is from me required?!
>
>
>
> Tamer Higazi

As my crystal ball is still in the shop for repairs my guessing ability is somewhat limited, however I expect your 'start / stop scripts' would be dbstart and dbshut. These, of course, by themselves will not automatically start your instance at boot. You'll need another script, located in /etc/init.d and referenced in /etc/rc3.d, to actually start and stop the instance at system boot/shutdown. Such a script is provided below:

#!/bin/sh
# /etc/init.d/dbora - database startup/shutdown
#

ORACLE_BASE=/oralinux/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/9.2.0
ORACLE_SID=dev9z

ORACLE=oracle
#

LOG=$ORACLE_HOME/startup.log
OLD_LOG=$ORACLE_HOME/startup_log.`date +%y%m%d%H%M`
#

ALRT_LOG=$ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_dev9z.log OLD_ALRT_LOG=$ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_dev9z_log.`date +%y%m%d%H%M`
#

LSNR_LOG=$ORACLE_HOME/network/log/listener.log OLD_LSNR_LOG=$ORACLE_HOME/network/log/listener_log.`date +%y%m%d%H%M`
#

touch $LOG
chmod a+r $LOG
#

case "$1" in
'start')
#
# save the old logs and startup the databases
#

  echo "********** $0: Closing out startup log, new log being started

**" >> $LOG
  mv $LOG $OLD_LOG
  chown $ORACLE $OLD_LOG
  echo "********** $0: Starting up Oracle processes . . ." >> $LOG   date >> $LOG
  echo "********** Closing out RDBMS logs . . ." >> $LOG   su - $ORACLE -c "mv $ALRT_LOG $OLD_ALRT_LOG" >> $LOG   su - $ORACLE -c "$ORACLE_HOME/bin/dbstart" >> $LOG 2>&1
#
# start listener last
#

  if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
  then
    echo "********** Closing out listener log . . ." >> $LOG     su - $ORACLE -c "mv $LSNR_LOG $OLD_LSNR_LOG" >> $LOG     echo "********** Starting listener . . ." >> $LOG     su - $ORACLE -c "$ORACLE_HOME/bin/lsnrctl start" >> $LOG 2>&1   fi
  ;;
'stop')
  echo "********** $0: Stopping Oracle processes . . ." >> $LOG   date >> $LOG
#
# stop the listener first
#

  if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
  then
    echo "********** Stopping listener . . ." >> $LOG     su - $ORACLE -c "$ORACLE_HOME/bin/lsnrctl stop" >> $LOG 2>&1   fi
  echo "********** Shutting down Oracle databases . . ." >> $LOG   su - $ORACLE -c "$ORACLE_HOME/bin/dbshut" >> $LOG 2>&1   ;;
*)
  echo "ERROR - bad parameter" >> $LOG
  echo "Usage: dbora [start | stop]" >> $LOG   exit
  ;;
esac
#
# end of script
#

exit

This should be placed in the /etc/init.d directory (this requires root permissions and a basic understanding of vi):

cd /etc/init.d
vi dbora
<paste the text from this post into your file> <change the definitions of ORACLE_BASE, ORACLE_HOME, ORACLE and ORACLE_SID to match those of your installation> :wq!

chmod 755 dbora

Create symbolic links to this script as S99dbora and K03dbora using the ln -s command:

cd ../rc2.d
ln -s ../init.d/dbora S99dbora
ln -s ../init.d/dbora K03dbora

Once this is complete the database should start at system boot and stop at a system shutdown with no additional intervention. Of course, you need to test your dbstart and dbshut scripts to ensure they function properly; running 9.2.0.6 on Solaris I found I needed to edit the dbshut and dbstart scripts, commenting the PFILE assignment lines, to get them to work properly.

I hope this helps.

David Fitzjarrell Received on Fri May 06 2005 - 07:54:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US