Oracle 参数之 _flashback_allow_noarchivelog

Oracle 10g闪回应用闪回日志和归档日志使得数据库闪回之前某一点,并保持一致性状态。
提供一隐含参数_flashback_allow_noarchivelog,将其设置成true后(默认是false),允许Oracle在非归档模式下打开闪回功能
引用
SQL> alter database noarchivelog;

Database altered.

SQL>  alter database flashback on;

Database altered.

SQL> alter database open;

Database altered.

启用该功能就可以在redolog scn范围内进行数据库闪回:
引用
SQL> col FIRST_CHANGE# for 99999999999999999999
SQL> select SEQUENCE# ,STATUS, FIRST_CHANGE# from v$log;

SEQUENCE# STATUS                   FIRST_CHANGE#
---------- ---------------- ---------------------
      7954 INACTIVE                 9745339541961
      7955 INACTIVE                 9745339541963
      7956 CURRENT                  9745339541972

数据闪回至9745339541961。
引用
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size                  1262020 bytes
Variable Size             973082172 bytes
Database Buffers          587202560 bytes
Redo Buffers               15511552 bytes
Database mounted.
SQL> flashback database to scn 9745339541961;
flashback database to scn 9745339541961
*
ERROR at line 1:
ORA-38770: FLASHBACK DATABASE failed during recovery.
ORA-00279: change 9745339539105 generated at 12/31/2009 09:31:08 needed for thread 1
ORA-00289: suggestion : /archlog/super/1_7950_697637328.dbf
ORA-00280: change 9745339539105 for thread 1 is in sequence #7950

可以看到数据库需要归档日志进行应用,这一错误也提示我们如果将在线日志拼装成归档日志,让Oracle识别到,在非归档模式下进行数据库闪回功能即可实现。虽然改参数在日常应用中可能不会用到,但在与Oracle相关的一些外包产品中出现“非归档模式下数据库闪回”,也是一个不错的卖点,虽然这和归档模式下闪回并没有本质的区别!


你可能感兴趣的:(thread,oracle,sql)