- Este tópico contém 3 respostas, 2 vozes e foi atualizado pela última vez 18 anos, 7 meses atrás por
gustavodesa.
-
AutorPosts
-
21 de agosto de 2007 às 12:30 am #80281
souza
ParticipanteAlguém tem um exemplo pronto de “dbora” ou a instalação cria sozinha após a instalação da instância ?
21 de agosto de 2007 às 10:03 pm #80292gustavodesa
ParticipanteSegue abaixo o que eu utilizo em alguns clientes:
#!/bin/sh
#chkconfig: – 99 10
description: Oracle Database Server
processname: ora_
#
dbora This shell script takes care of starting and stopping
Oracle Database Server.
SUBSYS=/var/lock/subsys/dbora
dbora_init() {
# get ORACLE_HOME from the first entry,
# whose 3rd field is Y, in /etc/oratab.
if [ ! -f /etc/oratab ]
then
echo “auto startup/shutdown of Oracle: /etc/oratab does not exist.”
exit 1
fi
ORA_HOME=awk -F: '/^[^#:]+:.+:[Y]$/ { print $2; exit}' /etc/oratabif [ x$ORA_HOME = "x" ]; then echo "There is not Y entry in /etc/oratab." exit 1 fi # get oracle's owner from owner of dbstart. if [ ! -f $ORA_HOME/bin/dbstart ] then echo "auto startup/shutdown of Oracle: Oracle may not be installed" "correctly." exit 1 fi ORA_OWNER=`ls -l $ORA_HOME/bin/dbstart | awk '{print $3}'`}
case “$1” in
‘start’)
if [ -f $SUBSYS ]; then
echo $0 already started.
exit 1
fi
dbora_init
# Start the Oracle databases:
su – $ORA_OWNER -c “$ORA_HOME/bin/dbstart”
su – $ORA_OWNER -c “$ORA_HOME/bin/lsnrctl start”
# Start Intelligent Agent and Oracle Management Server
# — for Oracle9i —
# su – $ORA_OWNER -c “$ORA_HOME/bin/agentctl start”
# su – $ORA_OWNER -c “$ORA_HOME/bin/oemctl start oms”
# — for Oracle Database 10g —
# su – $ORA_OWNER -c “$ORA_HOME/bin/emctl start dbconsole”
# ——————–
# Start the Oracle HTTP Server
# This is a BUG workaround. $ORACLE_HOME/Apache/Jserv/etc
# /jserv.properties needs DISPLAY.
# test -z “$DISPLAY” && export DISPLAY=”:60000.0″
# su – $ORA_OWNER -c “$ORA_HOME/Apache/Apache/bin/apachectl start”
# ——————–
touch $SUBSYS
;;‘stop’)
if [ ! -f $SUBSYS ]; then
echo $0 already stopped.
exit 1
fi
dbora_init
# Stop Intelligent Agent
# — for Oracle9i —
# su – $ORA_OWNER -c “$ORA_HOME/bin/agentctl stop”
# — for Oracle Database 10g —
# su – $ORA_OWNER -c “$ORA_HOME/bin/emctl stop dbconsole”
# ——————–
# Stop the Oracle HTTP Server
# su – $ORA_OWNER -c “$ORA_HOME/Apache/Apache/bin/apachectl stop”
# ——————–
# Stop the Oracle databases:
su – $ORA_OWNER -c “$ORA_HOME/bin/lsnrctl stop”
su – $ORA_OWNER -c “$ORA_HOME/bin/dbshut”
rm -f $SUBSYS
;;‘restart’)
$0 stop
$0 start
;;‘status’)
if [ -f $SUBSYS ]; then
echo $0 started.
else
echo $0 stopped.
fi
;;
*)
echo “Usage: $0 {start|stop|status}”
exit 1
esacexit 0
21 de agosto de 2007 às 11:30 pm #80298souza
ParticipanteObrigado. Vou testar
21 de agosto de 2007 às 11:38 pm #80299gustavodesa
ParticipanteOk. Qualquer duvida estamos ai…
-
AutorPosts
- Você deve fazer login para responder a este tópico.