【第22期】观点:IT 行业加班,到底有没有价值?

oracle obiee cluster auto restart

原创 2015年11月18日 17:13:20

obiee太多组件了. 有nodemgr, weblogic, managedserver, coreapplications.一个个启动很麻烦. OPS也不懂这些.

注意:根据obiee managed server的实际情况在不同节点上设置是否需要启动adminserver.

#!/bin/bash
#
# File:    /etc/init.d/obiee
# Purpose: Start and stop Oracle Business Intelligence 11g components.
#
# chkconfig: 2345 99 10
# description: Manage OBIEE service.
#

# These values must be adapted to your environment.

ORACLE_OWNR=oracle                  # Local Unix user running OBIEE
ORACLE_FMW=/app/oracle/fmw       # Deployment root directory

BIEE_USER=weblogic                # BIEE administrator name
BIEE_PASSWD=abc    # BIEE administrator password
BIEE_DOMAIN=bifoundation_domain           # Domain name
BIEE_INSTANCE=instance2             # Instance name
BIEE_SERVER=bi_server2              # Server name
BIEE_MANAGER_URL=192.168.36.1:7001    # Admin server URL (hostname:port)

# These should require no change.

WL_PATH=$ORACLE_FMW/wlserver_10.3/server/bin
BIEE_PATH=$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/bin
ORACLE_INSTANCE=$ORACLE_FMW/instances/$BIEE_INSTANCE

export ORACLE_INSTANCE

START_LOG=/home/oracle/obiee-start.log
STOP_LOG=/home/oracle/obiee-stop.log
SUBSYS=obiee

start() {
    echo "********************************************************************************"
    echo "Starting Admin Server on $(date)"
    echo "********************************************************************************"
    su $ORACLE_OWNR -c "$BIEE_PATH/startWebLogic.sh" &
    #su - oracle -c "$BIEE_PATH/startWebLogic.sh" &
    wait_for "Server started in RUNNING mode"

    echo "********************************************************************************"
    echo "Starting Node Manager on $(date)"
    echo "********************************************************************************"
    su - $ORACLE_OWNR -c "$WL_PATH/startNodeManager.sh" &
    #$WL_PATH/startNodeManager.sh&
    wait_for "socket listener started on port"

    echo "********************************************************************************"


    echo "********************************************************************************"
    echo "Starting Managed Server $BIEE_SERVER on $(date)"
    echo "********************************************************************************"
    su - $ORACLE_OWNR -c "$BIEE_PATH/startManagedWebLogic.sh $BIEE_SERVER http://$BIEE_MANAGER_URL" &
    #$BIEE_PATH/startManagedWebLogic.sh $BIEE_SERVER http://$BIEE_MANAGER_URL $BIEE_USER $BIEE_PASSWD &
    wait_for "Server started in RUNNING mode"

    echo "********************************************************************************"
    echo "Starting BI components on $(date)"
    echo "********************************************************************************"
    su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl startall"
    #$ORACLE_INSTANCE/bin/opmnctl startall

    echo "********************************************************************************"
    echo "OBIEE start sequence completed on $(date)"
    echo "********************************************************************************"
}

stop() {
    echo "********************************************************************************"
    echo "Stopping BI components on $(date)"
    echo "********************************************************************************"
    su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl stopall"
    #$ORACLE_INSTANCE/bin/opmnctl stopall

    echo "********************************************************************************"
    echo "Stopping Managed Server $BIEE_SERVER on $(date)"
    echo "********************************************************************************"
    su $ORACLE_OWNR -c "$BIEE_PATH/stopManagedWebLogic.sh $BIEE_SERVER t3://$BIEE_MANAGER_URL $BIEE_USER $BIEE_PASSWD"
    #$BIEE_PATH/stopManagedWebLogic.sh $BIEE_SERVER t3://$BIEE_MANAGER_URL $BIEE_USER $BIEE_PASSWD

    echo "********************************************************************************"
    echo "Stopping Node Manager on $(date)"
    echo "********************************************************************************"
    pkill -TERM -u $ORACLE_OWNR -f "weblogic\\.NodeManager"
    #pkill -TERM -f "weblogic\\.NodeManager"

    echo "********************************************************************************"
    echo "Stopping Admin Server on $(date)"
    echo "********************************************************************************"
    su $ORACLE_OWNR -c "$BIEE_PATH/stopWebLogic.sh"
    #$BIEE_PATH/stopWebLogic.sh"

    echo "********************************************************************************"
    echo "OBIEE stop sequence completed on $(date)"
    echo "********************************************************************************"
}

wait_for() {
    res=0
    while [[ ! $res -gt 0 ]]
    do
        res=$(tail -5 "$START_LOG" | fgrep -c "$1")
        sleep 5
    done
}

case "$1" in
    start)
        echo "********************************************************************************"
        echo "Starting Oracle Business Intelligence on $(date)"
        echo "Logs are sent to $START_LOG"
        echo "********************************************************************************"
        start &> $START_LOG &
        touch /var/lock/subsys/$SUBSYS
    ;;
    stop)
        echo "********************************************************************************"
        echo "Stopping Oracle Business Intelligence on $(date)"
        echo "Logs are sent to $STOP_LOG"
        echo "********************************************************************************"
        stop &> $STOP_LOG
        rm -f /var/lock/subsys/$SUBSYS
    ;;
    status)
        echo "********************************************************************************"
        echo "Oracle BIEE components status...."
        echo "********************************************************************************"
        su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl status"
    ;;
    restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "Usage: $(basename $0) start|stop|restart|status"
        exit 1
esac

exit 0
[root@nbiwapp2 init.d]# vim obiee
[root@nbiwapp2 init.d]# chkconfig --add obiee
[root@nbiwapp2 init.d]# chkconfig obiee on
[root@nbiwapp2 init.d]#  ln -s /etc/init.d/obiee /etc/rc0.d/K01obiee
[root@nbiwapp2 init.d]#  ln -s /etc/init.d/obiee /etc/rc6.d/K01obiee
[root@nbiwapp2 init.d]# chkconfig --list|grep obiee
obiee           0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@nbiwapp2 init.d]#
版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

11gR2 oracle restart特性体验

详见原文博客链接 http://www.killdb.com/2011/10/09/oracle-restart-%e4%bd%93%e9%aa%8c.html
  • wsql
  • wsql
  • 2011-10-09 20:45
  • 314

OBIEE 11g R1 Architecture

OBIEE 11g R1 Architecture Below diagram depicts the standard logical architecture of Oracle busin...

程序员升职加薪指南!还缺一个“证”!

CSDN出品,立即查看!

Oracle 11g 新特性 -- Oracle Restart 说明

一.OHASD 说明 Oracle 的Restart 特性是Oracle 11g里的新特性,在讲这个特性之前先看一下Oracle 11g RAC的进程。之前的Blog 有说明。 Oracle 11gR2RAC 进程说明 <a href="http://blog.csdn.net/t...

Integrating Oracle OBIEE Content using GO URL

Integrating Oracle OBIEE Content using GO URL Integrating Oracle OBIEE Content using GO...

influxDB+graphite+grafana+stats+collect+elasticserach+zabbix

基于influxDB+graphite+grafana+statsd+collect+elasticserach+zabbix打造 一个全方位监控系统。 这个是基于kamon+statsd+graphite+grafana的jvm,api,socket等信息截图 <img src=&quo...
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)