Thursday, May 14, 2020

UCP Connection Not Releasing Resources Immediately When Closed

JDBC connection created from a UCP pool does not release database resources immediately when close method is called. Java spec states calling close method "releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released. Calling the method close on a Connection object that is already closed is a no-op. It is strongly recommended that an application explicitly commits or rolls back an active transaction prior to calling the close method. If the close method is called and there is an active transaction, the results are implementation-defined."
It seems the implementation differ between implicit connection caching (ICC) pools and and UCP.
In particular UCP connections holds on to DML related locks of uncommitted transactions. Not releasing of DML related locks when close is called leads to locking and misleading error reporting such as number of rows inserted/updated. DML related locks get released only during a rollback or a commit. Connections out of an implicit connection caching (ICC) pools release the DML locks after call to close method. Issue was recreated using ojdbc10.jar (version 19.7).
The test case (code given at the end of the post) insert a single row to a table with a primary key and close the connection (without commit or rollback as those releases the locks). Then connection is checked out of the pool and it will report unique key violation even though no rows were inserted during the previous step. Querying v$lock shows table (TM) and row locks (TX) still being held by the session.
If a commit is called on connection checked out second time from the pool the previous transaction commits. It seems the transaction span connection close.
Connection out of a ICC pool doesn't exhibit this behaviour. These connections only old the TM and TX locks until connections is closed (if commit or rollback is not called before that). Once close method is called all table and row level locks are released.
Below is the output explanation of the test code given for UCP test case.
The connection pool is created with a single connection. There's no difference if more connections are the pool behaviour is the same. Only difference would be instead of unique constraint violation the second session would hang until first one is commit or rollback. First up the session id and serial# is printed. This is in case want to query the DB to verify the session locks held by the particular session..
Getting Session ID
SID 592 Serial# 54115
Test code runs to insert a single row to an empty table (table DML is given in the java code). The connection close without commit or rollback.
Insert a row and close connection without commit
Verify connection is closed. This stage the connection is returned to the pool.
Is Closed? true
Check out the connection from the pool and check the resources held by the connection. Since pool only has 1 connection it would be the same physical connection checked out previously. As seen from the output it is still holding on the table (TM) and row level (TX) locks.
Getting the connection from the pool

Resource Locks held by the previously closed session

SID TYPE ID1 ID2 LMODE Request CTime BLOCK
592 AE 100 0 4 0 1 2
592 TM 1838626 0 3 0 0 2
592 TX 29229081 62458 6 0 0 2
Moreover the connection states it had inserted one row even though it was closed and checked out again

Number of rows inserted

Rows inserted : 1
Running the same insert again results in unique key violation. Even though no rows were committed to the database. Querying the table will show 0 rows.
 Running insert again will error due to locks held by previously closed session

Getting Session ID
SID 592 Serial# 54115
Exception in thread "main" java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (ASANGA.SYS_C003916184) violated


Running the ICC pool test case doesn't result in any errors and shows 0 rows inserted for connection when checked out second time from the pool. No table and row level locks are held after connection close. Output for ICC pool test case is shown below.
Getting Session ID
SID 400 Serial# 18301

Insert a row and close connection without commit

Is Closed? true

Getting the connection from the pool


Resource Locks held by the previously closed session

SID TYPE ID1 ID2 LMODE Request CTime BLOCK
400 AE 100 0 4 0 2 2

Number of rows inserted

Rows inserted : 0

 Running insert again will error due to locks held by previously closed session

Getting Session ID
SID 400 Serial# 18301
When a SR was raised Oracle responded that this is tracked under unpublished bug 28281115. There seem to be patch available but need to be ported to 19c version. Post will be updated once the solution is provided. In mean time make note of this behaviour change when moving from ICC to UCP.

Related Posts
Auto Commit State Persists After Connection Close on UCP
java.sql.SQLException: Could not commit with auto-commit set on When Using 12c JDBC Driver
Change in 12c JDBC Behavior - setDate & getDate Does Not Truncate Timestamp
JDBC Auto Commit and Log File Sync
UCP Connections Fail to Connect to DB in Mount Mode With ORA-12504 TNS:listener was not given the SID in CONNECT_DATA
TimesTen JDBC Connection Pool Using UCP (Universal Connection Pool)
Using Oracle Connection Pools with ActiveMQ
JDBC Client Failover in Data Guard Configuration with PDBs

Update on 2020-06-01

Patch for bug 28281115 (pending transaction is not committed implicitly on conn return) is now available for 18.3 and 19.3 - 19.6 (19.7 has been requested). This fixed the issue of not releasing table locks. However, still there's a difference in behaviour between ICC and UCP. The UCP does an implicit commit when closing the connection while ICC does an implicit rollback. Make note of these differences when migrating from ICC to UCP.

Java Test Case
import java.sql.*;
import java.util.Properties;
import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceFactory;
import javax.sql.DataSource;
import oracle.jdbc.pool.OracleConnectionCacheManager;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author Asanga
 */
// table used for test case
//create table ucptest (a number, b varchar2(100), primary key (a));
public class UCPLockTest {

    static int MINVALUE = 1;
    static int MAXVALUE = 1;
    static int INITIALVALUE = 1;
    static String URL = "jdbc:oracle:thin:@192.168.1.100:1521:cgenlt1";
    static String username = "asanga";
    static String password = "asanga321";

    static int INACTIVE_TIMEOUT = 60;
    static int ABANDON_TIMEOUT = 60;
    static int PROPCHECK=45;

    static int SID;

    static DataSource ds;
    
    public static void main(String[] args) throws SQLException {

        ds = getUCPDS(); // UCP test case
//        ds = getICCDS(); //ICC test case
      

        Connection con = ds.getConnection();
        con.setAutoCommit(false);

        System.out.println("Getting Session ID");
        getSessionID(con);

        System.out.println("\nInsert a row and close connection without commit\n");
        runInsertWithoutCommit(con);
        System.out.println("Is Closed? "+con.isClosed());

        System.out.println("\nGetting the connection from the pool\n");
        con = ds.getConnection();
        con.setAutoCommit(false);
        

        System.out.println("\nResource Locks held by the previously closed session\n");
        listLocksHeldBySession(con);

        System.out.println("\nNumber of rows inserted\n");
        getRowCount(con);

        System.out.println("\n Running insert again will error due to locks held by previously closed session\n");

        System.out.println("Getting Session ID");
        getSessionID(con);

        runInsertWithoutCommit(con);

    }

    static DataSource getUCPDS() throws SQLException {

        PoolDataSource ds = PoolDataSourceFactory.getPoolDataSource();
        ds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
        ds.setURL(URL);
        ds.setUser(username);
        ds.setPassword(password);
        ds.setInitialPoolSize(INITIALVALUE);
        ds.setMinPoolSize(MINVALUE);
        ds.setMaxPoolSize(MAXVALUE);

        ds.setInactiveConnectionTimeout(INACTIVE_TIMEOUT);
        ds.setAbandonedConnectionTimeout(ABANDON_TIMEOUT);
        ds.setPropertyCycle(PROPCHECK);

        return ds;

    }

    static DataSource getICCDS() throws SQLException {

        OracleDataSource ds = new OracleDataSource();
        ds.setURL(URL);
        ds.setUser(username);
        ds.setPassword(password);

        Properties properties = new Properties();
        properties.setProperty("MinLimit", MINVALUE+"");
        properties.setProperty("MaxLimit", MAXVALUE+"");
        properties.setProperty("InitialLimit", INITIALVALUE+"");
        properties.setProperty("InactivityTimeout", INACTIVE_TIMEOUT+"");
        properties.setProperty("AbandonedConnectionTimeout", ABANDON_TIMEOUT+"");
        properties.setProperty("PropertyCheckInterval", PROPCHECK+"");

        ds.setConnectionCachingEnabled(true);

        OracleConnectionCacheManager cache = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
        cache.createCache("asa", ds, properties);
        
        return ds;
    }

    static void getSessionID(Connection con) throws SQLException {

        PreparedStatement pr = con.prepareStatement("select sid,serial# from v$session where sid=sys_context('USERENV','SID')");
        ResultSet rs = pr.executeQuery();
        while (rs.next()) {
            System.out.println("SID " + rs.getInt(1) + " Serial# " + rs.getInt(2));
            SID = rs.getInt(1);
        }
        rs.close();
        pr.close();

    }

    static void runInsertWithoutCommit(Connection con) throws SQLException {

        PreparedStatement pr = con.prepareStatement("insert into ucptest values (?,?)");
        pr.setInt(1, 1);
        pr.setString(2, "test " + new Date(System.currentTimeMillis()).toString());
        pr.execute();

        con.close();

    }

    static void listLocksHeldBySession(Connection con) throws SQLException {

        PreparedStatement pr = con.prepareStatement("select sid,type,id1,id2,lmode,request,ctime,block from v$lock where sid=?");
        pr.setInt(1, SID);
        ResultSet rs = pr.executeQuery();
        System.out.println("SID\tTYPE\tID1\tID2\tLMODE\tRequest\tCTime\tBLOCK");

        while (rs.next()) {
            int i = 0;
            System.out.print(rs.getInt(++i) + "\t");
            System.out.print(rs.getString(++i) + "\t");
            System.out.print(rs.getInt(++i) + "\t");
            System.out.print(rs.getInt(++i) + "\t");
            System.out.print(rs.getInt(++i) + "\t");
            System.out.print(rs.getInt(++i) + "\t");
            System.out.print(rs.getInt(++i) + "\t");
            System.out.println(rs.getInt(++i));
        }
        rs.close();
        pr.close();

    }

    static void getRowCount(Connection con) throws SQLException {

        PreparedStatement pr = con.prepareStatement("select count(*) from ucptest");
        ResultSet rs = pr.executeQuery();

        while (rs.next()) {

            System.out.println("Rows inserted : " + rs.getInt(1));
        }

        rs.close();
        pr.close();
    }

}

Wednesday, April 15, 2020

Auto Commit State Persists After Connection Close on UCP

By default connections checked out of universal connection pool (UCP) will have a auto commit state of true. This could be changed by setting the auto commit state on the connection. Another way to change is to change the connection pool's default setting for auto commit.
Comparing implicit connection cache (ICC) pools and UCP it appears that in UCP the auto commit state persist even after connection is closed. This means if a connection changes the auto commit state and return it to the pool and same connection is checked out later, it will have the changed auto commit state and not the default value.
This behaviour was not seen on ICC pools (ICC is considered deprecated). Once the connection is returned to the pool and checked out again, it will have the default behaviour.
The test cases is given at the end of the post. Comment/uncomment either getUCPDS or getICCDS methods to run the desired test case. The pool size is set to 1 to keep things simple. But even if it's increased the test case would work. Below is an explanation of the output seen.

UCP test case output
First up is checking the default state of auto commit
Auto commit status after checking out of the pool 

0 true
Next up the auto commit state is changed to opposite of the default. If default is true, then set to false and vice versa. Afterwards verify if the changed state is reflected on the connection. Since default auto commit state was true the opposite was false. As such now the auto commit state is reflected as false.
Setting auto commit to opposite

0 false
Following the auto commit state change the connection is closed and returned to the pool.
Connections closed and returned to the pool
Finally the connection is checked out of the pool again and auto commit state is verified. In UCP the connection will have changed state of auto commit rather than the default value, even though this is a "new" connection checked out of the pool (pools never close the underlying physical connection. So new is a logical new rather than an actual new physical connection).
Auto commit status after checking out of the pool 

0 : false

ICC test case output
The ICC test case output is same except for last step. It will also have a true state for default auto commit setting. The default state is changed to false and connection is returned to the pool.
Auto commit status after checking out of the pool 

0 true

 Setting auto commit to opposite 

0 false

Connections closed and returned to the pool 
When the connection is checked out next time from the pool it will have the default state instead of the previously changed state (unlike UCP).
Auto commit status after checking out of the pool 

0 : true
These test were carried out using ojdbc10.jar and ucp.jar versions 19.6.



The behaviour seen on UCP is same even if the default auto commit state is changed on the pool level by setting the OracleConnection.CONNECTION_PROPERTY_AUTOCOMMIT to false. In such a case the connection checked out of the pool will have auto commit set to false. But any change to this will persist same as shown above.
Auto commit status after checking out of the pool 

0 false

 Setting auto commit to opposite 

0 true

Connections closed and returned to the pool 

Auto commit status after checking out of the pool 

0 : true
When a SR was raised with regard to the difference in behaviour, Oracle support stated "When connections are created and placed in the UCP pool the connection properties that are associated with each connection remain for the duration of the connection". However, this fact is not reflected on the UCP documentation but Oracle support insisted this has always been the case. Following that the same test case was tested against ojdbc6.jar and ucp.jar of 11.2.0.1 and showed the same test output. It seems rightly or wrongly the UCP had the same behaviour throughout.
However, this difference between ICC and UCP is not listed anywhere on the documentation. Any migration from ICC to UCP should watch out for this change in behaviour.

Related Posts
java.sql.SQLException: Could not commit with auto-commit set on When Using 12c JDBC Driver
Change in 12c JDBC Behavior - setDate & getDate Does Not Truncate Timestamp
JDBC Auto Commit and Log File Sync
UCP Connections Fail to Connect to DB in Mount Mode With ORA-12504 TNS:listener was not given the SID in CONNECT_DATA
TimesTen JDBC Connection Pool Using UCP (Universal Connection Pool)
Using Oracle Connection Pools with ActiveMQ
JDBC Client Failover in Data Guard Configuration with PDBs

Java Test Case
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import javax.sql.DataSource;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.pool.OracleConnectionCacheManager;
import oracle.jdbc.pool.OracleDataSource;
import oracle.ucp.UniversalConnectionPoolException;
import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceFactory;

/**
 *
 * @author Asanga
 */
public class TestUCPAutoCommit {

    static String URL = "jdbc:oracle:thin:@192.168.1.100:1521:enlt1";
    static String username = "asanga";
    static String password = "asanga";
    static int POOL_SIZE = 1;

    static DataSource ds;

    public static void main(String[] args) throws SQLException, UniversalConnectionPoolException, InterruptedException {

        ds = getUCPDS(); // UCP test case

//        ds = getICCDS(); // ICC test case
        
        Connection[] cons = new Connection[POOL_SIZE];

        System.out.println("Auto commit status after checking out of the pool \n");
        for (int i = 0; i < cons.length; i++) {

            cons[i] = ds.getConnection();
            System.out.println(i + " " + cons[i].getAutoCommit());

        }

        System.out.println("\n Setting auto commit to opposite \n");
        for (int i = 0; i < cons.length; i++) {

            cons[i].setAutoCommit(!cons[i].getAutoCommit());
            System.out.println(i + " " + cons[i].getAutoCommit());

        }
        System.out.println("\nConnections closed and returned to the pool \n");
        for (Connection conn : cons) {
            conn.close();
        }

        System.out.println("Auto commit status after checking out of the pool \n");
        for (int i = 0; i < cons.length; i++) {

            cons[i] = ds.getConnection();
            System.out.println(i + " : " + cons[i].getAutoCommit());

        }

    }

    static DataSource getUCPDS() throws SQLException {

        PoolDataSource ds = PoolDataSourceFactory.getPoolDataSource();
        ds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
        ds.setURL(URL);
        ds.setUser(username);
        ds.setPassword(password);
        ds.setInitialPoolSize(POOL_SIZE);
        ds.setMinPoolSize(POOL_SIZE);
        ds.setMaxPoolSize(POOL_SIZE);

        /* uncomment below to set default state of auto commit to false */ 
        
//        Properties connProps = new Properties();
//        connProps.put(OracleConnection.CONNECTION_PROPERTY_AUTOCOMMIT, "false");
//        ds.setConnectionProperties(connProps);


        return ds;

    }

    static DataSource getICCDS() throws SQLException {

        OracleDataSource ds = new OracleDataSource();
        ds.setURL(URL);
        ds.setUser(username);
        ds.setPassword(password);

        Properties properties = new Properties();
        properties.setProperty("MinLimit", POOL_SIZE + "");
        properties.setProperty("MaxLimit", POOL_SIZE + "");
        properties.setProperty("InitialLimit", POOL_SIZE + "");

        ds.setConnectionCachingEnabled(true);

        OracleConnectionCacheManager cache = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
        cache.createCache("asa", ds, properties);

        return ds;
    }

}

Tuesday, March 17, 2020

Installing Enterprise Manager Cloud Control 13c (13.4)

This post shows the summary of steps for installing cloud control 13.4. There's an earlier post showing detail installation of cloud control 13.3. Installation of 13.4 is very similar if not identical to that of the installation of 13.3. Hence this post only shows the difference between the two installation. If installing 13.4 cloud control then refer this post in-conjunction with earlier post on 13.3.
One of the main changes is that 13.4 now support 12.2, 18c and 19c as the repository storage DB. For this installation a 19c (19.6) database was created with only the following components installed.
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0

SQL> select comp_id,status from dba_registry;

COMP_ID                        STATUS
------------------------------ --------------
CATALOG                        VALID
CATPROC                        VALID
RAC                            OPTION OFF
XDB                            VALID
OWM                            VALID
CONTEXT                        VALID
Once the database that will be used as the repository is created then further parameter changes are needed before EM installation could proceed. In 13.3 installation if the database did not meet the pre-reqs then a details of those pre-reqs that aren't met are shown on the OUI. This is not the case with 13.4 installation. In 13.4 a general message will be shown as below.

Exact pre-reqs that failed could be found on the log files available at the temporary directory specified at the beginning of the EM installation (more on this location later). Assuming /opt/tmp was given as the temporary directory then log files will be available in /opt/tmp/OraInstall2020-02-27_03-06-40PM/emdbprereqs/LATEST/componentLog and the log files to look for are repos_perf.log and repository.log.
Following if the list of parameters that were changed so the installation could proceed.
alter system set "_allow_insert_with_update_check"=true scope=both;
alter system set "_optimizer_nlj_hj_adaptive_join"= FALSE scope=both sid='*';
alter system set "_optimizer_strans_adaptive_pruning" = FALSE scope=both sid='*';
alter system set "_px_adaptive_dist_method" = OFF scope=both sid='*';
alter system set "_sql_plan_directive_mgmt_control" = 0 scope=both sid='*';
alter system set "_optimizer_dsdir_usage_control" = 0 scope=both sid='*';
alter system set "_optimizer_use_feedback" = FALSE scope=both sid='*';
alter system set "_optimizer_gather_feedback" = FALSE scope=both sid='*';
alter system set "_optimizer_performance_feedback" = OFF scope=both sid='*';

alter system set parallel_min_servers=0 scope=both;
alter system set parallel_max_servers=8  scope=both;
alter system set sga_max_size=7G scope=spfile;
alter system set sga_target=7G scope=spfile;
alter system set session_cached_cursors=500 scope=spfile;
alter system set shared_pool_size=600M scope=spfile;
Also manually disable the automatic stat gathering before the installation. This will be enabled by EM installation in the end. So no need to manually enable it.
exec DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'auto optimizer stats collection',operation => NULL,window_name => NULL);
Finally similar to 13.3, the redo file size must be at least 600M.
    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME     CON_ID
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ --------- ----------
         1          1          9  629145600        512          1 NO  INACTIVE                624704 27-FEB-20       624707 27-FEB-20          0
         2          1         11  629145600        512          1 NO  CURRENT                 726543 27-FEB-20   9.2954E+18                    0
         3          1         10  629145600        512          1 NO  INACTIVE                624707 27-FEB-20       726543 27-FEB-20          0
The start of the installation will fail if the default temporary location doesn't have enough storage. The installer will prompt for another location. But even a location with sufficient storage is provided the installation will fail to run.
./em13400_linux64.bin 
ERROR: Temporary directory /tmp does not have enough free space. At least 12289 MB of free space are required.
Please input another directory or [Exit]: /opt/tmp
ERROR: Cannot find component oracle.jdk.
ERROR: Cannot find components specified in JRE_COMPONENT=oracle.jdk,oracle.jre.
ERROR: Installer execution failed (1).
To fix this provide an alternative temp directory location along side the installer as below (refer 2637530.1).
./em13400_linux64.bin  -J-Djava.io.tmpdir=/opt/tmp
As said earlier the installation steps are same as 13.3 as such they are not shown here. Summary of the installation is shown below.

When prompted run the root script.
# /opt/app/software/em/middleware/allroot.sh

Starting to execute allroot.sh .........

Starting to execute /opt/app/software/em/middleware/root.sh ......
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/app/software/em/middleware

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
/etc exist
/opt/app/software/em/middleware

Finished product-specific root actions.
/etc exist
Finished execution of  /opt/app/software/em/middleware/root.sh ......

Starting to execute /opt/app/software/em/agent/agent_13.4.0.0.0/root.sh ......

Finished product-specific root actions.
/etc exist
Finished execution of  /opt/app/software/em/agent/agent_13.4.0.0.0/root.sh ......
Installation summary.




Adding Targets on 13.4

There's an earlier post on adding targets on 13.3. Steps for adding targets on 13.4 is also the same. However, there were few issues unseen on 13.3 when adding targets. This section list those issues and the solutions for them.
Even though the sudo command list mentioned on 13.3 add target was used for 13.4, the agent deploying gave the following warning.

This issue could be resolved in two ways. One is to by unchecking the "!" in the visiblepw line in /etc/sudoers file. From
Defaults   !visiblepw
to
Defaults   visiblepw
Second method is to use -S option in the previlege delegation setting (refer 1490407.1). This option was used for agent deployment in 13.4. Use of -S option is shown below.


If the listener control is restricted to IPC protocol then agent may not be able to determine the listener status without some additional work. On the EM console listener will be listed as down and agent log will have following line.
TNS-01194: The listener command did not arrive in a secure transport
To resolve this modify the listener monitor configuration on the EM console by speechifying the IPC key.

To avoid bug 22088515 grant execute on dbms_lock to dbsnmp on the target database and reload the agent (Refer 2366263.1).
SQL> GRANT EXECUTE ON sys.dbms_lock TO dbsnmp;

Grant succeeded.

 ./emctl status agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 13.4.0.0.0
OMS Version            : 13.4.0.0.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /opt/agent/agent_inst
Agent Log Directory    : /opt/agent/agent_inst/sysman/log
Agent Binaries         : /opt/agent/agent_13.4.0.0.0
Core JAR Location      : /opt/agent/agent_13.4.0.0.0/jlib
Agent Process ID       : 10845
Parent Process ID      : 10808
Agent URL              : https://rhel71.domain.net:3872/emd/main/
Local Agent URL in NAT : https://rhel71.domain.net:3872/emd/main/
Repository URL         : https://hpc8.domain.net:4903/empbs/upload
Started at             : 2020-03-02 10:26:24
Started by user        : asanga
Operating System       : Linux version 3.10.0-957.el7.x86_64 (amd64)
Number of Targets      : 10
Last Reload            : (none)
Last successful upload                       : 2020-03-05 12:58:05
Last attempted upload                        : 2020-03-05 12:58:05
Total Megabytes of XML files uploaded so far : 5.09
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 8.61%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2020-03-05 12:57:48
Last successful heartbeat to OMS             : 2020-03-05 12:57:48
Next scheduled heartbeat to OMS              : 2020-03-05 12:58:48

---------------------------------------------------------------
Agent is Running and Ready
[asanga@rhel71 bin]$ ./emctl reload agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD reload completed successfully

[asanga@rhel71 bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 13.4.0.0.0
OMS Version            : 13.4.0.0.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /opt/agent/agent_inst
Agent Log Directory    : /opt/agent/agent_inst/sysman/log
Agent Binaries         : /opt/agent/agent_13.4.0.0.0
Core JAR Location      : /opt/agent/agent_13.4.0.0.0/jlib
Agent Process ID       : 10845
Parent Process ID      : 10808
Agent URL              : https://rhel71.domain.net:3872/emd/main/
Local Agent URL in NAT : https://rhel71.domain.net:3872/emd/main/
Repository URL         : https://hpc8.domain.net:4903/empbs/upload
Started at             : 2020-03-02 10:26:24
Started by user        : asanga
Operating System       : Linux version 3.10.0-957.el7.x86_64 (amd64)
Number of Targets      : 10
Last Reload            : 2020-03-05 12:58:26
Last successful upload                       : 2020-03-05 12:58:05
Last attempted upload                        : 2020-03-05 12:58:05
Total Megabytes of XML files uploaded so far : 5.09
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 8.61%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2020-03-05 12:57:48
Last successful heartbeat to OMS             : 2020-03-05 12:57:48
Next scheduled heartbeat to OMS              : 2020-03-05 12:58:48

---------------------------------------------------------------
Agent is Running and Ready

Useful Metalink notes
EM 13.4 : Input of Different Temp Location fails with 'Cannot find component oracle.jdk.' [ID 2637530.1]
EM 12c, EM 13c: Why does Agent execute "BEGIN Dbms_lock.sleep(60)" statement Having SQL ID "g0bggfqrddc4w" in the Target Database ? [ID 2366263.1]
EM12c EM13c: Metric Collection Error for Listener Target TNS-12564: TNS:connection refused TNS-01194: The listener command did not arrive in a secure transport [ID 2296762.1]

Related Posts
Upgrading Enterprise Manager Cloud Control from 13.4 to 13.5 - 1
Adding Targets on EM Cloud Control 13c
Installing Enterprise Manager Cloud Control 13c (13.3)
Installing Grid Control 11gR1 and Deploying Agents
Upgrading Grid Control 11g to 12c - 1