Pular para o conteúdo
  • Este tópico contém 3 respostas, 2 vozes e foi atualizado pela última vez 18 anos, 7 meses atrás por gustavodesa.
Visualizando 4 posts - 1 até 4 (de 4 do total)
  • Autor
    Posts
  • #80281
    souza
    Participante

      Alguém tem um exemplo pronto de “dbora” ou a instalação cria sozinha após a instalação da instância ?

      #80292
      gustavodesa
      Participante

        Segue 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/oratab

        if [ 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
        esac

        exit 0

        #80298
        souza
        Participante

          Obrigado. Vou testar

          #80299
          gustavodesa
          Participante

            Ok. Qualquer duvida estamos ai…

          Visualizando 4 posts - 1 até 4 (de 4 do total)
          • Você deve fazer login para responder a este tópico.