按照SCN 闪回数据库!!ORA-38754: FLASHBACK DATABASE not started; required redo log is not available

来源:互联网 发布:for循环遍历json 编辑:程序博客网 时间:2024/05/21 06:18

 按照SCN 闪回数据库!!
初始SCN号码:
SQL> select current_scn from v$database;

CURRENT_SCN
-----------
    4396569

测试数据表数据:
SQL> select count(*) from bit_accountinfo;

  COUNT(*)
----------
    15

插入数据,制作测试表!
SQL> insert into bit_accountinfo select * from bit_accountinfo;

15 rows created.

SQL> select count(*) from bit_accountinfo ;

  COUNT(*)
----------
    30

重启数据库到mount;
SQL> shutdown immediate;
ORA-01031: insufficient privileges
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  884998144 bytes
Fixed Size            2930464 bytes
Variable Size          583010528 bytes
Database Buffers      293601280 bytes
Redo Buffers            5455872 bytes
Database mounted.
SQL>

在sqlplus下闪回 到 4395976,报错!!oracle   bug!!! 用rman下闪回没问题!!
SQL> flashback database to scn 4395976;
flashback database to scn 4395976
*
ERROR at line 1:
ORA-38754: FLASHBACK DATABASE not started; required redo log is not available
ORA-38762: redo logs needed for SCN 4394725 to SCN 4395976
ORA-38761: redo log sequence 114 in thread 1, incarnation 2 could not be accessed

用rman下闪回没问题!!!
[oracle@localhost ~]$ rman

Recovery Manager: Release 12.1.0.2.0 - Production on Wed May 31 20:19:23 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target /

connected to target database: ORCL (DBID=1470239746, not open)

RMAN> flashback database to scn 4396569;

Starting flashback at 31-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 device type=DISK


starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished flashback at 31-MAY-17

完成 !!!
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

重置日志!!!
SQL> alter database open resetlogs;

Database altered.

检验恢复结果!!
SQL> select count(*) from bit_accountinfo;

  COUNT(*)
----------
    15

阅读全文
0 0
原创粉丝点击