Recovering Data File in Primary Database from the standby database.

You have two approaches for data file restoration when your data file gets corrupted or deleted in data guard environment.

  1. Restore from RMAN backup
  2. Recover it from Standby Database.

In our routine, we use the first approach where we simply restore it using RMAN restore command and recover it through incremental backup or archive logs.

In the second approach, we will restore data file with help of Physical Standby database.

In this article, we will see steps for recovering data file in Primary Database using Standby database approach.

Approach 1: Restore From RMAN backup

We can simply restore it using RMAN restore and recover command.

Approach 2: Recover it from Standby Database : 

Let’s simulate this case :

Step 1: Create the tablespace

Step 2 : Create the table in test tablespace

add some records to a table.

Step 3: Manually delete the physical file of this tablespace :

Step 4: Connect with RMAN using the target as Standby and Auxiliary as Primary :

Step 5: Backup that datafile using the following command.

Step 6: Now connect primary as target and catalog as a catalog database.

Note: You need catalog database for this approach.

Step 7: Catalog datafile backup

Step 8: Run the following script to set newname for datafile and then switch it to the new name and then recover datafile.

Stay tuned for More articles on Oracle DataGuard

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.