required archivelog files for a guaranteed restore point 查找GRP需要的归档文件

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later

Information in this document applies to any platform.

Goal

How can you determine the required archivelog files needed for a guaranteed restore point before running flashback database?

Solution

The following query should give this information:

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 xkccrsp grsp, vdatabase_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';

相关推荐
林的快手1 小时前
MySQL
数据库·oracle
anew___2 小时前
《数据库原理》精要解读(八、九、十)—— 事务、恢复与并发:数据库内核的三大支柱
数据库·oracle
Rick19933 小时前
线上慢SQL排查完整实战案例
数据库·sql
~央千澈~3 小时前
《ZAKU渗透论:卓伊凡的2026渗透工程》第三章:Web攻击原理(上)——注入与SQL注入
数据库·sql·oracle
Yvonne爱编码4 小时前
数据库---Day9 视图(附完整数据库脚本+练习题)
数据库·mysql·oracle
cdbqss14 小时前
VB2026 动态生成工具栏类 BqGetToolStrip
数据库·oracle·开源·.net·学习方法·教育电商·basic
dishugj4 小时前
oracle索引unusable/disable/invisible的区别
oracle
Yvonne爱编码5 小时前
数据库---Day10 索引
数据库·sql·mysql
陳土15 小时前
DuckDB精读——基于Getting started with DuckDB
数据库·oracle
我是一颗柠檬17 小时前
【MySQL全面教学】MySQL性能优化实战Day13(2026年)
数据库·后端·sql·mysql·性能优化·database