OBIEE SampleAppv406 自動啟動配置,obieesampleappv406
SampleApp 簡介:
SampleApp是一個一站式的服務,幾乎示範了OBIEE中任何可以想象的頂級的功能。它是一個安裝了許多應用(資料庫,OBIEE,的Endeca,TimesTen的,Essbase的,等等)的VirtualBox虛擬機器,並通過對儀錶盤,行動裝置 App程式設計師,使用D3,ADF,JavaScript,分析可視化示範了基本分析技術等等。
SampleApp是非常棒的,但缺少各個服務的自動啟動功能,我們通過下面的步驟建立和配置啟動指令碼,方便管理OBIEE。
這裡展示的OBIEE init.d服務指令碼可以在任何安裝OBIEE的Linux上使用,也可以下面的地方查看下載:https://github.com/RittmanMead/scripts/tree/master/obi/service
1. 準備工作
假設之前我們已經完成VirtualBox VM的安裝和配置
● downloaded the28GB worth of zip files
● Unpacked them using 7zip
● Found 70+GB of disc space freeand imported the OVF into VirtualBox
● Started up the VM
完整的SampleApp安裝指南見SampleApp_QuickDeploymentGuide–406.pdf,可以SampleAppv406下載頁找到:
http://www.oracle.com/technetwork/middleware/bi-foundation/obiee-samples-167534.html
2. 設定資料庫自動啟動
為了使OBIEE自動啟動,首先要確保資料庫先要啟動,通過設定它作為一個服務(init.d)
# Create startup/shutdownscript files
mkdir -p /home/oracle/scripts
chown oracle.oinstall/home/oracle/scripts
cat>>/home/oracle/scripts/startup.sh<<EEOF
#!/bin/bash
# Start Listener
lsnrctl start
# Start Database
sqlplus / as sysdba <<EOF
STARTUP;
ALTER PLUGGABLE DATABASE ALLOPEN;
EXIT;
EOF
EEOF
cat>>/home/oracle/scripts/shutdown.sh<<EEOF
#!/bin/bash
# Stop Database
sqlplus / as sysdba <<EOF
ALTER PLUGGABLE DATABASE ALLCLOSE IMMEDIATE;
SHUTDOWN IMMEDIATE;
EXIT;
EOF
# Stop Listener
lsnrctl stop
EEOF
# Make them executable
chmod u+x/home/oracle/scripts/startup.sh /home/oracle/scripts/shutdown.sh
chown oracle.oinstall/home/oracle/scripts/startup.sh /home/oracle/scripts/shutdown.sh
# Create service script
cat>/tmp/dbora<<EOF
#!/bin/sh
# chkconfig: 345 90 25
# description: Oracle autostart-stop script.
#
# Set ORA_OWNER to the user idof the owner of the
# Oracle database software.
ORA_OWNER=oracle
case "\$1" in
'start')
# Start the Oracle databases:
# The following command assumes thatthe oracle login
# will not prompt the user for anyvalues
su - \$ORA_OWNER -c"/home/oracle/scripts/startup.sh >>/home/oracle/scripts/startup_shutdown.log 2>&1"
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
# The following command assumes thatthe oracle login
#will not prompt the user for any values
su - \$ORA_OWNER -c"/home/oracle/scripts/shutdown.sh >>/home/oracle/scripts/startup_shutdown.log 2>&1"
rm -f /var/lock/subsys/dbora
;;
esac
EOF
sudo mv /tmp/dbora/etc/init.d/dbora
sudo chown root./etc/init.d/dbora
# Make the service scriptexecutable
sudo chmod 750/etc/init.d/dbora
# Associate the dbora servicewith the appropriate run levels and set it to auto-start using the followingcommand.
sudo chkconfig --add dbora
在SampleApp v406中,有一個Oracle12c的容器資料庫(CDB),在它當中有兩個“可插拔”資料庫(PDB)。假設你沒有啟動資料庫,嘗試串連到PDBS的RCU模式將會失敗:
[oracle@demo ~]$ sqlplusBIEE_BIPLATFORM/Oracle123@localhost:1521/pdborcl
SQL*Plus: Release 12.1.0.1.0Production on Tue Jun 17 03:03:51 2014
Copyright (c) 1982, 2013,Oracle. All rights reserved.
ERROR:
ORA-12541: TNS:no listener
現在啟動服務:
sudo service dbora start
再次檢查狀態:
[oracle@demo ~]$ sqlplusBIEE_BIPLATFORM/Oracle123@localhost:1521/pdborcl
SQL*Plus: Release 12.1.0.1.0Production on Tue Jun 17 03:06:12 2014
Copyright (c) 1982, 2013,Oracle. All rights reserved.
Last Successful login time: TueJun 17 2014 03:02:09 -04:00
Connected to:
Oracle Database 12c EnterpriseEdition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP,Advanced Analytics and Real Application Testing options
SQL>
3. 配置自動啟動OBIEE
現在,我們可以設定OBIEE在系統啟動時自動啟動的服務。在SampleApp v406安裝需要兩個對環境的路徑和依存關係變化的指令碼。github共公的指令碼庫:
https://github.com/RittmanMead/scripts/tree/master/obi/service
# lsof is used in the scriptand isn't installed by default, so let's install it:
sudo yum -y install lsof
# Now fetch the init.d scriptitself and configuration file
sudo wget--no-check-certificate https://raw.githubusercontent.com/RittmanMead/scripts/master/obi/service/init.d/obiee-O /etc/init.d/obiee
sudo wget--no-check-certificatehttps://raw.githubusercontent.com/RittmanMead/scripts/master/obi/service/sysconfig/obiee-O /etc/sysconfig/obiee
# Update the FMW_HOME path inthe script
# If you're doing thismanually, you just neeed to change the line
# "FMW_HOME=" and putin the FMW_HOME path for your installation.
# In the case of SampleApp v406it is /app/oracle/biee
sudo sed -i -e's/FMW_HOME=.*$/FMW_HOME=\/app\/oracle\/biee/g' /etc/sysconfig/obiee
# Make the script executable
sudo chmod 750/etc/init.d/obiee
運行下面命令查看OBIEE的運行狀態:
sudo service obiee status
啟動OBIEE:
sudo service obiee start
如果第一次啟動時有啟動失敗的服務,可以再次運行命令啟動
關閉OBIEE:
sudo service obiee stop
設定系統運行時自動啟動OBIEE:
sudo chkconfig --add obiee
現在可以重新啟動系統,檢查設定是否有效
sudo shutdown -r now
參考:
SampleAppv406自動啟動配置:
http://www.rittmanmead.com/2014/06/sampleapp-v406-automatic-startup-of-obiee/
SampleAppv406虛擬機器安裝配置:
http://www.slideshare.net/lravikumarvsp/step-by-step-deployment-of-sample-appv406