Tuesday, 30 May 2017

ORA-38706 ORA-38788 ORA-38706: Cannot turn on FLASHBACK DATABASE logging.

Error:
While enabling flashback in standby getting below error.

ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38788: More standby database recovery is needed
ORA-38706 ORA-38788: More standby database recovery is needed


Solution:
This could be due to inconsistency in the datafile headers try to apply the archive log to the point where all the file no of datafile are in sync.
If you are missing archive logs then try below option,This is tested on Non-RAC db.

STNDBY:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

SELECT CURRENT_SCN FROM V$DATABASE;
select hxfil FileNo, HXONS OnlineStatus, FHSTA status, FHSCN SCN, FHTHR Thread,
FHRBA_SEQ Sequence, FHTNM TABLESPACE_NAME from x$kcvfhall where FHSTA='0';


PROD: BACKUP INCREMENTAL FROM SCN <From the above output> DATABASE FORMAT '/backup/LS_EBS_RMAN/st_bk/ForStandby_%U' tag 'FORSTANDBY';

scp PROD to DR

Stby: CATALOG START WITH '/Backup location';

Stby: RECOVER DATABASE NOREDO;

PROD: BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/tmp/ForStandbyCTRL.bck';

scp PROD:/tmp/ForStandbyCTRL.bck to DR:/tmp/ForStandbyCTRL.bck
Stby:

RMAN> SHUTDOWN IMMEDIATE ;
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE STANDBY CONTROLFILE FROM '/tmp/ForStandbyCTRL.bck';
 
RMAN> SHUTDOWN;
RMAN> STARTUP MOUNT;
RMAN>  CATALOG START WITH '/u03/oracle/proddb/db/apps_st/data/';
RMAN> SWITCH DATABASE TO COPY;

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Prim:
alter system archive log current;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;

In standby: --> Make sure all the switch logs are recovered in DR
shut immediate
startup mount;
select log_mode,flashback_on from v$database;
alter database flashback on;
select log_mode,flashback_on from v$database;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

1 comment:

Unknown said...

CATALOG START WITH '/u03/oracle/proddb/db/apps_st/data/';

what is the location? whether is it datafiles location in standby side or any other ?

and why we are using again this command?