Veritabanımızı birkaç gün önce aldığımız restore point’e dönmek istiyoruz, flashback yaptığımızda alertlog’da flashback’in başarılı olduğunu ancak ardından recovery yaparken hata aldığını görüyoruz. Asagidaki gibi hata gelirse ve archive yoksa:

Errors in file /u02/app/oracle/diag/rdbms/testdb/TESTDB1/trace/TESTDB1_pr00_337067.trc:
ORA-38795: warning: FLASHBACK succeeded but OPEN RESETLOGS would get error below
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '+DATA/testdb/datafile/system.2009.987865643'
ORA-38795 signalled during: alter database recover cancel...

Kaç datafile da recovery ihtiyaci var:

set linesize 1000
select fuzzy, status, checkpoint_change#,
to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS') as checkpoint_time,
count(*)
from v$datafile_header
group by fuzzy, status, checkpoint_change#, checkpoint_time
order by fuzzy, status, checkpoint_change#, checkpoint_time;

hidden parametre set edilir:

alter system set "_allow_resetlogs_corruption"=true scope=spfile;

alter system set undo_management='MANUAL' scope=spfile;

shutdown abort;
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 2.1379E+11 bytes
Fixed Size 2265864 bytes
Variable Size 1.3100E+11 bytes
Database Buffers 8.2678E+10 bytes
Redo Buffers 112762880 bytes
Database mounted.
SQL> alter database open resetlogs;

Database altered.

Restart edilir:

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Undo yaratilir:

CREATE UNDO TABLESPACE UNDOTBS3 DATAFILE 
'+DATA' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED,
'+DATA' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED,
'+DATA' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED
ONLINE
RETENTION GUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;


alter system set undo_tablespace='UNDOTBS3' scope=spfile;

alter system set undo_management='AUTO' scope=spfile;

Restart edilir:

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2.1379E+11 bytes
Fixed Size 2265864 bytes
Variable Size 1.3100E+11 bytes
Database Buffers 8.2678E+10 bytes
Redo Buffers 112762880 bytes
Database mounted.
Database opened.