注意:html
此文档为生产上操做文档,省略了IP,oracle用户server,agent 端至少须要sudo,ping,ssh,建立目录权限;此文章被布布扣引用,网址:http://www.bubuko.com/infodetail-2539057.htmllinux
IPc++ |
数据库web |
OEM数据库 |
操做系统服务器 |
数据库版本oracle |
XX1app |
单机dom |
service(12.1.0.5)ssh |
Linux 6.7 |
oracle11.2.0.4 |
XX2 |
RAC |
agent |
Linux 6.7 |
Oracle11.2.0.4 |
XX3 |
RAC |
agent |
Linux 6.7 |
Oracle11.2.0.4 |
注意:OEM管理RAC数据库须要先添加主机,集群高可用服务(也能够直接添加数据库,不添加高可用服务,后续文档补充),后添加数据库;单机先添加主机(不用添加集群高可用服务),后添加数据库,GC服务器很耗资源,须要安装oracle软件,建立实例再配置OEM服务端,agent端,建议服务端32G+内存。
安装Enterprise Manager Cloud Control 12c的硬件要求如如下列表,要求至少4G内存,
Linux 6.X 须要的依赖包以下:
yum -y install make binutils gcc libaio glibc-common libstdc++ sysstat glibc-devel glibc-devel
linux 5.X的依赖包以下:
yum -y install make binutils gcc libaio glibc-common libstdc setarch sysstat rng-utils libXtst xorg-x11-utils
注意: server和agent端都须要安装依赖包
须要的软件包:
em12105_linux64_disk1
em12105_linux64_disk2
em12105_linux64_disk3
下载地址:
http://www.oracle.com/technetwork/oem/grid-control/downloads/linuxx8664soft-085949.html
若是数据库配置了dbcontrol,使用以下命令将其删除:
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
$ emca -deconfig dbcontrol db -repos drop -SYS_PWD -SYSMAN_PWD
删除EM案例:
$ emca -deconfig dbcontrol db -repos drop -oracle -Oracle123
建立目录
mkdir -p /u01/app/oracle/Middleware/
mkdir -p /u01/app/oracle/agent
chown -R oracle:oinstall /u01/app/oracle/Middleware
chown -R oracle:oinstall /u01/app/oracle/agent
解压文件(同一个目录解压)
unzip em12105_linux64_disk1
unzip em12105_linux64_disk2
unzip em12105_linux64_disk3
注意:确保安装目录空间至少14G
修改一下参数:
可酌情修改参数,GC服务器很耗资源,建议参数不要过小。
oracle用户进入解压目录,运行./runInstaller
选择”Skip”跳过更新,点击NEXT
Prerequisite checks安装检测,如遇报错,请根据提示修改(或者忽略),点击NEXT
定制版本:
安装目录选择,middleware HOME目录必定要为空
Host name 能够不为域名格式
用户名密码设置:
weblogic/XXX
sysman/XXX
配置oem服务用户名和密码:
服务端口号设置:默认便可:
下一步:
执行脚本:
查看服务器端的OEM 状态:
/u01/app/oracle/Middleware/oms/bin/emctl status oms
查看服务器端agent状态:
/u01/app/oracle/agent/agent_inst/bin/emctl status agent
控制台地址:
启动OEM时,须要先启动所在oms服务器的数据库,以及中间件控制台,最后启动OMS(安装完成后,默认已启动),启动中间件管理台(默认服务器重启会自动启动):
Root:
nohup /u01/app/oracle/gc_inst/user_projects/domains/GCDomain/bin/startWebLogic.sh &
控制台地址:
https:// IP:7102/console
启动oms:
Oracle:
/u01/app/oracle/Middleware/oms/bin/emctl start oms -all
启动客户端:
/u01/app/oracle/agent/agent_inst/bin/emctl start agent
vi /etc/hosts
IP hostname
[root@xxserver agent]# ln -s /usr/bin/sudo /usr/local/bin/sudo
[root@xxserver agent]# ls -lh /usr/local/bin/sudo
lrwxrwxrwx. 1 root root 13 Oct 9 11:08 /usr/local/bin/sudo -> /usr/bin/sudo
[root@xxserver agent]# ls -lh /usr/bin/sudo
---s--x--x. 1 root root 121K May 6 2015 /usr/bin/sudo
[root@xxserver agent]# ls -l /etc/sudoers
-r--r-----. 1 root root 4002 Mar 2 2012 /etc/sudoers
[root@xxserver agent]# 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 文件
测试 oracle 可否正常 sudo
[oracle@xxserver ~]$ ls -lh /root/
ls: cannot open directory /root/: Permission denied
[oracle@xxserver ~]$ sudo ls -l /root
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for oracle:
total 104
-rw-------. 1 root root 1554 Sep 27 17:04 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Desktop
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Documents
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Downloads
-rw-r--r--. 1 root root 51940 Sep 27 17:04 install.log
-rw-r--r--. 1 root root 10259 Sep 27 17:02 install.log.syslog
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Music
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Pictures
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Public
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Templates
drwxr-xr-x. 2 root root 4096 Sep 27 17:06 Videos
2.3.1.前期环境准备
mkdir -p /u01/agent/
chmod oracle.oinstall /u01/agent
注意:
1./u01/agent/ 必定要为空。
2.全部监控服务器/etc/hosts 配置域名解析
3.全部服务器作如下sudo文件配置:
确保/usr/local/bin/sudo 这个符号连接存在
ROOT:
ln -s /usr/bin/sudo /usr/local/bin/sudo
ls -l /etc/sudoers
-r--r----- 1 root root 3407 Oct 18 19:30 /etc/sudoers
cp /etc/sudoers /etc/sudoers.bak
打开/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 文件
测试 oracle 可否正常 sudo
su - oracle
ls -l /root
ls: /root: Permission denied
sudo ls -l /root
[sudo] password for oracle:
total 88
-rw------- 1 root root 1832 Aug 11 05:26 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Aug 10 21:31 Desktop
-rw-r--r-- 1 root root 56307 Aug 11 05:26 install.log
-rw-r--r-- 1 root root 4136 Aug 11 05:26 install.log.syslog
同理设置其余被管理端(agent):(xxhost1)为例:
[root@xxhost1 u01]# mkdir -p /app/u01/agent/
[root@xxhost1 u01]# chown -R oracle:oinstall /app/u01/agent
[root@xxhost1 u01]# cat /etc/hosts
IP hostname
[root@xxhost1 u01]# ls -lh /usr/bin/sudo
---s--x--x. 1 root root 121K May 6 2015 /usr/bin/sudo
[root@xxhost1 u01]# ls -l /etc/sudoers
-r--r-----. 1 root root 4002 Mar 2 2012 /etc/sudoers
[root@xxhost1 u01]# ls -lh /usr/local/bin/sudo
ls: cannot access /usr/local/bin/sudo: No such file or directory
[root@xxhost1 u01]# ln -s /usr/bin/sudo /usr/local/bin/sudo
[root@xxhost1 u01]# ls -lh /usr/local/bin/sudo
lrwxrwxrwx 1 root root 13 Oct 9 11:27 /usr/local/bin/sudo -> /usr/bin/sudo
[root@xxhost1 u01]# cp /etc/sudoers /etc/sudoers.bak
[root@xxhost1 u01]# chmod 755 /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 文件
测试 oracle 可否正常 sudo
[root@xxhost1 u01]# su - oracle
[oracle@xxhost1 ~]$ ls -lh /root/
ls: cannot open directory /root/: Permission denied
[oracle@xxhost1 ~]$ sudo ls -lh /root/
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for oracle:
total 84K
-rw-------. 1 root root 1.7K Aug 1 08:07 anaconda-ks.cfg
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Desktop
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Documents
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Downloads
-rw-r--r--. 1 root root 29K Aug 1 08:07 install.log
-rw-r--r--. 1 root root 8.5K Aug 1 08:06 install.log.syslog
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Music
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Pictures
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Public
-rw-r--r--. 1 root root 358 Aug 1 08:07 redhat.repo_bak
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Templates
drwxr-xr-x 2 root root 4.0K Aug 7 06:38 Videos
mkdir -p /agent
chown -R oracle:oinstall /agent
其余:
说明:因为主机作了ssh 远程限制,须要修改监控服务器以及全部被监控主机如下参数文件:
vi /etc/ssh/sshd_config
添加如下:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
重启sshd 服务:service sshd restart
2.3.2.安装agent
设置 -> 添加目标 ->手动添加目标
静默安装agent参照:http://www.cnblogs.com/hmwh/p/8657498.html
添加须要监控的数据库:
next:
点击OK,而后next 出现如下,注意红色图,填完配置:
下一步部署agent:
下一步:
添加成功
下一步:
下一步:
进行保存(已添加过能够更新)
上图能够根据选择添加主机的集群高可用服务。
点击 Target -> Database -> add 添加数据库配置信息:(注意,若是有多套cluster 数据库添加,也能够用这种办法添加:http://www.cnblogs.com/hmwh/p/8657498.html)
Next
Next:
注意如下图须要配置1,2,3:
依次配置1,2,3;配置2的时候,设置实例->监听程序计算机名,须要设置IP,最好不要写成域名。
Next:
看添加成功的数据库:
目标->数据库