Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 701526 Details for
Bug 914890
oracle init script is pitiful and deviates from excepted paths
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Heavily modified initscript
oracle (text/plain), 4.06 KB, created by
matthew patton
on 2013-02-23 08:46:06 UTC
(
hide
)
Description:
Heavily modified initscript
Filename:
MIME Type:
Creator:
matthew patton
Created:
2013-02-23 08:46:06 UTC
Size:
4.06 KB
patch
obsolete
>#!/bin/bash ># ># Run-level Startup script for the Oracle Instance and Listener ># ># chkconfig: 2345 75 25 ># description: Startup/Shutdown Oracle listener and instance ># ># rewritten by Matt Patton (2/23/2012) > >: ${RUNAS:="oracle"} >: ${ORATAB:=/etc/oratab} >SQLDBA="sqlplus /nolog" > >ORA_LISTENER_NAME="Oracle Listener" >ORA_INSTANCE_NAME="Oracle DB instance" > ># NOTE! ># All log files belong in '/var/log/rhn/oracle/'. ># Configure suitable sym-links or use native directives. ># ># TODO: grab from LOG_<DIRECTORY|FILE>_<listener> in $ORACLE_HOME/network/admin/listener.ora >_LOG_START=ORACLE_HOME/dbs/logs/startup.log >_LOG_STOP=ORACLE_HOME/dbs/logs/shutdown.log >LOG_ALERT="logger -pdaemon.alert -s " >LOG_FAC=daemon > >. /etc/init.d/functions > >LOCKFILE=/var/lock/subsys/${0##*/} > ># taken from the original Oracle dbstart/dbstop ># Set path if path not set (if called from /etc/rc) >if [ $PATH == "" ]; then > PATH=/bin:/usr/bin:/etc > export PATH >fi > >SAVE_LDLIBPATH=$LD_LIBRARY_PATH > > >startdb() { > while read ORACLE_SID ORACLE_HOME; do > [ "$ORACLE_SID" = '*' ] && continue > > export ORACLE_HOME > export ORACLE_SID > export PATH=$ORACLE_HOME/bin:/bin:/usr/bin: > export LD_LIBRARY_PATH=${SAVE_LDLIBPATH}:${ORACLE_HOME}/lib > eval LOG_START=\$$_LOG_START > > # start Oracle listener > # TODO: parse out $ORACLE_SID.world from 'lsnrctl status' output > if ! /sbin/pidof tnslsnr >/dev/null; then > echo -n "Starting $ORA_LISTENER_NAME ..." > $ORACLE_HOME/bin/lsnrctl start &>/dev/null > RET_LIST=$? > [ $RET_LIST -eq 0 ] && echo_success || echo_failure > echo > # TODO: deal with the 'else' case > fi > > # start Oracle instances > echo -n "Starting $ORA_INSTANCE_NAME \"$ORACLE_SID\" ..." > > # check for running instance > if /sbin/pidof pmon_$ORACLE_SID >/dev/null; then > logger -p ${LOG_FAC}.warn -s "$ORA_INSTANCE_NAME $ORACLE_SID already running." > $SQLDBA &>> $LOG_START <<EOF >connect / as sysdba >shutdown abort >quit >EOF > fi > > $SQLDBA &>> $LOG_START <<EOF >connect / as sysdba >startup >quit >EOF > RET=$? > [ $RET -eq 0 ] && echo_success || { > echo_failure > logger -p ${LOG_FAC}.err -s "$ORA_INSTANCE_NAME $ORACLE_SID failed startup." > } > echo > done <<< `awk -F: '/:Y$/ { print $1, $2}' $ORATAB` > > return $(($RET || $RET_LIST)) >} > > >stopdb() { > while read ORACLE_SID ORACLE_HOME; do > [ "$ORACLE_SID" = '*' ] && continue > > export ORACLE_HOME > export ORACLE_SID > export PATH=$ORACLE_HOME/bin:/bin:/usr/bin: > export LD_LIBRARY_PATH=${SAVE_LDLIBPATH}:${ORACLE_HOME}/lib > eval LOG_STOP=\$$_LOG_STOP > > echo -n "Shutting down $ORA_LISTENER_NAME ..." > $ORACLE_HOME/bin/lsnrctl stop &>/dev/null > RET_LIST=$? > [ $RET_LIST -eq 0 ] && echo_success || echo_failure > echo > > echo -n "Shutting down $ORA_INSTANCE_NAME \"$ORACLE_SID\" ..." > $SQLDBA &>> $LOG_STOP <<EOF >WHENEVER SQLERROR EXIT FAILURE >connect / as sysdba >shutdown immediate >quit >EOF > RET=$? > [ $RET -eq 0 ] && echo_success || echo_failure > echo > done <<< `awk -F: '/:Y$/ { print $1, $2}' $ORATAB` > > return $(($RET || $RET_LIST)) >} > > >statusdb() { > # print status of the Net Listener > status "tnslsnr" | sed "s/tnslsnr/$ORA_LISTENER_NAME/" > > # loop over all known instances > while read ORACLE_SID ORACLE_HOME; do > [ "$ORACLE_SID" = '*' ] && continue > > # print status of the DB instance > status "ora_pmon_$ORACLE_SID" | sed "s/ora_pmon_$ORACLE_SID/$ORA_INSTANCE_NAME $ORACLE_SID/" > done <<< `awk -F: '/:Y$/ { print $1, $2}' $ORATAB` >} > > ># depending on parameter -- startup, shutdown, restart ># of the instance and listener or usage display > >case "$1" in > start) > runuser - $RUNAS $0 startdb > [ $? -eq 0 ] && touch $LOCKFILE > ;; > stop) > runuser - $RUNAS $0 stopdb > [ $? -eq 0 ] && rm -f $LOCKFILE > ;; > startdb) > [ $RUNAS == `whoami` ] && startdb > ;; > stopdb) > [ $RUNAS == `whoami` ] && stopdb > ;; > status) > statusdb > ;; > reload|restart) > $0 stop > $0 start > ;; > condrestart) > [ -f $LOCKFILE ] && $0 restart || : > ;; > *) > echo "Usage: $0 start|stop|status|restart|reload" > exit 1 >esac >exit 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 914890
: 701526