Friday, June 26, 2020

archivelog needed for a GRP before running flashback database..

archivelog files needed for a guaranteed restore point before running flashback database?



SELECT DISTINCT al.thread#, al.sequence#, al.resetlogs_change#, al.resetlogs_time
    FROM v$archived_log al,
         (select grsp.rspfscn               from_scn,
                 grsp.rspscn                to_scn,
                 dbinc.resetlogs_change#    resetlogs_change#,
                 dbinc.resetlogs_time       resetlogs_time
            from x$kccrsp grsp,  v$database_incarnation dbinc
           where grsp.rspincarn = dbinc.incarnation#
             and bitand(grsp.rspflags, 2) != 0
             and bitand(grsp.rspflags, 1) = 1 -- guaranteed
             and grsp.rspfscn <= grsp.rspscn -- filter clean grp
             and grsp.rspfscn != 0
         ) grsp
      WHERE al.next_change#   >= grsp.from_scn
          AND al.first_change#    <= (grsp.to_scn + 1)
          AND al.resetlogs_change# = grsp.resetlogs_change#
          AND al.resetlogs_time       = grsp.resetlogs_time
          AND al.archived = 'YES';


Sample Output:
SQL> !date
Sun Jun 28 13:31:20 UTC 2020



   THREAD#  SEQUENCE# RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ----------------- ---------
         1         32           1920977 24-JUN-20
         1         30           1920977 24-JUN-20
         1         31           1920977 24-JUN-20
         1         29           1920977 24-JUN-20
         1         34           1920977 24-JUN-20
         1         33           1920977 24-JUN-20


6 rows selected.

No comments:

Post a Comment

student guide Dataguard: GLOBAL_DBNAME = <dbuniquename>_DGMGRL.example.com  Example: listener.ora on Primary Hosts Static listener ent...