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

相关推荐
kgduu3 小时前
js之客户端存储
javascript·数据库·oracle
Ricky_Theseus4 小时前
SQL Server 的五种约束类型
数据库·sql·oracle
IT邦德4 小时前
Oracle向量数据库实战
数据库·oracle
曹牧7 小时前
Oracle:分批查询
数据库·oracle
codkingo7 小时前
Skill:Agent 的可插拔能力单元
数据库·oracle
Boop_wu8 小时前
[MyBatis] MyBatis 快速入门(1)
数据库·oracle
欧洵.8 小时前
MySQL:事务详细
数据库·mysql·oracle
沪漂阿龙9 小时前
深度解析SQL查询:从关联查询到子查询,一文掌握数据库核心技能
数据库·sql
吠品9 小时前
MySQL LEFT() 函数:精准截取字段前N位,掌握字符串处理核心
数据库·oracle
Ricky_Theseus10 小时前
SQL Server2008 select语句基本语法
数据库·sql