<div dir="ltr">Dear David<br><br>How can I add to the script also these command as oracleas to stop ans start iAS<br><br>"Starting Oracle iAS"<br>su - oracleas<br>$OH/opmn/bin/opmnctl startall<br>$OH/bin/emctl start iasconsole<br>
<br>"Stopping Oracle iAS"<br>su - oracleas<br>$OH/dcm/bin/dcmctl shutdown<br>$OH/opmn/bin/opmnctl stopall<br><br><br><div class="gmail_quote">On Fri, Aug 29, 2008 at 10:36 PM, David Hrbác( <span dir="ltr"><<a href="mailto:hrbac.conf@seznam.cz">hrbac.conf@seznam.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Mad Unix napsal(a):<br>
<div class="Ih2E3d">> Hi<br>
><br>
> I need a script to automatically Starting/Stopping an Oracle 10g DB on<br>
> CentOS5.2 64bit i.e<br>
> lsnrctl start/stop<br>
> db start/stop<br>
> emctl start/stop dbconsole"<br>
> Any help?<br>
><br>
><br>
<br>
</div>I'm using this one.<br>
David<br>
<br>
#!/bin/bash<br>
#<br>
# chkconfig: 35 95 15<br>
# description: init script to start/stop oracle database 10g, TNS<br>
listener, EMS<br>
#<br>
#<br>
# match these values to your environment:<br>
<br>
# Source function library.<br>
. /etc/rc.d/init.d/functions<br>
<br>
export ORACLE_BASE=/home/oracle<br>
export ORACLE_HOME=/home/oracle/OraHome_1<br>
export ORACLE_TERM=xterm<br>
export PATH=/home/oracle/bin:/home/oracle/OraHome_1/bin:$PATH<br>
#export NLS_LANG=''<br>
export ORACLE_SID=orcl<br>
export DISPLAY=localhost:0<br>
export ORACLE_USER=oracle<br>
<br>
prog="Oracle"<br>
<br>
# see how we are called:<br>
<br>
start() {<br>
echo -n $"Starting $prog: "<br>
su - "$ORACLE_USER"<<EOO<br>
lsnrctl start<br>
sqlplus /nolog<<EOS<br>
connect / as sysdba<br>
startup<br>
EOS<br>
emctl start dbconsole<br>
EOO<br>
touch /var/lock/subsys/ora10<br>
}<br>
<br>
stop() {<br>
echo -n $"Stopping $prog: "<br>
su - "$ORACLE_USER"<<EOO<br>
emctl stop dbconsole<br>
lsnrctl stop<br>
sqlplus /nolog<<EOS<br>
connect / as sysdba<br>
shutdown immediate<br>
EOS<br>
EOO<br>
}<br>
<br>
<br>
<br>
<br>
case "$1" in<br>
start)<br>
start<br>
;;<br>
stop)<br>
stop<br>
;;<br>
restart)<br>
stop<br>
sleep 10<br>
start<br>
;;<br>
<br>
*)<br>
echo $"Usage: $0 {start|stop}"<br>
exit 1<br>
<br>
esac<br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Madunix_at_Gmail<br>Sysadmin<br><br>"Computers are useless. They can only give you answers" - Pablo Picasso<br>"Never trust a computer you can't throw out a window." - Steve Wozniak <br>
</div>