We have to follow the below steps to sync the standby database with Primary after flashback operation on Primary. Here we are used Dataguard Broker for Configuration.
Step-1
Do the Flashback operation on primary database.
SQL> select * from v$restore_point;
SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME RESTORE_POINT_TIME PRE NAME
4127139 157286400 YES 2 02-APR-13 01.05.40.000000000 AM YES FBTESTDG
SQL> shut immediate
SQL> startup mount
SQL> flashback database to restore point fbtestdg;
Flashback complete.
SQL> alter database open resetlogs;
Database altered.
SQL> archive log list
SQL> alter system switch logfile;
System altered.
Step-2
Check the status of Standby Database. It will give the Error Message.
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
ECPIXSTB - Physical standby database
Error: ORA-16810: multiple errors or warnings detected for the database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
Step-3
Flashback the Standby database to two less than production SCN i.e. 4127139-2=4127137
Sql> flashback database to scn 4127137;
Step-4
Enable redo apply for Standby database.
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
Error: ORA-16778: redo transport error for one or more databases
ECPIXSTB - Physical standby database
Error: ORA-16766: Redo Apply is stopped
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
DGMGRL> edit database ecpixstb set state=apply-on;
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
ECPIXSTB - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
Step-1
Do the Flashback operation on primary database.
SQL> select * from v$restore_point;
SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME RESTORE_POINT_TIME PRE NAME
4127139 157286400 YES 2 02-APR-13 01.05.40.000000000 AM YES FBTESTDG
SQL> shut immediate
SQL> startup mount
SQL> flashback database to restore point fbtestdg;
Flashback complete.
SQL> alter database open resetlogs;
Database altered.
SQL> archive log list
SQL> alter system switch logfile;
System altered.
Step-2
Check the status of Standby Database. It will give the Error Message.
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
ECPIXSTB - Physical standby database
Error: ORA-16810: multiple errors or warnings detected for the database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
Step-3
Flashback the Standby database to two less than production SCN i.e. 4127139-2=4127137
Sql> flashback database to scn 4127137;
Step-4
Enable redo apply for Standby database.
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
Error: ORA-16778: redo transport error for one or more databases
ECPIXSTB - Physical standby database
Error: ORA-16766: Redo Apply is stopped
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
DGMGRL> edit database ecpixstb set state=apply-on;
DGMGRL> show configuration
Configuration - DG1
Protection Mode: MaxPerformance
Databases:
ECPIX - Primary database
ECPIXSTB - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS