How to clear "Query Execution Timed Out" (or) "Socket Read Timed Out" error alerts during Oracle monitor data collection?

How to clear "Query Execution Timed Out" (or) "Socket Read Timed Out" error alerts during Oracle monitor data collection?

How to clear "Query Execution Timed Out" (or) "Socket Read Timed Out" error alerts during Oracle monitor data collection?

Applications Manager may report a Query Execution Timed Out or Socket Read Timed Out alert when an Oracle query takes longer than the configured timeout. 

Symptoms

You may see one of the following messages during Oracle monitor data collection:

Warning
Socket read timed out due to this query group(s): xxxxxxxx Error Message: java.sql.SQLRecoverableException: IO Error: Socket read timed out.

or:

Warning
Query execution timed out due to this query group(s): xxxxxxxx Error Message: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation.

Here, xxxxxxxx represents the query group name.


On this page

Solution

If the alert is "Query execution timed out"

From the Applications Manager GUI, go to the respective Oracle Monitor's details page:

Monitor Actions  →  Edit Monitor  →  Query Execution Timeout

Increase the seconds configured in the Query Execution Timeout field.

If the alert is "Socket read timed out"

From the Applications Manager GUI, go to the respective Oracle Monitor's details page:

Monitor Actions  →  Edit Monitor  →  Socket Read Timeout

Increase the seconds configured in the Socket Read Timeout field.

Important: If the query group reported in the alert is INSTANCESTATUS or TABLESPACESTATUS and the alert still continues after increasing the timeout, perform the Oracle database steps below with the help of your Oracle DBA.

INSTANCESTATUS / TABLESPACESTATUS Query Group Timeout

The INSTANCESTATUS / TABLESPACESTATUS timeout can occur when queries against the Oracle data dictionary view DBA_FREE_SPACE take a long time to execute.

1. Check the Recycle Bin

Run the following query in the corresponding Oracle database:

SQL> SELECT count(*) FROM dba_recyclebin;
Why this matters: In Oracle 10g and later, DBA_FREE_SPACE includes objects in the recycle bin. A large number of objects in the recycle bin can cause queries against DBA_FREE_SPACE to take longer.

2. Purge the Recycle Bin

If the recycle-bin count is high, purge the recycle bin with the help of your Oracle DBA:

SQL> PURGE dba_recyclebin;

Perform the purge only after confirming with the customer/Oracle DBA that the recycle-bin objects can be permanently removed.

3. Gather Dictionary and Fixed Object Statistics

With the customer's permission and with the help of the Oracle DBA, gather dictionary and fixed-object statistics:

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
Multi-tenant Oracle databases: For Oracle environments using multitenant architecture, the Container Database (CDB) and Pluggable Databases (PDBs) require independent recycle-bin purging.
After performing the above steps, allow the next data collection to run and check whether the INSTANCESTATUS / TABLESPACESTATUS timeout is resolved.

Important: If the query group reported in the alert is Oracle OracleAlertLogList and the alert still continues after increasing the timeout, perform the Oracle database steps below with the help of your Oracle DBA.

OracleAlertLogList Query Group Timeout

If the query group reported in the alert is OracleAlertLogList, the slowness may be caused by a large Oracle alert-log history. The query used by this query group is:


If 12C or Above:
SELECT DECODE(MESSAGE_LEVEL,1,'CRITICAL',2,'SEVERE',8,'IMPORTANT',16,'NORMAL',MESSAGE_LEVEL) AS MESSAGE_LEVEL,
RECORD_ID,
ORIGINATING_TIMESTAMP,
HOST_ID AS HOST_ADDRESS,
MESSAGE_TEXT
FROM V$DIAG_ALERT_EXT
WHERE TRIM(COMPONENT_ID) = 'rdbms'
AND MESSAGE_TEXT LIKE '%ORA-%'
AND originating_timestamp > (SYSDATE - 15/1440);


If Below 12C:
SELECT DECODE(MESSAGE_LEVEL,1,'CRITICAL',2,'SEVERE',8,'IMPORTANT',16,'NORMAL',MESSAGE_LEVEL) AS MESSAGE_LEVEL,
RECORD_ID,
ORIGINATING_TIMESTAMP,
HOST_ID AS HOST_ADDRESS,
MESSAGE_TEXT
FROM v$appman_alertlog_ext
WHERE TRIM(COMPONENT_ID) = 'rdbms'
AND MESSAGE_TEXT LIKE '%ORA-%'
AND originating_timestamp > (SYSDATE - 15/1440);
When the Oracle alert-log history is very large, this query can take a long time to execute. In such cases, check the size and number of files in the Oracle ADR alert directory and purge old ADR alert data if appropriate.

Step 1: Check the ADR alert repository

Run the following commands in ADRCI:

adrci> show homes

adrci> set homepath diag/rdbms/<dbname>/<instance>

adrci> show alert -tail 1

Replace the following placeholders with the appropriate values for your Oracle environment:

  • <dbname> – Oracle database name.
  • <instance> – Oracle instance name.

Step 2: Check the number of alert files at the OS level

At the operating-system level, run:

ls $ADR_BASE/diag/rdbms/<dbname>/<instance>/alert | wc -l
What to check: If the alert directory contains thousands of fragmented XML files, especially on databases that have been running for many years without regular ADR purging, queries against V$DIAG_ALERT_EXT/v$appman_alertlog_ext may take a very long time. The external-table mechanism may need to inspect and parse a large number of alert-log files before predicates can be applied efficiently.

Step 3: Purge old ADR alert data

With the help and approval of your Oracle DBA, purge old alert-log data using:

adrci> purge -age 43200 -type ALERT
About -age 43200: The -age value is specified in minutes. 43,200 minutes = 30 days. The command therefore purges ALERT data older than 30 days and retains the most recent 30 days of alert-log data in the ADR repository.

Adjust the above retention period according to your organization's Oracle ADR retention requirements. Do not perform the purge if older alert-log data must be retained for auditing, troubleshooting, or other operational requirements.

Step 4: Re-run the OracleAlertLogList query

After the ADR purge is completed, execute the query shown above directly on the Oracle database and check its execution time.

Next step: If the purge is completed successfully, please execute the highlighted V$DIAG_ALERT_EXT/ v$appman_alertlog_ext select query above and share the execution result and timing with ManageEngine Support for further analysis.

Additional Information

  • ADR purging should be performed with the knowledge and approval of the Oracle DBA.
  • The recommended retention period may vary depending on the customer's operational and audit requirements.
  • If the query remains slow even after reducing the volume of historical ADR alert data, share the query execution details and relevant Applications Manager logs with ManageEngine Support.

For other query groups: If the reported query group is not INSTANCESTATUSTABLESPACESTATUS, or OracleAlertLogList, contact ManageEngine Support at appmanager-support@manageengine.com along with the latest Support Information File (SIF) generated with Print All Logs enabled from Applications Manager.