Enterprise Manager Cloud Control 12c&agent安装指南

在OOW2011期间甲骨文发布了新一代的企业管理器Enterprise Manager Cloud Control 12c,在这里我们来介绍如何在Red Hat Enterprise Linux 5上快速部署EM12c和其Agent

 

硬件要求

 

安装Enterprise Manager Cloud Control 12c的硬件要求如下表,推荐至少有4GB内存

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

系统和软件包要求

 

本次部署选用Red Hat Enterprise Linux Server release 5.6 (Tikanga)

 

一下表格列出在RHEL 6或5.x上安装EM12c,所要求预装的操作系统软件包,这些软件包可以直接从OS安装DVD介质中找到:

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

更多关于OS软件要求的信息,可以直接访问EM安装手册《Meeting Package,Kernel Parameter,and Library Requirements》章节。

准备工作

 

在正式部署EM12c之前我们需要完成一系列的准备工作,包括:

 

1.下载EM 12c、database11g安装介质

 

         安装介质可以从Oracle技术网络OTN上找到。

 

         oracle 11g: p13390677_112040_Linux-x86-64_1of7.zip

                            p13390677_112040_Linux-x86-64_2of7.zip

 

         oracle jdk: jdk-8u65-linux-x64.tar.gz

 

         oracle em12c: em12104_linux64_disk1.zip

                                 em12104_linux64_disk2.zip

                                 em12104_linux64_disk3.zip

         weblogic 12c: fmw_12.2.1.0.0_wls_Disk1_1of1.zip

         NMON: nmon-14f-1.el5.rf.x86_64.rpm

 

         rlwrap: rlwrap-0.37-1.el5.x86_64.rpm

 

2. JAVA环境的配置

 

         2.1 解压安装                  

 tar -zxvf jdk-8u65-linux-x64.tar.gz-C /usr/lib/jvm

 cd /usr/lib/jvm

 mv jdk1.8.0 java-8-jvm

         2.2 修改环境变量

                   vi ~/.bashrc

                   添加:       

export JAVA_HOME=/usr/lib/jvm/java-8-sun

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=${JAVA_HOME}/bin:$PATH

        保存退出,输入source ~/.bashrc

    2.3 配置JDK版本

        由于RHEL中可能会有默认的JDK,如openjdk,所以,为了将我们安装的JDK设置为默认JDK       版本,还要进行如下配置:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-sun/bin/java 300
sudo update-alternatives --install /usr/bin/javacjavac/usr/lib/jvm/java-8-sun/bin/javac 300
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-8-sun/bin/jar 300
sudo update-alternatives --install /usr/bin/Javadoc Javadoc /usr/lib/jvm/java-8-sun/bin/javadoc 300
sudo update-alternatives --install /usr/bin/javawsjavaws/usr/lib/jvm/java-8-sun/bin/javaws 300
sudo update-alternatives --install /usr/bin/jcontroljcontrol/usr/lib/jvm/java-8-sun/bin/jcontrol 300

                   执行:sudo update-alternatives --config java

        系统会列出各种JDK版本,如下所示:       

There are 2 programs which provide 'java'.



        Selection    Command

        -----------------------------------------------

        *  1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java

         + 2           /usr/lib/jvm/java-8-sun/bin/java



        Enter to keep the current selection[+], or type selection number: 2

    2.4 测试JAVA环境

        java –version

3.安装repository database

         3.1 安装软件包   

yum install binutils  compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ 
 glibc glibc-devel glibc-common glibc-headers ksh libgcc libstdc++ libstdc++-devel libaio  libaio-devel make sysstat libXp libXt

         3.2 建立oinstall,dba组和oracle用户                  

 #建立用户组:

/usr/sbin/groupadd -g 200 oinstall

/usr/sbin/groupadd -g 201 dba

#建立用户并设置密码:

/usr/sbin/useradd -u 200 -g oinstall -G dba oracle

passwd oracle

         3.3 配置oracle用户的shell限制                  

vi /etc/security/limits.conf

#添加:

oracle    soft    nofile    4096
oracle    hard    nofile    65536
oracle    soft    nproc     2048
oracle    hard    nproc     16384

         3.4 配置内核参数                  

vi /etc/sysctl.conf

#添加:

kernel.shmall = 2097152

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.core.rmem_default=262144

net.core.wmem_default=262144

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_max = 4194304

net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576

                   执行:/sbin/sysctl -p                  

vi /etc/pam.d/login

#添加:

session required /lib/security/pam_limits.so

         3.5 建立oracle目录

mkdir -p /oracle/database/product/11.2.0/db_1

mkdir -p /oracle/middleware/oem12c

mkdir -p /oracle/middleware/gc_agent

mkdir -p /oradata/software

chown -R oracle.oinstall /oracle

chown -R oracle.oinstall /oradata

chown -R oracle.oinstall /arch

chmod -R 755 /oracle

chmod -R 755 /oradata

chmod -R 755 /arch

         3.6 设置oracle用户的环境变量                  

 vi /home/oracle/.bash_profile

#添加:

export ORACLE_BASE=/oracle/database

export ORACLE_HOME=/oracle/database/product/11.2.0/db_1

export MW_BASE=/oracle/middleware

export OEM_HOME=/oracle/middleware/oem12c

export OMS_HOME=$OEM_HOME/oms

export OEM_AGENT_HOME=/oracle/middleware/gc_agent/core/12.1.0.4.0

export ORACLE_SID=gc

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:$ORACLE_HOME/oracm/lib:/lib:/usr/lib:/usr/local/lib

export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib:/usr/local/lib

export PATH=$PATH:/sbin:/usr/lbin:/usr/sbin:$JAVA_HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/lib:$HOME/bin:$ORA_CRS_HOME/bin:

export PATH

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

                  

         3.7 安装oracle database

                   解压软件包                  

unzip p13390677_112040_Linux-x86-64_1of7.zip

unzip p13390677_112040_Linux-x86-64_2of7.zip

                   运行安装程序                  

./runInstaller -ignoreSysPrereqs

 Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

之后执行root.sh,即安装完成。

         3.8 创建数据库

               dbca

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

         3.9 配置Repository database 

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

                  3.9.1 满足上述要求:                           

alter system set processes=500 scope=spfile;

alter system set session_cached_cursors=500 scope=spfile;

alter system set shared_pool_size=650M scope=spfile;

alter system set job_queue_processes=22 scope=spfile;

alter system set open_cursors=350 scope=spfile;

alter system set sga_target=6G scope=spfile;

alter system set pga_aggregate_target=2G scope=spfile;

                            重启数据库

                   3.9.2 Repository Database不允许配置DB control,如果有的话需要drop

                           

$ORACLE_HOME/bin/emca -deconfig dbcontrol -repos drop

                   3.9.3 Repository Database不允许存在SYSMAN、SYSMAN_MDS、SYSMAN_OPSS用户                           

drop user sysman cascade;

drop user sysman_mds cascade;

drop user sysman_opss cascade;

drop user sysman_apm cascade;

drop user sysman_ro cascade;

drop user mgmt_view cascade;

select * from dba_synonyms where table_owner in (‘SYSMAN’,’SYSMAN_MDS’,’MGMT_VIEW’,’SYSMAN_BIP’,’SYSMAN_APM’,’SYSMAN_OPSS’,’SYSMAN_RO’);

@?/rdbms/admin/catsnmp

 

4安装weblogic

         解压软件        

unzip fmw_12.2.1.0.0_wls_Disk1_1of1.zip

java -jar fmw_12.2.1.0.0_wls.jar

 Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

5 安装Enterprise Manager Cloud Control 12c

 

         解压软件        

unzip em12104_linux64_disk1.zip

unzip em12104_linux64_disk2.zip

unzip em12104_linux64_disk3.zip

         运行安装程序

         ./runInstaller

 Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南 Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

 登录oracle EM12c

https://gc-test:7799/em/

Enterprise Manager Cloud Control 12c&agent安装指南

 Enterprise Manager Cloud Control 12c&agent安装指南                   

 Enterprise Manager Cloud Control 12c&agent安装指南

 Enterprise Manager Cloud Control 12c安装完成。

 

6安装Enterprise Manager Cloud Control 12c Agent

 

         6.1停止OMS和Agent服务                 

export MW_BASE=/oracle/middleware
export OEM_HOME=/oracle/middleware/oem12c
export OMS_HOME=$OEM_HOME/oms
export OEM_AGENT_HOME=/oracle/middleware/gc_agent/core/12.1.0.4.0

 $OMS_HOME/bin/emctl stop oms -all

Enterprise Manager Cloud Control 12c&agent安装指南

 $OEM_AGENT_HOME/bin/emctl stop agent

Enterprise Manager Cloud Control 12c&agent安装指南

$OMS_HOME/bin/emctl start oms

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

$OEM_AGENT_HOME/bin/emctl start agent

Enterprise Manager Cloud Control 12c&agent安装指南

    这里我们要注意一点,OMS 12c(12.1) 只能和12.1 Agent 代理程序配合工作,而不能使用之前任何版本的Agent“Enterprise Manager Cloud Control can communicate only with Oracle Management Agent 12c and not with any other earlier release of the Management Agent. You can not configure your exising Agents to communicate with Enterprise Manager 12c OMS.” 

 

6.2 系统和软件包要求

Enterprise Manager Cloud Control 12c&agent安装指南

6.3 准备工作

    6.3.1 12c 部署agent 要求在创建必要的credential profile,该credential profile将包含能够从OMS server ssh到目标节点target node的用户身份认证,且要求该用户能够在target node上以sudo执行root用户的权限。

这里我们以oracle用户为例,我们将以目标节点上的oracle用户身份创建credential profile,首先我们要确保oracle用户能够以sudo执行root用户的权限,这需要用到/etc/sudoers配置文件:

!确保/usr/local/bin/sudo这个符号链接存在

ln -s /usr/bin/sudo /usr/local/bin/sudo
ls -l /etc/sudoers
cp /etc/sudoers /etc/sudoers.bak
vi /etc/sudoers
#打开/etc/sudoers将以下三处修改

#修改前:

Defaults   requiretty

#修改后:

Defaults:oracle        !requiretty

                  

#修改前:

Defaults   !visiblepw

#修改后:

Defaults   visiblepw



#修改前:

##

## Allow root to run any commands anywhere

root    ALL=(ALL)    ALL

#修改后:

##

##Allow root to run any commands anywhere

root      ALL=(ALL)    ALL

oracle    ALL=(ALL)    ALL

                  

#以上三处修改完成后,save文件”x!”



测试oracle能否正常sudo

#su – oracle

$ls -l /root

ls: /root: Permission denied
$sudo ls -l /root

 

    6.3.2在目标服务器上创建必要的目录                  

mkdir /m01

mkdir -p /oradata/middleware/em_agent

chown -R oracle.oinstall /m01

vi ~/.bash_profile

EM_AGENT_HOME=/oradata/middleware/em_agent

         6.3.3 确保OMS server和target server间的通信畅通,如果没有使用DNS服务,那么需要将host/ip信息写入/etc/hosts文件中,如果漏掉这步将报’target node can not be reached’错误

 

         6.3.4 安装agent

         首先再次以sysman身份登录EM https console,如https://gc-test:7799/em

         点击右上角的“设置->添加目标->手动添加目标”

Enterprise Manager Cloud Control 12c&agent安装指南

 进入“手动添加目标页面”,点击“添加主机”

Enterprise Manager Cloud Control 12c&agent安装指南

添加主机目标主机和平台页面使用默认的会话名即可,点选”+添加按钮填入主机名和平台信息:

注意这里推荐填入规范的hostname,如”vrh2.oracle.com”,注意主机名不能带下划线 “_”,若Platform下拉列表中没有你要的平台那么说明在该平台上还没有12.1 agent可用。

Enterprise Manager Cloud Control 12c&agent安装指南

添加完主机名,选择相应平台信息后,点击下一步

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

 

添加数据库

解锁dbsnmp

alter user dbsnmp account unlock;

conn dbsnmp  ---修改密码:dbsnmp

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

Enterprise Manager Cloud Control 12c&agent安装指南

 OEM_AGENT日志输出

OEM    gc-test

/oracle/middleware/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/EMGC_OMS1.out

gc-client

/oracle/middleware/em_agent/core/12.1.0.4.0/bin/emctl stop agent

 

至此Oracle Enterprise Manager Cloud Control 12部署完成,目标数据库部署agent即可纳入EMCC12管理。