Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.
Goal
NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.
This documents describes the steps necessary to create, use and drop a Guaranteed restore point in a Data Guard configuration:
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
Primary database: chicago
Standby database: boston
NOTE: Starting from 19c, be aware that standby can automatically perform flashback in response to similar operation on primary. Refer:
Automatic Flashback of a Mounted Standby After a Primary RESETLOGS Operation
Solution
CREATE GUARANTEED RESTORE POINT
- Stop redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='defer'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database cancel;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-OFF';
DGMGRL> edit database boston set state = 'APPLY-OFF';
- Set GRP in standby database
On standby database:
SQL> CREATE RESTORE POINT grp_dg GUARANTEE FLASHBACK DATABASE;
- Set GRP in primary database
On primary database:
SQL> CREATE RESTORE POINT grp_dg GUARANTEE FLASHBACK DATABASE;
- Enable redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='enable'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database using current logfile disconnect;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-ON';
DGMGRL> edit database boston set state = 'APPLY-ON';
FLASHBACK DATABASE TO GUARANTEED RESTORE POINT
- Stop redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='defer'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database cancel;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-OFF';
DGMGRL> edit database boston set state = 'APPLY-OFF';
-
Shutdown Primary Database and start one instance in mount stage
-
Flashback primary database to restore point
On primary database:
SQL> flashback database to RESTORE POINT grp_dg;
SQL> alter database open resetlogs;
-
Shutdown Standby database and start one instance in mount stage
-
Flashback standby database
On standby database:
SQL> flashback database to RESTORE POINT grp_dg;
- Enable redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='enable'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database using current logfile disconnect;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-ON';
DGMGRL> edit database boston set state = 'APPLY-ON';
- If Active Data Guard licence is used, open read only the standby database
DROP GUARANTEED RESTORE POINT
- Stop redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='defer'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database cancel;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-OFF';
DGMGRL> edit database boston set state = 'APPLY-OFF';
- Drop GRP in primary database
On primary database:
SQL> drop RESTORE POINT grp_dg;
- Drop GRP in standby database
Ensure the standby database is in mount stage and drop GRP:
SQL> drop restore point grp_dg;
If Active Data Guard licence is used, open read only the standby database after dropping the GRP
- Enable redo transport and redo apply
a)If broker is not configured:
On primary database:
SQL> alter system set log_archive_dest_state_n='enable'; =====>>>>>replace n with the corresponding number for remote destinations
On standby database:
SQL> alter database recover managed standby database using current logfile disconnect;
b)If broker is in place:
DGMGRL> edit database chicago set state = 'TRANSPORT-ON';
DGMGRL> edit database boston set state = 'APPLY-ON';