fbpx

Oracle Agent Status and Upload

road under cloudy sky

Sometimes you need to make sure the Oracle agent or cloud control agent is working properly.

Or maybe you have a problem in your could control interface, like a PDB is showing down or a listener, so you need to perform the following steps to make sure that the Oracle agent is working properly.

<AGENT_HOME>/bin/ emctl status agent
<AGENT_HOME>/bin/ emctl config agent listtargets
<AGENT_HOME>/bin/ emctl clearstate agent
<AGENT_HOME>/bin/ emctl upload agent

After you perform these steps, go back and check the status.

If you want to restart the Oracle agent, then you can use these commands

<AGENT_HOME>/bin/ emctl stop agent
<AGENT_HOME>/bin/ emctl start agent
<AGENT_HOME>/bin/ emctl status agent

If everything went well, then it should be solved.

How to Find Alert Log File Location in Oracle

cumulus clouds

In newer versions of Oracle Database it is not obvious where is the location of the alert file to investigate any potential issues.

If you want to know how to check alert log errors in Oracle, then keep reading.

You have a couple of ways to know where your Oracle alert file is located.

1. If the Oracle database is opened

You can use this query after connecting with: sqlplus / as sysdba

select * 
from v$diag_info 
where NAME = 'Diag Trace';

2. If the Oracle database is not opened

You can use adrci from the command line

# adrci

ADR base = "/u01/app/oracle"
adrci> show homes
ADR Homes:
diag/rdbms/yp001p/YP001P1
diag/rdbms/azamoa/azamoa1
diag/clients/user_oracle/host_2133002082_110
diag/tnslsnr/xm1iddb21/listener_dg
adrci>

You can see there are several homes.

If you want to check the alert file for database YP001P1 then you should use the ADR base followed by the ADR home (from the output above) and then add the trace folder at the end

cd /u01/app/oracle/diag/rdbms/yp001p/YP001P1/trace

Once in that folder you can check the alert file

ls -lrt alert*