The Setup of an Data Guard environment with Physical Standby via Data Guard Broker was done including an Switchover. Everything fine and works as expected. (Oracle Release is 220.127.116.11 and PSU Jan 2017).
The Dev Team asked for a Flashback Database if possible a few days ago. Okay no problem. But what do I have to do exactly.
What are the steps to do? ( The requested timestamp for Flashback on the Primary DB is „07.09.2017 17:15“ )
Stop Apply on the Standby
DGMGRL> connect sys@gtdb10_11_DG Password: Connected as SYSDBA. DGMGRL> edit database gtdb10_11 set state='APPLY-OFF';
To get the Primary easily after the Flashback in Sync with the Standby you need to flashback the Standby a short time before you flashback the Primary.
Primary = „07.09.2017 17:15“
Standby = „07.09.2017 17:00“
sqlplus / as sysdba flashback standby DATABASE TO TIMESTAMP(to_date('07.09.2017 17:00','dd.mm.yyyy hh24:mi'))
Now to the Primary Database and I describe the easiest way
srvctl stop db -d gtdb10_12 sqlplus / as sysdba SQL*Plus: Release 18.104.22.168.0 Production on Mon Sep 11 13:12:32 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount SQL> flashback DATABASE TO TIMESTAMP(to_date( '07.09.2017 17:15','dd.mm.yyyy hh24:mi')) After Flashback the Primary open the DB with resetlogs SQL> alter database open resetlogs; # Stop the mounted database SQL> shutdown immediate # Restart the Primary srvctl start db -d gtdb10_12
# Now I restarted the Standby is normally not needed Standby srvctl stop db -d gtdb10_11 srvctl start db -d gtdb10_11 # Start the Apply on the Standby Database DGMGRL> connect sys@gtdb10_11_DG Password: Connected as SYSDBA. DGMGRL> edit database gtdb10_11 set state='APPLY-ON'; Succeeded.
The Dev Team can go on :-)
Important is that you have to start with Flashback on the Standby Site not on the Primary Site. Otherwise you need to recreate the whole Standby Database and that could be very time intensiv by having the risk that you work without a Physical Database during the Setup. Also the Switchover has to be redone because whole Standby Database was newly created.
If you work with „restore points“ than keep also in mind that you create the first restore point on the Standby Database and then the Restore Point on the Primary Site.