Data guard environment created earlier is used here. Steps are similar to How to Enable Flashback for a RAC Database on ASM ( 819905.1)
To enable flashback on standby bring the stop log apply on standby (transport could also be stopped for the duration).
DGMGRL> edit database rac11g2 set state='TRANSPORT-OFF';Trying to enable flashback while log apply is on will result in
Succeeded.
DGMGRL> edit database rac11g2s set state='APPLY-OFF';
Succeeded.
SQL> alter database flashback on;If the standby is open in read only mode then shutdown and bring it up only one instance in mount mode as this is required to enable flashback.
alter database flashback on
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is active
srvctl stop database -d rac11g2sOnce in mount mode enable flashback on the standby
srvctl start instance -d rac11g2s -i rac11g2s1 -o mount
SQL> alter database flashback on;Enable log apply and transport on
Database altered.
DGMGRL> edit database rac11g2 set state='TRANSPORT-ON';Open the standby mode in read only if required. Check the flashback on status of the database
Succeeded.
DGMGRL> edit database rac11g2s set state='APPLY-ON';
Succeeded.
SQL> select flashback_on from v$database;Having flashback on standby is important especially to recover from open resetlogs situations in primary. If the standby has applied changes past the new resetlog scn and there's no flashback enabled on standby, only way to recover is to recreate the standby. If flashback was enabled on standby then it could be used to flashback to a scn prior to resetlogs and continue to use the standby from then onwards.
FLASHBACK_ON
------------
YES