проверено на RHEL 5.1-5.2 и CentOS 5.1-5.2
% cat /etc/init.d/oracle
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/orahome11/11.1.0/db_1"
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
restart)
$0 stop
$0 start
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop|restart}"
esac
% cat /etc/init.d/oraemctl
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/orahome11/11.1.0/db_1"
case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
restart)
$0 stop
$0 start
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop|restart}"
esac
Комментариев нет:
Отправить комментарий