Tuesday, 12 July 2016

OEM13c Installation



This is article demonstrates the Installation of OEM 13c on OEL 7.2
--NOTE:  The installer requires about 10 GB of hard disk space in the temporary directory
Surmise:
Oracle database 12.1.0.2 must be Installed and configured before proceeding with the Installation
OEM13c repository  is only supported on 12.1.0.2 Database
 1.Create user and group
# groupadd omsdb  
# groupadd omsoper
# groupadd omsdba
# useradd -g omsdb -G omsdba,omsoper oem13c  
$ passwd oem13c

2.Create Directories and change permissions
# mkdir -p /u01/app/oem13c/product/12.1.0/db_1
# mkdir -p /u01/app/oem13c
# chown oem13c:omsdb -R /u01
# chmod 775 /u01/app/oem13c
 --OMS Home location
# mkdir -p /u01/app/oem13c/Middleware13c
# chmod -R 775 /u01/app/oem13c/Middleware13c/
# chown -R oem13c:omsdb /u01/app/oem13c/Middleware13c/

--AGENT dirctory location
# mkdir -p /u01/app/oem13c/Agent13c
# chmod -R 775 /u01/app/oem13c/Agent13c/
# chown oem13c:omsdb /u01/app/oem13c/Agent13c/

--OMS software library
# mkdir -p /u01/app/oem13c/oms_sw
# chmod -R 775 /u01/app/oem13c/oms_sw  
# chown -R oem13c:omsdb /u01/app/oem13c/oms_sw

 --Add the bash_profile
vi .bash_profile
export ORACLE_HOME=/u01/app/oem13c/product/12.1.0/db_1
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/sqldeveloper/sqldeveloper/bin:$ORACLE_HOME/jdk/bin
export PATH
#TMP=/u01/tmp
TMPDIR=$TMP
export ORACLE_HOSTNAME=fradlcorap04.oem13c.com
export ORACLE_UNQNAME=oem13c
ORACLE_SID=oem13c
ORACLE_BASE=/u01/app/oem13c
export ORACLE_BASE ORACLE_SID TMPDIR TMP
LD_LIBRARY_PATH=$ORACLE_HOME/bin:$ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib
export LD_LIBRARY_PATH
NLS_DATE_FORMAT='DD-MON-YY HH24:MI:SS'
export NLS_DATE_FORMAT
set -o vi
EDITOR=vim
export EDITOR
ORAENV_ASK=NO
alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'
envo
 3.Verify the RPM packages
The following list of packages must be Installed on Linux-7 64-bit
yum install -y glibc-common glibc-devel glibc-profile glibc-headers  glibc-utils glibc
yum install -y make-3.82-21*
yum install -y binutils-2.23*
yum install -y gcc-4.8.2-16*
yum install -y libaio-0.3.109-12*
yum install -y glibc-common-2.17-55*
yum install -y libstdc++-4.8.2-16*
yum install -y sysstat-10.1.5-4*
yum install -y glibc-devel 2.17-55* (i686) (This is a 32-bit package)
yum install -y glibc-devel 2.17-55*(x86_64) (This is a 64-bit package)
yum install -y libXtst-1.2.2-2* (x86_64)

Check the “glibc” rpms:
# rpm -qa | grep glibc
# rpm -qa | grep glibc-common
# rpm -qa | grep glibc-devel
# rpm -qa | grep glibc-profile
# rpm -qa | grep glibc-headers
# rpm -qa | grep glibc-utils
# rpm -qa | grep glibc
  Or use this to do the above;
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libXext \
libXtst \
libX11 \
libXau \
libXi \
make \
sysstat \
unixODBC \
unixODBC-devel \
zlib-devel

4.Configure kernel parameters:
 Add the following entry  to file
# echo 11000 65500 > /proc/sys/net/ipv4/ip_local_port_range
# more /proc/sys/net/ipv4/ip_local_port_range
# vim /etc/sysctl.conf
net.ipv4.ip_local_port_range = 11000 65000
Make the changes permement by running the below
# sysctl -p
# /sbin/sysctl -a


 Add the HOSTNAME to /etc/hosts file

vi /etc/hosts
<IP-address>  <fully-qualified-machine-name>  <machine-name>
192.168.183.000  example.oem13c.com   example
 Validate the installer group
# more /etc/oraInst.loc

5. Download the software
Download all listed files from the url:
http://www.oracle.com/technetwork/oem/grid-control/downloads/oem-linux64-2823270.html

NOTE: DO NOT unzip the zipped files. Installer will unzip it as required

6.Database configuration BEFORE Installation
 1. show parameter optimizer     -- if  TRUE, set to FALSE
         alter system set optimizer_adaptive_features=false scope=both;
2. show parameter session_cached  --set to 350
         alter system set session_cached_cursors=350 scope=spfile;
3. show parameter shared_pool_size  --set to 1G
         alter system set shared_pool_size=1G scope=both;
4.select inst_id,name,open_mode,restricted from gv$pdbs;
--if MOUNTED THEN,
         alter pluggable database dlc13c open instances=all;
  7.Bounce the database to impact the changes on the system parameter values
shut immediate;
startup

8.Install the DB12c Repository

/runInstaller
9.START Installation of OEM 13c
Execute the binary file


 # chmod +x em13100_linux64.bin










Thursday, 17 March 2016

ERROR: PRVF-7573 Sufficient Swap Size Is Not Available

Swap Size - This is a prerequisite condition to test whether sufficient total swap space is available on the system.
    Expected Value : 7.9062GB (8290304KB)
    Actual Value      : 2GB (2097144KB)
    Details               : PRVF-7573 : Sufficient swap size is not available on node "carol.db.com" [Required = 7.9062GB (8290304KB) ; Found = 2GB (2097144KB)               
Cause:  The swap size found does not meet the minimum requirement. 
Action:  Increase swap size to at least meet the minimum swap space requirement.7.9062 - 2 = 5.9GB (minimum swap need)

FIX:

1). Check what swap size
    # swapon –s
    Filename                                Type            Size    Used    Priority
    /dev/xvda3                              partition       2097144 0       -1

2). Create a file that you’ll use for swap with dd command with   as root
   
     dd if=/dev/zero of={/swapfile path} bs={size of swap}  count=1048576
   
    Example:-
   
    [root@carol]#dd if=/dev/zero of=/home/swapfile bs=6048 count=1048576
    Note :- Above command will be create the 6Gb swapfile on /home location as  swapfile

3). Set up a Linux swap area
    #mkswap /home/swapfile

4). Enabling the swap file
    #swapon /home/swapfile
    #swapon –a

5). Status of add swap
    [root@carol]# swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/xvda3                              partition       2097144 0       -1
    /home/swapfile                          file             6097144 0        -2

6). Update /etc/fstab  
    #vi /etc/fstab
    /home/swapfile        none             swap   sw      0 0

Then retry the installation  

Hope it helps!!..



Make ERROR during Oracle Database installation


Exception String: Error in invoking target 'agent nmhs' of makefile '/opt/oracle/app/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'.

FIX:

Edit the file $ORACLE_HOME/sysman/lib/ins_emagent.mk

 #===========================
 #  emdctl
 #===========================

    $(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL)
       
To

#===========================
#  emdctl
#===========================

    $(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL) -lnnz11
       
       
Now save and click “RETRY” in installer prompt. The installation should successfully complete.

Thursday, 28 January 2016

How to Clone Oracle Home

zip -r dbhome_1.zip /u01/app/oracle/product/11.2.0/dbhome_1
unzip -d / dbhome_1.zip
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
cd $ORACLE_HOME/clone/bin 
$ORACLE_HOME/perl/bin/perl clone.pl ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1" OSDBA_GROUP=dba OSOPER_GROUP=oper -defaultHomeName
Oracle Fine Grained Auditing  At Schema Level

1). Add a policy on a table FGA_TEST in the SCOTT schema
2). The policy will report on any dml actions on this table affecting its 2 columns 'esal' and 'designation'
3). Another user HACKER will execute dml queries on this table and we will try and investigate whether the actions are reported
4). The corresponding event handler of this policy will be in the FGA_HANDLER  schema.we will also find out if the audit event was handled properly

--conn sys / as sysdba
grant select any table to scott;
grant create user to scott;
grant resource,connect to scott;
--create a new schema FGA_HANDLER which will contain the event handler

SQL> create user fga_handler1 identified by fga_handler1;

conn sys
grant resource,connect to fga_handler1;
grant execute on DBMS_FGA to fga_handler1;

--create a new table ,FGA_TEST in SCOTT schema, on which we will enforce the audit conditions(policy) with the help of the DBMS_FGA package

SQL> create table fga_test (empno number,empname varchar2(30),age number,designation varchar2(20));

--Let us insert some prototype table rows
 
 insert into FGA_TEST values(10000,'Carol',100,'Developer');
 insert into FGA_TEST values(10001,'Esther',200,'Analyst' );
 insert into FGA_TEST values(10002,'Bob',300,'Manager') ;

 --ADD_POLICY Procedure

BEGIN DBMS_FGA.ADD_POLICY ( object_schema => 'SCOTT', object_name => 'FGA_TEST', policy_name => 'FGA_TEST_POLICY1', audit_condition => NULL, audit_column => 'AGE,DESIGNATION', handler_schema => 'FGA_HANDLER1', handler_module => 'sp_audit', enable => true,statement_types => 'INSERT,UPDATE,DELETE' );end;
/
--connect to the fga_handler1 schema

SQL> conn fga_handler1/fga_handler1

--create the table to store audit records

SQL> create table audit_event (audit_event_no number);

--The procedure adds a record to the table above any time it executeds and the column audit_event_no acts as counter displaying the number of times the procedure has been executed

SQL> create or replace procedure sp_audit(object_schema in varchar2,object_name in varchar2,policy_name in varchar2) as count number;begin select nvl(max(audit_event_no),0) into count from audit_event;insert into audit_event values (count+1); commit; end;
/
--Finally create another schema ‘HACKER’ which tries to manipulate the values of the ‘age’ or ‘designation’ columns of the FGA_TEST table

SQL> conn sys / as sysdba

SQL>  create user hacker1 identified by hacker1;
            grant resource,connect to hacker1;
            grant all on scott.fga_test to hacker1;

 --Connect as hacker and update the policed columns(s)


SQL> conn hacker/hacker;
SQL> update scott.fga_test set designation='CIO' where empname='carol';

--connect with SCOTT to see the dba_fga_audit_trail view to find if the event was recorded

SQL>  conn scott /scott

SQL> col DB_USER for a12
SQL> col OS_USER for a14
SQL> col POLICY_NAME for a16
SQL> col SQL_TEXT for a70
SQL> select DB_USER,OS_USER,POLICY_NAME,SQL_TEXT, TIMESTAMP from      dba_fga_audit_trail where POLICY_NAME='FGA_TEST_POLICY1';

--Connect to the FGA_HANDLER schema to see if the event handler(sp_audit) was called

SQL> conn hacker/hacker;

--Now, execute the following from HACKER schema

SQL> select * from scott.fga_test;

--Attack to change designation
    
update SCOTT.FGA_TEST set designation='HR' where name='Bob';

--conn as sysdba to see who did what and when

conn sys / as sysdba

SQL> col DB_USER for a12
SQL> col OS_USER for a14
SQL> col POLICY_NAME for a16
SQL> col SQL_TEXT for a70
SQL> select DB_USER,OS_USER,POLICY_NAME,SQL_TEXT, TIMESTAMP from dba_fga_audit_trail where POLICY_NAME='FGA_TEST_POLICY';


--Have Fun,


Tuesday, 20 October 2015

Install OEM on a virtualBox using Oracle Linux 6

Steps:
1.install Oracle VirtualBox
2.Setup a virtual machine with 4-6 GB
3.Install Linux Software - ISO
4.Update kernel
#  yum install oracle-rdbms-server-11gR2-preinstall
5.Prepare the environment to install OEM repository Database
a).Check for updates (this will take a while to refresh):
# yum update
b).Create group and user
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
useradd -u 1100 -g oinstall -G dba,oper oracle
c).Create Passwd for oracle user
passwd oracle
d).Create Directories
mkdir -p /u01/app/oracle
mkdir -p /u01/tmp
chown -R oracle:oinstall /u01/
chmod -R 755 /u01/
e).Change the /etc/security/limits.conf file and add;
oracle   soft   nofile    4096
f).Change the  /etc/security/limits.d/90-nproc.conf
  -- Change this line
                *           soft    nproc    1024
--add this instead  this
                *          -       nproc    16384
g).Disable secure linux by editing the "/etc/selinux/config
vim /etc/selinux/config
--change line
              SELINUX=enforcing
--to this
              SELINUX=disabled
h).Disable Firewall
# service iptables save
# service iptables stop
# chkconfig iptables off
i).Add IP's to the hosts file
vim /etc/hosts
192.168.136.131     db.db.com      db          --the db repostory
192.168.136.138     upgrade         upgrade  --the OEM
j).Add the following lines to the “vim /etc/security/limits.conf” file.
oracle              soft     nproc   2047
oracle              hard    nproc   16384
oracle              soft     nofile   4096
oracle              hard    nofile   65536
oracle              soft     stack    10240
k).Add or amend the following lines to the “/etc/sysctl.conf” file
fs.aio-max-nr = 1048576
fs.file-max = 6815744
 kernel.shmall = 2097152
#kernel.shmmax = 1054504960
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
 kernel.sem = 250 32000 100 128
 net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
 net.core.wmem_default=262144
 net.core.wmem_max=1048586
l).Run the following command to change the current kernel parameters
 /sbin/sysctl –p
m).Add this to the vim /etc/pam.d/login
 session    required     pam_limits.so
n).Login as Oracle User and update .bash_profile variables
$ vim .bash_profile
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/sqldeveloper/sqldeveloper  /bin:$ORACLE_HOME/jdk/bin
export PATH
ORACLE_SID=dblab
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE ORACLE_SID TMPDIR TMP
LD_LIBRARY_PATH=$ORACLE_HOME/bin:$ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib
export LD_LIBRARY_PATH
NLS_DATE_FORMAT='DD-MON-YY HH24:MI:SS'
export NLS_DATE_FORMAT
set -o vi
EDITOR=vim
export EDITOR
ORAENV_ASK=NO
#. oraenv
o).Copy  binaries ,unzip and run the Installer to create the OMR - Oracle Management Repostory
               ./runInstaller

Run NETCA and make listener static after its complete
$netca

SID_LIST_LISTENER =
           (SID_LIST =
             (SID_DESC =
               (GLOBAL_DBNAME = dblab.world)
               (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
               (SID_NAME = dblab)
             )
           )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))
      (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.56.4)(PORT = 1521))
    )
  )
#ADR_BASE_LISTENER = /u01/app/oracle

Run DBCA to create database
$dbca 

Check if the Listener is UP (MUST be up and the database as well)
$lsnrctl status
$snrctl start

On the Repository-OMR
 sqlplus / AS SYSDBA
ALTER SYSTEM SET processes=300 SCOPE=SPFILE;
ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;
ALTER SYSTEM SET sga_target=2G SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size=600M SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target=1G SCOPE=SPFILE;
ALTER SYSTEM SET job_queue_processes=20 SCOPE=SPFILE;

 
Restart the instance
shu imediate
startup 

INSTALL OMS -Oracle Management Service
6.Install Linux software,update Kernel and set up the files as required for a standard installation---As above
7.Create groups and user
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
useradd -u 1100 -g oinstall -G dba,oper oracle
8. Create Passwd for oracle user
passwd oracle
9.set .bash_profile variables for user Oracle
vim .bash_profile

OMS_HOME=/u01/app/oracle/oms12cr4; export OMS_HOME
AGENT_BASE=/u01/app/oracle/agent_base; export AGENT_BASE
export PATH
set -o vi
EDITOR=vim
export EDITOR
ORAENV_ASK=NO
#. oraenv
10.Create Directories
$ mkdir -p /u01/app/oracle/oms12cr4
$ mkdir -p /u01/app/oracle/agent_base

11.Download the OEM binaries from oracle: em12104_linux64_disk1, em12104_linux64_disk2, em12104_linux64_disk3, copy the binaries and unzip to install
$ mkdir em12cr4
$ unzip -d em12cr4 em12104_linux64_disk1.zip
$ unzip -d em12cr4 em12104_linux64_disk2.zip
$ unzip -d em12cr4 em12104_linux64_disk3.zip
$ cd em12cr4

12.Run the installer
$ ./runInstaller
13.a) Deconfigure/Drop  the EM from the repostory-- for single instance  ON THE DATABASE
cd $ORACLE_HOME/bin
$./emca -deconfig dbcontrol db -repos drop -SYS_PWD  xxxxxx  -SYSMAN_PWD  xxxxxx
 b)Deconfigure/Drop  the EM from the repostory-- for RAC database
cd $ORACLE_HOME/bin
$./emca -deconfig dbcontrol db -repos drop -cluster -SYS_PWD xxxxxx -SYSMAN_PWD xxxxxx
 
 14.Redirect Management Agent to another host
--View OEM version
Setup menu, select Manage Cloud Control, then select Management Services.
Setup menu, select Extensibility, then select Plug-ins.
15.Add TARGET  & Discover

Add target
setup>add target manually>add host>+add>enter ipadd or domain for the host-eg 192.168.136.134> select platform/os
the host run-if not available download>click next>enter the agent_base directory-/u01/app/oracle/agent_base >+add user
credentials- use OS user eg: user:oracle,pass:oracle123(go to the db:/etc/sudoers & add oracle ALL=(ALL) ALL> next>click deploy

--Discover targets
setup>add target manually>select agent type>oracle database,listener,automatic storage management>click add using guided process>discover
the target>click search and select the host to discover from the list>click next>select target,enter password for user DBSNMP-if the user
is locked,go to the db and unlock>next to discover


Installation snapshots at a glance

Installation Details








UPGRADE Enterprise Manager 12c Cloud Control from 12.1.0.3 to 12.1.0.5

NB: Kindly note that the Repository DB  and OEM is ready installed and running

Environments: Repos db                  OEM  
 Repo_host: db.db.com                       Hostname:upgrade.db.com
 Repos_sid: DBLAB                        

--check if SYSMAN and DBSNMP has execute privilege to DBMS_RANDOM package and
--PUBLIC role has NO access to DBMS_RANDOM


SQL> GRANT EXECUTE ON dbms_random TO dbsnmp;
SQL> GRANT EXECUTE ON dbms_random TO sysman;
SQL> REVOKE EXECUTE ON dbms_random FROM public;

--Run emctl to copy EMKey from emkey.ora file to the management repository database

./emctl config emkey -copy_to_repos_from_file -repos_host db.db.com -repos_port 1521 -repos_sid DBLAB -repos_user sysman -emkey_file $OMS_HOME/sysman/config/emkey.ora

--check for invalid packages on repository database

SELECT owner, object_name, object_type,status FROM   dba_objects WHERE  status = 'INVALID' AND owner IN ('SYS', 'SYSTEM', 'SYSMAN', 'MGMT_VIEW', 'DBSNMP', 'SYSMAN_MDS');

--Compile invalid objects

SQL> EXEC UTL_RECOMP.recomp_serial('SYS');
SQL> EXEC UTL_RECOMP.recomp_serial('DBSNMP');
SQL> EXEC UTL_RECOMP.recomp_serial('SYSMAN');

--Stop the OMS

cd $OMS_HOME/oms/bin
./emctl stop oms -all

----INCASE of ERROR : Insufficient privileges to access Database Vault features

1.SQL> GRANT SELECT_CATALOG_ROLE to sys;
2.--Stop the database, Database Control console process, and listener
                               $ sqlplus sys as sysdba
                               SQL> shu immediate                       
                               $ emctl stop dbconsole
                               $ lsnrctl stop
3.--For Oracle RAC installations, shut down each database instance as follows:
                              $ srvctl stop database -d db_name
4.--Disable the Oracle Database Vault option --on the repostory DB
                             cd $ORACLE_HOME/rdbms/lib
                             $ make -f ins_rdbms.mk dv_off
                             $ cd $ORACLE_HOME/bin
                             relink all
5.--After the above is completed run;
                             $ chopt disable dv
6.--Stop the  listener ,database and the Database Control console process
                             $ lsnrctl start
                             $ sqlplus sys as sysdba
                             SQL> startup
                             $ emctl start dbconsole
---INCASE of  processes ERROR: run the alter statements and proceed
  sqlplus / as sysdba
  ALTER SYSTEM SET processes=300 SCOPE=SPFILE;
  ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;
  ALTER SYSTEM SET sga_target=2G SCOPE=SPFILE;
  ALTER SYSTEM SET shared_pool_size=600M SCOPE=SPFILE;
  ALTER SYSTEM SET pga_aggregate_target=1G SCOPE=SPFILE;
  ALTER SYSTEM SET job_queue_processes=20 SCOPE=SPFILE;

--UPGRADE AGENT after a sucessiful upgrade --on the Console

Setup>cloud control>agent upgade task> select the agents you want to upgrade>next>......>click done
Setup>cloud control>post >agent upgade task>select the agents from the list>click submit

--Before upgrade

[oracle@upgrade bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 12.1.0.3.0
OMS Version       : 12.1.0.3.0
Protocol Version  : 12.1.0.1.0

Agent Home        : /u01/app/oracle/agent_base/agent_inst
Agent Binaries    : /u01/app/oracle/agent_base/core/12.1.0.3.0
Agent Process ID  : 3187
Parent Process ID : 3140
Agent URL         : https://upgrade.db.com:3872/emd/main/
Repository URL    : https://upgrade.db.com:4904/empbs/upload
Started at        : 2015-10-15 17:25:59
Started by user   : oracle
Last Reload       : (none)
Last successful upload                       : 2015-10-15 21:48:21
Last attempted upload                        : 2015-10-15 21:48:21
Total Megabytes of XML files uploaded so far : 0.43
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 45.06%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-10-15 21:54:25
Last successful heartbeat to OMS             : 2015-10-15 21:54:25
Next scheduled heartbeat to OMS              : 2015-10-15 21:55:25

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

--After upgrade

[oracle@upgrade bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0

Agent Home             : /u01/app/oracle/agent_base/agent_inst
Agent Log Directory    : /u01/app/oracle/agent_base/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/agent_base/core/12.1.0.5.0
Agent Process ID       : 18623
Parent Process ID      : 18579
Agent URL              : https://upgrade.db.com:3872/emd/main/
Local Agent URL in NAT : https://upgrade.db.com:3872/emd/main/
Repository URL         : https://upgrade.db.com:4904/empbs/upload
Started at             : 2015-10-16 08:04:03
Started by user        : oracle
Operating System       : Linux version 3.8.13-16.2.1.el6uek.x86_64 (amd64)
Last Reload            : 2015-10-16 08:06:49
Last successful upload                       : 2015-10-16 08:49:38
Last attempted upload                        : 2015-10-16 08:49:38
Total Megabytes of XML files uploaded so far : 0.29
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 47.48%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-10-16 08:53:20
Last successful heartbeat to OMS             : 2015-10-16 08:53:20
Next scheduled heartbeat to OMS              : 2015-10-16 08:54:20

---------------------------------------------------------------
Agent is Running and Ready
Have fun and learn more !!!