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

相关推荐
yBmZlQzJ4 分钟前
第13天 | openGauss逻辑结构:表管理1
数据库·oracle
大气层煮月亮10 分钟前
Oracle From查看弹性域设置
数据库·oracle
许愿与你永世安宁2 小时前
RAG(检索增强生成)里的文档管理
数据库·人工智能·gpt·oracle·llama·rag
码字的字节4 小时前
深入解析Hive SQL转MapReduce的编译原理:从AST抽象语法树到Operator执行树
hive·sql·ast·mapreduce·operator
Hello World呀13 小时前
Oracle定时清理归档日志
数据库·oracle
胡斌附体13 小时前
oracle查询数据结构滤涉及的sql语句
数据结构·sql·oracle
zone_z13 小时前
Oracle 数据库共享池与大池调优指南
数据库·oracle
Albert Tan13 小时前
ORACLE DATABASE 11.2.0.4 RAC Install
数据库·oracle
姜豆豆耶13 小时前
Oracle RAC+ADG switchover 切换演练流程
数据库·oracle
jakeswang15 小时前
SQL语句中锁的使用与优化
数据库·sql·