Archive Log Information

SELECT    ' restore archivelog from logseq '
       || applied_arc.startNo
       || ' until logseq '
       || catalog_arc.endNo
       || ' thread='
       || catalog_arc.thread#
       || ';'
           "Restore Command"
  FROM applied_arc,
       (  SELECT thread#, MAX (sequence#) startNo
            FROM gv$archived_log
           WHERE applied = 'YES'
        GROUP BY thread#) applied_arc,
       (  SELECT thread#, MAX (sequence#) endNo
            FROM v$backup_archivelog_details
        GROUP BY thread#) catalog_arc
 WHERE applied_arc.thread# = catalog_arc.thread#;
SELECT DISTINCT
          'Thread '
       || thread#
       || ': last applied archive log '
       || sequence#
       || ' at '
       || TO_CHAR (next_time, 'MON/DD/YYYY HH24:MI:SS')
       || ' next change# '
       || next_change#
           "Applied Logs"
  FROM gv$archived_log
 WHERE thread# || '_' || sequence# IN
           (  SELECT thread# || '_' || MAX (sequence#)
                FROM gv$archived_log
               WHERE applied = 'YES'
            GROUP BY thread#);

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.