在已启动闪回数据库功能的基础上进行的测试
:
http://space.itpub.net/685769/viewspace-749364
一、还原点
1:分类:
1)normal restore point
2)guaranteed restore point
2:语法:
1)create restore point rp_name;
2)create restore point rp_name guarantee flashback database;
3:区别:
1)
normal检查点保存在控制文件中
2)guaranteed检查点保存在闪回日志中
3)创建了
guaranteed检查点以后,从检查点开始以后的日志不受db_recovery_retention_target参数控制
4)
normal检查点,如果超出了
db_recovery_retention_target参数的时间范围,那么检查点和闪回日志都将被删除
二、基于可靠还原点闪回数据库测试
1)在scott下创建一张表
SYS@ORA11GR2>create table scott.fbdb_grp as select 'xxf' as name from dual;
Table created.
SYS@ORA11GR2>
2)创建可靠还原点
SYS@ORA11GR2>create restore point grp_xxf guarantee flashback database;
Restore point created.
SYS@ORA11GR2>
3)删除scott用户
SYS@ORA11GR2>drop user scott cascade;
User dropped.
SYS@ORA11GR2>
4)启动到mount状态下
SYS@ORA11GR2>startup mount force;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 641732176 bytes
Database Buffers 201326592 bytes
Redo Buffers 5132288 bytes
Database mounted.
SYS@ORA11GR2>
5)基于之前创建的可靠还原点进行闪回
SYS@ORA11GR2>flashback database to restore point grp_xxf;
Flashback complete.
SYS@ORA11GR2>
6)闪回完成后,以resetlogs方式打开数据库
SYS@ORA11GR2>alter database open resetlogs;
Database altered.
SYS@ORA11GR2>
7)验证
SYS@ORA11GR2>select * from scott.fbdb_grp;
NAME
----
xxf
SYS@ORA11GR2>
三、小结
1)还原点的分类及区别要整明白。
2)在闪回的过程中,与基于时间、SCN的大同小异。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/685769/viewspace-749414/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/685769/viewspace-749414/