OCM 12c升级考试-Cloud Control安装Agent

在12c考试的时候,如果想简单的完成Resource Manager,还有一个办法就是安装Cloud Control。服务端默认已经给你安装好了,我们只需要安装Agent端,并把数据库实例添加到Cloud Control中就行了。在Cloud Control右上角setup点Add Target-> Add Targets Manually

然后选择Add Host Targets,然后点击Add Host

在添加主机Add Host Targets:Host and Platform中,添加主机名称(这里不能添加IP地址),然后选择主机类型为Linux x86-64

这里需要输入Agent安装的路径,然后Named Crenential选择+号,在弹出的对话框里面输入Oracle用户名和密码

这里直接点击Deploy Agent。


这里我们在第二步出现了异常。显示“The “requiretty” flag is set in the sudoers file on the remote host, and as a result, the user will not be able to run sudo over ssh.”。这里提示在远程主机上的sudoers文件中设置了“Requiretty”标志,因此用户将无法在ssh上运行sudo。出现这个问题是要对sudo文件进行修改,解除一些限制。那么现在安装到一半需要我们把这些东西进行清理。


[oracle@host01 oracle]$ rm -rf /u01/app/oracle/agent/

删除完成之后,我们就对host01的sudo文件进行配置。直接运行下列命令会报”oracle is not in the sudoers file”

[oracle@host01 oracle]$ 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:
oracle is not in the sudoers file. This incident will be reported.


[root@host01 ~]# cp -rp /etc/sudoers /etc/sudoers.bak
# Disable "ssh hostname sudo ", because it will show the password in clear.
# You have to run "ssh -t hostname sudo ".
Defaults:oracle !requiretty
# Refuse to run if unable to disable echo on the tty. This setting should also be
# changed in order to be able to use sudo without a tty. See requiretty above.
Defaults visiblepw
## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
## The COMMANDS section may have other options added to it.
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL

修改完这几个地方了再次运行就可以执行了。这里切记一点,修改该文件要改成可写模式,修改完成后在改成只读模式,不然会报sudo: /etc/sudoers is world writable错误。

[oracle@host01 ~]$ sudo ls -l /root/
[sudo] password for oracle:
total 156
-rw-------. 1 root root 6568 Mar 28 21:16 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Desktop
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Documents
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Downloads
-rw-r--r--. 1 root root 89808 Mar 28 21:16 install.log
-rw-r--r--. 1 root root 17890 Mar 28 21:13 install.log.syslog
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Music
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Pictures
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Public
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Templates
drwxr-xr-x. 2 root root 4096 Mar 28 21:39 Videos


分享到: 更多

Trackbacks & Pingbacks 1

  1. From OCM 12c升级考试-使用命令行agentDeploy安装cloud control agent | Buddy Yuan的个人技术博客 on 26 5月 2018 at 16:15

    […] 上一篇写过用图形界面来安装cloud control agent,传送门,那么考试中只有一种手段肯定是不行的,这里我们在研究一下使用命令行来安装cloud control agent […]

Post a Comment

Your email is never published nor shared. Required fields are marked *