How to restore back to restore point in primary oracle database when standby is in place


To restore a primary Oracle database to a specific restore point while a standby database is in place, we need to follow below steps:

Steps:

1. Verify restore point availability: Ensure that the restore point you want to use is available on the primary database. 

   SELECT name, SCN, time
   FROM V$RESTORE_POINT;
  
Identify the restore point name and associated SCN (System Change Number) or timestamp.

2. Stop Redo Apply on the standby database: To avoid any conflicts or inconsistencies, it's recommended to stop the redo apply process on the standby database. 

Connect to the standby database and execute the following SQL statement:

   ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;


   This command halts the redo apply process on the standby database.

3. Restore the primary database: Connect as sysdba
and perform the database restore operation using the restore point.


   RMAN> RUN
   {
     SET UNTIL RESTORE POINT 'your_restore_point_name';
     RESTORE DATABASE;
     RECOVER DATABASE;
   }
 

  This command instructs RMAN to restore the database files and recover the primary database up to the specified restore point.

4. Start Redo Apply on the standby database: Once the primary database is restored to the desired restore point, you can start the redo apply process on the standby database to synchronise it with the primary database again. 
Connect to the standby database and execute the following SQL statement:


   ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;


   This command resumes the redo apply process on the standby database, applying the changes from the primary database.




If you like please follow and comment