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';

相关推荐
Java&Develop19 小时前
pgsql 根据一个查询sql 生成 修改sql
数据库·sql
@小柯555m20 小时前
MySql(高级查询--查找GPA最高值)
数据库·sql·mysql
黄俊懿21 小时前
复合索引设计指南:最左前缀 & 字段排座次
数据库·sql·mysql·adb·性能优化·dba·db
桃花键神21 小时前
【2026精品项目】基于SpringBoot3+Vue3的旧物置换系统(包含源码+项目文档+SQL脚本+部署教程)
数据库·spring boot·sql·vue
@小柯555m1 天前
MySql(正则表达式--电话号码格式校验)
数据库·sql·mysql·正则表达式
夕除1 天前
spring boot --07
数据库·sql
宸凉1 天前
Oracle 19C的安装
数据库·oracle
麦聪聊数据1 天前
SQL与数据库开发(五):纯 SQL 解决“连续签到”与“用户留存”问题
数据库·sql·数据库开发
AC赳赳老秦1 天前
数据安全合规:OpenClaw 敏感信息脱敏、操作日志审计、权限精细化管控方案,符合等保要求
网络·数据库·python·安全·web安全·oracle·openclaw
l1t1 天前
DeepSeek总结的无需编译器:编写纯 SQL 的 Postgres 扩展
数据库·sql·postgresql