Query to Check for Errors in the Alert Log


SELECT 
    TO_CHAR(originating_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS error_time,
    message_text
FROM 
    v$diag_alert_ext
WHERE 
    message_text LIKE '%ORA-%'
    AND originating_timestamp >= SYSDATE - 1/24  -- last 1 hour
ORDER BY 
    originating_timestamp DESC;


SELECT 
    originating_timestamp, 
    message_text
FROM 
    v$diag_alert_ext
WHERE 
    REGEXP_LIKE(message_text, 'ORA-\d{5}')  -- Matches all ORA-XXXXX error messages
AND 
    originating_timestamp >= SYSDATE - (1/24)  -- Retrieves messages from the last 1 hour
AND 
    message_text NOT LIKE 'ORA-0%'  -- Excludes only ORA-0 errors (e.g., ORA-00000)
ORDER BY 
    originating_timestamp DESC;



Please do like and subscribe to my youtube channel: https://www.youtube.com/@foalabs If you like this post please follow,share and comment