Oracle Cloud Control 12c 安裝流程複雜,安裝路徑、密碼、端口號等配置項繁多,安裝完成後如何快速獲取關鍵信息(端口、URL)、正確啟停服務,是每位 DBA 的必備技能。本文整理實操步驟,供參考。
[oracle@oel63 ~]$ more ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=oel63.ycdata.net; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ora11g; export ORACLE_UNQNAME
ORACLE_BASE=/u01/ora11g; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/db_1; export ORACLE_HOME
ORACLE_SID=ora11g; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
export OMS_HOME=/u01/oms12cr3/oms
export AGENT_HOME=/u01/agent12cr2/core/12.1.0.3.0
作業系統:Oracle Linux Server 6.3
資料庫版本:SQL*Plus 11.2.0.3.0
啟動 OMS 前必須先啟動 Repository DB(存放監控數據)及監聽器,否則會報「Failed to connect to repository database」。OMS 會在偵測到 DB 和監聽 UP 時自動重啟。
# 啟動監聽器
[oracle@oel63 ~]$ lsnrctl start
# 檢查資料庫進程
[oracle@oel63 ~]$ ps -ef | grep pmon | grep -grep
# 啟動資料庫
[oracle@oel63 ~]$ sqlplus / as sysdba
SQL> startup
SQL> exit
# 啟動 OMS 及 Agent
[oracle@oel63 ~]$ $OMS_HOME/bin/emctl start oms
[oracle@oel63 ~]$ $AGENT_HOME/bin/emctl start agent
[oracle@oel63 ~]$ cd $OMS_HOME/install
[oracle@oel63 install]$ more eminstall.info
INSTALL_TYPE=NOSEED
UPGRADE=false
ORACLE_MIDDLEWARE_HOME_LOCATION=/u01/oms12cr3 # WebLogic 安裝位置
OMS_HOME=/u01/oms12cr3/oms # OMS 安裝位置
AGENT_HOME=/u01/agent12cr2/core/12.1.0.3.0 # Agent 安裝位置
AGENT_BASE_DIR=/u01/agent12cr2 # Agent 基目錄
[oracle@oel63 install]$ more portlist.ini
Enterprise Manager Upload Http Port=4889
Enterprise Manager Upload Http SSL Port=4903
Enterprise Manager Central Console Http SSL Port=7802
Node Manager Http SSL Port=7403
Managed Server Http Port=7202
Enterprise Manager Central Console Http Port=7788
Oracle Management Agent Port=3872
Admin Server Http SSL Port=7102
Managed Server Http SSL Port=7301
[oracle@oel63 install]$ more setupinfo.txt
This information is also available at:
/u01/oms12cr3/oms/install/setupinfo.txt
# 登錄 Cloud Control Console 及 WebLogic 的 URL
Use the following URL to access:
1. Enterprise Manager Cloud Control URL: https://oel63.ycdata.net:7802/em
2. Admin Server URL: https://oel63.ycdata.net:7102/console
The following details need to be provided during the additional OMS install:
1. Admin Server Hostname: oel63.ycdata.net
2. Admin Server Port: 7102
You can find the ports details used by this deployment at : /u01/oms12cr3/oms/install/portlist.ini
NOTE:
An encryption key has been generated to encrypt sensitive data in the Management Repository. If this key is lost, all encrypted data in the Repository becomes unusable.
A backup of the OMS configuration is available in /u01/gc_inst/em/EMGC_OMS1/sysman/backup on host oel63.ycdata.net.
Use the following command to backup the OMS configuration:
/u01/oms12cr3/oms/bin/emctl exportconfig oms -dir
[oracle@oel63 ~]$ $OMS_HOME/bin/emctl stop oms -all
[oracle@oel63 ~]$ $AGENT_HOME/bin/emctl stop agent
[oracle@oel63 ~]$ lsnrctl stop
[oracle@oel63 ~]$ export ORACLE_SID=ora11g
[oracle@oel63 ~]$ sqlplus / as sysdba
SQL> shutdown immediate;
提示: 定期備份 OMS 配置(emctl exportconfig oms),確保配置變更(插件安裝、拓撲變更等)被記錄。