[CentOS] DB stop&start

Wed Sep 10 19:54:30 UTC 2008
Mad Unix <madunix at gmail.com>

Dear David

How can I add to the script also these command as oracleas to stop ans start
iAS

"Starting Oracle iAS"
su - oracleas
$OH/opmn/bin/opmnctl startall
$OH/bin/emctl start iasconsole

"Stopping Oracle iAS"
su - oracleas
$OH/dcm/bin/dcmctl shutdown
$OH/opmn/bin/opmnctl stopall


On Fri, Aug 29, 2008 at 10:36 PM, David Hrbác( <hrbac.conf at seznam.cz> wrote:

> Mad Unix napsal(a):
> > Hi
> >
> > I need  a script to automatically Starting/Stopping an Oracle 10g DB on
> > CentOS5.2 64bit i.e
> > lsnrctl start/stop
> > db start/stop
> > emctl start/stop dbconsole"
> > Any help?
> >
> >
>
> I'm using this one.
> David
>
> #!/bin/bash
> #
> # chkconfig: 35 95 15
> # description: init script to start/stop oracle database 10g, TNS
> listener, EMS
> #
> #
> # match these values to your environment:
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> export ORACLE_BASE=/home/oracle
> export ORACLE_HOME=/home/oracle/OraHome_1
> export ORACLE_TERM=xterm
> export PATH=/home/oracle/bin:/home/oracle/OraHome_1/bin:$PATH
> #export NLS_LANG=''
> export ORACLE_SID=orcl
> export DISPLAY=localhost:0
> export ORACLE_USER=oracle
>
> prog="Oracle"
>
> # see how we are called:
>
> start() {
>        echo -n $"Starting $prog: "
>        su - "$ORACLE_USER"<<EOO
>        lsnrctl start
>        sqlplus /nolog<<EOS
>        connect / as sysdba
>        startup
> EOS
>        emctl start dbconsole
> EOO
>        touch /var/lock/subsys/ora10
> }
>
> stop() {
>        echo -n $"Stopping $prog: "
>        su - "$ORACLE_USER"<<EOO
>        emctl stop dbconsole
>        lsnrctl stop
>        sqlplus /nolog<<EOS
>        connect / as sysdba
>        shutdown immediate
> EOS
> EOO
> }
>
>
>
>
> case "$1" in
> start)
>        start
>        ;;
> stop)
>        stop
>        ;;
> restart)
>        stop
>        sleep 10
>        start
>        ;;
>
> *)
>        echo $"Usage: $0 {start|stop}"
>        exit 1
>
> esac
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Madunix_at_Gmail
Sysadmin

"Computers are useless. They can only give you answers" - Pablo Picasso
"Never trust a computer you can't throw out a window." - Steve Wozniak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20080910/bb15d931/attachment-0004.html>