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

相关推荐
imDwAaY6 小时前
一条 SQL 发出去之后,MySQL 到底做了什么?
sql·mysql
行业研究员7 小时前
Agent Memory降低Token消耗原理解析
数据库·人工智能·oracle·腾讯云·智能体
刘胡子大叔18 小时前
SQL 脚本的导入顺序
数据库·sql
薛晓刚1 天前
Oracle ADG 备库归档丢了怎么办?RMAN 增量前滚实战
数据库·oracle
阿俊-全栈开发1 天前
LikeShop 版本升级与备份:从旧版平滑迁移的完整步骤
jvm·数据库·oracle·开源·likeshop·likeshop开源商城
lvqinglou1 天前
学习Sql-part1 for婷姐
sql·学习·性能优化
蜗牛互联网1 天前
Java Agent 工具调用的 allowlist、参数校验与调用预算
java·开发语言·人工智能·后端·oracle
冰暮流星1 天前
sql之is not null运算符
数据库·sql·oracle
冰暮流星1 天前
sql之is null 运算符
java·数据库·sql