Add Linux Target to Oracle Enterprise Manager Cloud Control 13c

This article list out steps to add Linux (OEL 7) as a monitoring target to Oracle Enterprise Manager Cloud Control 13c. Note, the steps are same for 12c OEM as well.

This method of agent deployment is also known as Push Method Deployment.

Also Read: Setup and install Oracle Enterprise Manager 13c Cloud Control on Linux.

Install Oracle Linux 7

For this demonstration purpose, I have used virtualbox VM with 4 GB RAM and 120 GB hard disk. I have setup the virtual machine with exact same steps described in the following article.

I have set hostname as “dev.dbagenesis.com” for this linux target while installing OEL 7.

Install Oracle Linux on VirtualBox (OEL 7.7)

Install Oracle 12cR2

As this VM is going to act as OEM target, I am going to install Oracle 12cR2 and also create a database. This will allow us to monitor this new database from OEM console.

yum -y install oracle-database-server-12cR2-preinstall

Install below packages as they are required by OEM to install Agent on this target machine

yum install make -y
yum install binutils -y
yum install gcc -y
yum install libaio -y
yum install glibc-common -y
yum install libstdc++ -y
yum install sysstat -y
yum install glibc -y
yum install glibc-devel.i686 -y
yum install glibc-devel -y
yum install libXtst -y

Set password for Oracle user

passwd oracle

Create directories which will hold Oracle software installation

mkdir /u01
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Copy the 12cR2 software files under /u01 and unzip it

su - oracle

cd /u01
unzip linuxx64_12201_database.zip

You can choose to install the Oracle software using GUI method but I will be going with silent mode as it is quick and straight forward.

vi /tmp/12cR2_response.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=dev.dbagenesis.com
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/12.2.0.1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES

Run the installer in silent mode to start the Oracle software installation

./runInstaller -ignoreSysPrereqs -showProgress -silent -responseFile /tmp/12cR2_response.rsp

Set the Oracle user bash profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1
export ORACLE_SID=devdb
export AGENT_HOME=/u01/app/oracle/agent/agent_inst

PATH=$PATH:$HOME/.local/bin:$ORACLE_HOME/bin

export PATH

Don’t forget to execute the bash profile

. .bash_profile

Create Database

Lets create “devdb” database on this VM. I am using dbca silent mode for quick db creation

dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbName devdb \
-sid devdb \
-createAsContainerDatabase false \
-emConfiguration NONE \
-datafileDestination /u01/app/db_files \
-storageType FS \
-characterSet AL32UTF8 \
-totalMemory 2048 \
-recoveryAreaDestination /u01/app/FRA

Fire NETMGR utility and create database listener and tns entries.

Add Linux Target via OEM

Create directory on target server to hold the Agent software

Oracle User
===========

mkdir -p /u01/app/oracle/agent

Login to OEM console via web browser and let us start adding the target

On top right side, click on Setup >> Add Target >> Add Target Manually

Under Add Host Targets >> click on Install Agent on Host

Click on “+ Add” option, give hostname and select platform. Click on “Next”

Provide the agent installation directory “/u01/app/oracle/agent”. Click on “Named Credential” and give the oracle user id and password for the target system.

Make sure to delete anything that you see under “Privileged Delegation Setting”

Note: Named credential is the host username and password of the target system. Using the Named credentials, OEM will be able to login to target system and install the agent software.

Click Next, review the agent installation and then click on Deploy Agent

Once the installation is done, it will prompt you to run the root scripts on the target server. Next, click on “Done”. You can also click on “Targets” >> “Hosts” to check the newly added host.

Monitor Database, Listener

Once the agent software is installed, it will not automatically start monitoring database, listener, asm etc. You need to set it up to do it for you.

Navigate to Setup >> Add Target >> Add Targets Manually. Click on “Add target using guided process”

Select the below option and click on Add

Under specify host, click on “Search Icon” and select the target host where DB & listener resides. Then click on Next

OEM will discover the database on target system and list it. Select the database, give DBSNMP password (default is Oracle). Then click on test connection. If connection is successful, click ok then click on Next

Check the review screen and click on Save

Done, now your Database and listeners are also added to monitoring. You can check the by going to Targets >> Databases.

Removing a Target

To remove a target and all its monitoring from OEM, first bring down the agent on target machine

$AGENT_HOME/bin/emctl stop agent

Login to OEM console >> Targets >> All Targets and search for the agent that was deployed on the target system.

Click on the agent >> make sure its down. Then click on Agent >> Target Setup >> Target Decommission

Click on Continue >> you will get list of targets that OEM is going to delete (like database, listener etc). Click on Continue >> Click ok to confirm.

Done, the agent and all target monitoring is removed from the OEM.

Next, you will have to manually delete the agent software from the target server

On target system as oracle user
===============================

cd $AGENT_HOME
rm -rf *

Done 😉

Piyush Ranjan
Technical Reviewer

DBA Genesis makes sure all the articles are error free by getting it executed by expert DBAs. To become a technical reviewer, write to [email protected]

Was this article helpful?

Related Articles

Comments

Leave a Comment