Query Alert Log
Query Alert Log
Query Alert Log
----------------------------------------------------------------
-- last 500 alerts
----------------------------------------------------------------
SELECT LINENO,MESSAGE_TEXT, originating_timestamp
FROM (SELECT ROWNUM AS lineno, MESSAGE_TEXT, originating_timestamp
FROM x$dbgalertext
)
WHERE lineno > (SELECT COUNT (*) - 500 FROM x$dbgalertext)
--AND message_text like '%ORA-%'
ORDER BY lineno
----------------------------------------------------------------
-- Errors in last 300 alerts
----------------------------------------------------------------
SELECT * FROM sys.last_300_alerts
where message_text like '%ORA-%'
/
----------------------------------------------------------------
-- Errors in last 500 alerts
----------------------------------------------------------------
SELECT LINENO,MESSAGE_TEXT, originating_timestamp
FROM (SELECT ROWNUM AS lineno, MESSAGE_TEXT, originating_timestamp
FROM v$alert_log
)
WHERE lineno > (SELECT COUNT (*) - 500 FROM v$alert_log)
AND message_text like '%ORA-%'
ORDER BY lineno
/
----------------------------------------------------------------
-- last 300 messages from alert log
----------------------------------------------------------------
----------------------------------------------------------------
-- view definition LAST_300_ALERTS
----------------------------------------------------------------
CREATE OR REPLACE FORCE VIEW LAST_300_ALERTS
(
LINENO,
MESSAGE_TEXT,
ORIGINATING_TIMESTAMP
)
AS
SELECT lineno, MESSAGE_TEXT, originating_timestamp
FROM (SELECT ROWNUM AS lineno, MESSAGE_TEXT, originating_timestamp
FROM v$alert_log)
WHERE lineno > (SELECT COUNT (*) - 300 FROM v$alert_log)
ORDER BY lineno;
----------------------------------------------------------------
-- view V$ALERT_LOG
----------------------------------------------------------------