ORASOLU TOOLBOX · BACKUP & RECOVERY

Archived Redo

Practical Oracle SQL for reviewing archived redo generation, archive destinations, log history and archive gaps.

ORASOLU TOOLBOX · BACKUP & RECOVERY

Understand how archived redo is being generated and stored

Archived redo provides the recovery history required for many backup, restore and Data Guard operations. Start with recent archive activity, then review destination status, redo sequences and any gaps that may affect recovery.

01 · RECENT ARCHIVE LOGS

Review recent archived redo

Inspect the most recently archived redo logs, including thread, sequence, size and completion time.

SELECT
    thread#,
    sequence#,
    first_time,
    next_time,
    completion_time,
    blocks,
    ROUND(blocks * block_size / 1024 / 1024, 2) AS size_mb,
    archived,
    applied
FROM v$archived_log
WHERE archived = 'YES'
ORDER BY completion_time DESC
FETCH FIRST 30 ROWS ONLY;
02 · ARCHIVE DESTINATIONS

Review archive destination status

Check the current status of configured archived redo destinations and the latest sequence sent to each one.

SELECT
    dest_id,
    destination,
    status,
    target,
    archived_thread#,
    archived_seq#,
    error
FROM v$archive_dest_status
WHERE status NOT IN ('DEFERRED', 'INACTIVE')
ORDER BY dest_id;
03 · ARCHIVE HISTORY

Review redo generation by day

Summarize archived redo volume by day to identify changes in workload and archive generation.

SELECT
    TRUNC(completion_time) AS archive_day,
    COUNT(*) AS log_count,
    ROUND(
        SUM(blocks * block_size) / 1024 / 1024 / 1024,
        2
    ) AS size_gb
FROM v$archived_log
WHERE archived = 'YES'
GROUP BY TRUNC(completion_time)
ORDER BY archive_day DESC
FETCH FIRST 14 ROWS ONLY;
04 · REDO THREADS

Review latest sequence by thread

In RAC environments, review the most recent archived sequence generated by each redo thread.

SELECT
    thread#,
    MAX(sequence#) AS latest_sequence,
    MAX(completion_time) AS latest_archive_time
FROM v$archived_log
WHERE archived = 'YES'
GROUP BY thread#
ORDER BY thread#;
05 · ARCHIVE BACKUPS

Check archived redo backup coverage

Review archived redo records and identify logs that have not yet been backed up by RMAN.

SELECT
    thread#,
    sequence#,
    completion_time,
    backup_count,
    name
FROM v$archived_log
WHERE archived = 'YES'
  AND backup_count = 0
ORDER BY completion_time DESC
FETCH FIRST 30 ROWS ONLY;
06 · ARCHIVE GAPS

Check for an archive gap

On a physical standby, identify the current archived redo gap that is blocking recovery.

SELECT
    thread#,
    low_sequence#,
    high_sequence#
FROM v$archive_gap
ORDER BY thread#;

ORASOLU TOOLBOX · BACKUP & RECOVERY

Archived redo connects backup, recovery and Data Guard.

Review archive generation and destination status together rather than looking at a single archived log in isolation. Sequence history, backup coverage and archive gaps can provide important evidence when investigating recovery or standby synchronization problems.

Oracle documents V$ARCHIVED_LOG as the source of archived log information from the control file,V$ARCHIVE_DEST_STATUS for runtime destination status, and V$ARCHIVE_GAP for the current archive gap on a standby database.