Flashback database必须要有之前的archivelog吗?

探讨了Oracle数据库中FlashbackDatabase功能的工作原理及其对归档日志的依赖。文章指出,若想利用FlashbackDatabase恢复至某一时间点,不仅需要Flashbacklog,还需要归档日志来确保数据库的一致性状态。

有人问开启了DB级别的flashback( alter database flashback on )后,因为误操作想还原DB到之前的某个正常的时间点,这个时间点前的flashback log存在但 archivelog不存在了 能否成功flashback database 呢?

比如:flashback log从1月1号开始有保留,1月3号误操作想flashback db到1月2号状态,但1月1号后archivelog删除了。这样能flashback database回1月2号状态吗?

我认为是不行的。

具体讨论 http://www.itpub.net/thread-2107912-1-1.html


先看看flashback database的概率机制:

https://docs.oracle.com/cd/E11882_01/backup.112/e10642/flashdb.htm#BRADV582

官方文档有说:

To enable Flashback Database, you configure a fast recovery area and set a flashback retention target . This retention target specifies how far back you can rewind a database with Flashback Database.

From that time onwards, at regular intervals, the database copies images of each altered block in every data file into the flashback logs. These block images can later be reused to reconstruct the data file contents for any moment at which logs were captured.

大概意思是当启用flashback database后,每隔一段时间copy变化block的前镜像写入flashback log。

注:为什么是说每隔一段时间呢?

我想是 因为 如果每一次block的变化都写入flashback log话这样log文件会非常大,而Oracle采用了 隔一段 使用RVWR进程写一次。

很可惜在官方文件中没找到明确的解释,不过在论坛( https://www.cnblogs.com/gaojian/p/flashback.html

以及官方(ID 454768.1)中看可以到一些类似的说法

Can you use flashback database if a period of noarchivelog exists (文档 ID 454768.1)

In this Document


Goal

Solution

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.4 and later
Information in this document applies to any platform.
***Checked for relevance on 02-Mar-2012***


Goal

Question: Can we FLASHBACK a DATABASE after switching from Archivelog to Noarchivelog and back to archivelog?



Solution

Answer: This cannot be done. To use "FLASHBACK DATABASE", database must be in ARCHIVE LOG mode.

This is, because after doing the FLASHBACK DATABASE, we must have the REDO LOGS to roll forward the "flash backed" database to a consistent state, hence Archive logs are required!

 

这里和我的想法不谋而合,我们可以推论:

RVWR(Flashback Writer) process定时将变化block的前镜像写入flashback log。在flashback database恢复到某个时间点时先使用flashback log回滚到block变化前最近的前镜像状态,再使用arhive redo log前滚恢复数据库到指定时间一致的状态。所以archive log一定是需要保留的。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25583515/viewspace-2564198/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25583515/viewspace-2564198/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值