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

相关推荐
tryCbest5 天前
数据库SQL学习
数据库·sql
jnrjian5 天前
ORA-01017 查找机器名 用户名 以及library cache lock 参数含义
数据库·oracle
TTc_5 天前
oracle中的union和union all有什么区别?
数据库·oracle
cowboy2585 天前
mysql5.7及以下版本查询所有后代值(包括本身)
数据库·sql
努力的lpp5 天前
SQL 报错注入
数据库·sql·web安全·网络安全·sql注入
麦聪聊数据5 天前
统一 Web SQL 平台如何收编企业内部的“野生数据看板”?
数据库·sql·低代码·微服务·架构
山峰哥5 天前
吃透 SQL 优化:告别慢查询,解锁数据库高性能
服务器·数据库·sql·oracle·性能优化·编辑器
南 阳5 天前
Python从入门到精通day37
数据库·python·oracle
轩情吖5 天前
MySQL初识
android·数据库·sql·mysql·adb·存储引擎
james的分享5 天前
大数据领域核心 SQL 优化框架Apache Calcite介绍
大数据·sql·apache·calcite