有人问开启了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)中看可以到一些类似的说法
![]()
|
这里和我的想法不谋而合,我们可以推论:
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/