RE: Linux monitoring

RE: Linux monitoring

 

  

Sure.

My setup has the apcupsd daemon running on the linux box and a windows
client on the windows box.

All you need to do is put the oracle stop/start scripts in /etc/init.d, link
to them from rc5.d directory:

ln -s /etc/init.d/oracle /etc/rc5.d/K00oracle
ln -s /etc/init.d/oracle /etc/rc5.d/S99oracle

ls -l /eytc/rc5.d/*oracle
lrwxrwxrwx 1 root root 18 Jun 11 16:16 K00oracle -> /etc/init.d/oracle
lrwxrwxrwx 1 root root 18 Jun 11 16:16 S99oracle -> /etc/init.d/oracle

The K scripts are run at shutdown, the S scripts are run at startup. They
are run in order, so K00 will be the first one during the shutdown process
and S99 will be the last one during startup.

/etc/init.d/oracle (for me) is:
--- start
#!/bin/bash
#

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

# Source networking configuration.
. /etc/sysconfig/network

ORACLE_HOME=/opt/oracle/920
RETVAL=0

start() {
# Start daemons.
echo -n "Starting ORACLE: "
su oracle -c "export ORACLE_HOME=$ORACLE_HOME;
$ORACLE_HOME/bin/dbstart;\
$ORACLE_HOME/bin/lsnrctl start"

RETVAL=$?
if [ "$RETVAL" != "0" ]; then
echo_failure
else
echo_success
fi
echo
return $RETVAL
}

stop() {
# Stop daemons.
echo -n "Shutting down ORACLE: "
su oracle -c "export ORACLE_HOME=$ORACLE_HOME;\
$ORACLE_HOME/bin/dbshut;\
$ORACLE_HOME/bin/lsnrctl stop"
RETVAL=$?
if [ "$RETVAL" != "0" ]; then
echo_failure
else
echo_success
fi

echo
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: oracle {start|stop}"
exit 1
esac

exit $?
--- end

You /etc/init.d/oracle may differ because you're running 10g, but everything
else will be the same.

Regards,
Jack Parker
-----Original Message-----
From: Jesse
[mailto:oracledba-ezmlmshield-x27283818.[Email address protected]
Sent: Saturday, September 02, 2006 11:25 AM
To: LazyDBA Discussion
Subject: Linux monitoring


Hi,



I want to manage my red hat linux box through UPS (APC) software installed
on a windows box. In the event of power breakdown, I want it to shutdown
database first (oracle 10g).



Can anyone assist.



regds



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



Oracle LazyDBA home page