#!/bin/bash #Start and stop Oracle Business Intelligence 11g components. # #Paul Cannon, 3-Sixty Analytics. Feb 2014. # ORACLE_OWNR=oracle # Local Unix user running OBIEE ORACLE_FMW=/middleware # Deployment Middleware directory BIEE_DOMAIN=bifoundation_domain # Domain name BIEE_INSTANCE=instance1 # Instance name BIEE_SERVER=bi_server1 # Server name BIEE_MANAGER_URL=mdc-dwh-obi:7001 # Admin server URL (hostname:port) BIEE_USER=weblogic # Admin user BIEE_PASSWD=Ww123456 # Admin password LOG_PATH=/home/oracle/logs # Log directory 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 ORACLE_HOME=$ORACLE_FMW/Oracle_BI1 export ORACLE_HOME INSTANCE_HOME=$ORACLE_FMW/instances/$BIEE_INSTANCE export INSTANCE_HOME WLS_HOME=$ORACLE_FMW/wlserver_10.3 export WLS_HOME FMW_HOME=$ORACLE_FMW export FMW_HOME #create the security file boot.properties rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/security/boot.properties rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/$BIEE_SERVER/security/boot.properties echo username=$BIEE_USER >$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/security/boot.properties echo password=$BIEE_PASSWD >>$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/security/boot.properties echo username=$BIEE_USER >$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/$BIEE_SERVER/security/boot.properties echo password=$BIEE_PASSWD >>$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/$BIEE_SERVER/security/boot.properties # recreate symbolic links to log files. ln -sf $ORACLE_INSTANCE/diagnostics/logs/OracleBIServerComponent/coreapplication_obis1/nqserver.log $LOG_PATH/nqserver.log ln -sf $ORACLE_INSTANCE/diagnostics/logs/OracleBIServerComponent/coreapplication_obis1/nqquery.log $LOG_PATH/nqquery.log ln -sf $ORACLE_INSTANCE/diagnostics/logs/OracleBIServerComponent/coreapplication_obis1/console~coreapplication_obis1~1.log $LOG_PATH/console~coreapplication_obis1~1.log ln -sf $ORACLE_INSTANCE/diagnostics/logs/OracleBIPresentationServicesComponent/coreapplication_obips1/console~coreapplication_obips1~1.log $LOG_PATH/console~coreapplication_obips1~1.log ln -sf $(ls -Art $ORACLE_INSTANCE/diagnostics/logs/OracleBIPresentationServicesComponent/coreapplication_obips1/sawlog*.log | tail -n 1) $LOG_PATH/sawlog.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/logs/AdminServer.log $LOG_PATH/AdminServer.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/logs/AdminServer-diagnostic.log $LOG_PATH/AdminServer-diagnostic.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/logs/access.log $LOG_PATH/AdminServer-access.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/logs/bi_server1-diagnostic.log $LOG_PATH/bi_server1-diagnostic.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/logs/bi_server1.log $LOG_PATH/bi_server1.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/logs/access.log $LOG_PATH/bi_server-access.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/logs/bipublisher/bipublisher.log $LOG_PATH/bipublisher.log ln -sf $WLS_HOME/common/nodemanager/nodemanager.log $LOG_PATH/nodemanager.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/data/ldap/log/EmbeddedLDAPAccess.log $LOG_PATH/EmbeddedLDAPAccess.log ln -sf $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/data/ldap/log/EmbeddedLDAP.log $LOG_PATH/EmbeddedLDAP.log NOW=$(date +"%Y%m%d-%H%M") START_LOG=$LOG_PATH/obiee_start_$NOW.log STOP_LOG=$LOG_PATH/obiee_stop_$NOW.log SUBSYS=obiee start() { echo "********************************************************************************" echo "Starting Admin Server on $(date)" echo "********************************************************************************" $BIEE_PATH/startWebLogic.sh & wait_for "Server started in RUNNING mode" echo "********************************************************************************" echo "Starting Node Manager on $(date)" echo "********************************************************************************" $WL_PATH/startNodeManager.sh & wait_for "socket listener started on port" echo "********************************************************************************" echo "Starting Managed Server $BIEE_SERVER on $(date)" echo "********************************************************************************" $BIEE_PATH/startManagedWebLogic.sh $BIEE_SERVER http://$BIEE_MANAGER_URL & wait_for "Server started in RUNNING mode" echo "********************************************************************************" echo "Starting BI components on $(date)" echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl startall $ORACLE_HOME/opmn/bin/opmnctl status echo "********************************************************************************" echo "OBIEE start sequence completed on $(date)" echo "********************************************************************************" } stop() { echo "********************************************************************************" echo "Stopping BI components on $(date)" echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl stopall echo "********************************************************************************" echo "Stopping Managed Server $BIEE_SERVER on $(date)" echo "********************************************************************************" $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 "$ORACLE_FMW/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager" echo "********************************************************************************" echo "Stopping Admin Server on $(date)" echo "********************************************************************************" $BIEE_PATH/stopWebLogic.sh echo "********************************************************************************" echo "Cleaning up .lok files" echo "********************************************************************************" rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/edit.lok rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/config/config.lok rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/data/ldap/ldapfiles/EmbeddedLDAP.lok rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/bi_server1/tmp/bi_server1.lok rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/data/ldap/ldapfiles/EmbeddedLDAP.lok rm -f $ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/servers/AdminServer/tmp/AdminServer.lok 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 "To view log file: tail -f $START_LOG" echo "********************************************************************************" start &> $START_LOG & touch $LOG_PATH/$SUBSYS ;; stop) echo "********************************************************************************" echo "Stopping Oracle Business Intelligence on $(date)" echo "Logs are sent to $STOP_LOG" echo "********************************************************************************" stop &> $STOP_LOG rm -f $LOG_PATH/$SUBSYS ;; status) echo "********************************************************************************" echo "Oracle BIEE components status...." echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl status ;; stopopmn) echo "********************************************************************************" echo "Oracle BIEE components status...." echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl stopall ;; startopmn) echo "********************************************************************************" echo "Oracle BIEE components status...." echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl startall $ORACLE_HOME/opmn/bin/opmnctl status ;; restartopmn) echo "********************************************************************************" echo "Oracle BIEE components status...." echo "********************************************************************************" $ORACLE_HOME/opmn/bin/opmnctl stopall $ORACLE_HOME/opmn/bin/opmnctl startall $ORACLE_HOME/opmn/bin/opmnctl status ;; restart) $0 stop $0 start ;; *) echo "Usage: $(basename $0) start|stop|restart|stopopmn|startopmn|restartopmn|status" exit 1 esac exit 0