dataiotech Labs
Scripts Library/oracle/#74
Script #74
oracle
Monitoringread-onlyMin Version: 11g

Oracle Undo Usage and ORA-01555 Risk

Shows undo block status and snapshot-too-old error counts. Evaluates whether undo_retention is adequate.

#undo#ora-01555#retention
oracle · sql
SELECT status, ROUND(SUM(bytes) / 1048576, 1) AS size_mb
FROM   dba_undo_extents
GROUP  BY status;

SELECT TO_CHAR(begin_time, 'YYYY-MM-DD HH24:MI') AS begin_time,
       undoblks, txncount, maxquerylen, ssolderrcnt, nospaceerrcnt
FROM   v$undostat
WHERE  begin_time > SYSDATE - 1
ORDER  BY begin_time DESC;
Operational Notes & Remediation Guidance

ORA-01555 snapshot too old occurs when undo retention is shorter than the execution duration of long-running queries.

Production Safety & Execution Standards
  • This script is designed for read-only diagnostics; it does not alter schema or modify data directly.
  • Prior to executing on production systems under high load, verify the target database version (Min. Version: 11g).
  • Exercise caution with mutating actions (e.g., terminating sessions or dropping indexes) referenced in the notes section.

Engineering Triad: Related Runbooks & Incident Response

Which production incidents and emergency drills execute this script as a diagnosis step?

Runbook Library (63)
Related Alerts & Metrics
M44Oracle Undo: Snapshot Too Old and Space ErrorsOracle