In oracle 12c, if datafile is missing is standby database, then it can be restored easily from primary database using RESTORE DATAFILE FROM SERVICE command. This is one of the new feature of dataguard 12c . 

 

DEMO:

PRIMDB – Primary database

STYDB – Standby database

Check status of primary and standby database:

Lets remove one file from standby database:[STYDB]:

CHECK FROM RMAN: 

SOLUTION:

Now follow below steps to restore the datafile from primary:

NOTE : All activities need to be done on standby database

1. CANCEL THE RECOVERY( STANDBY)

2 . START STANDBY IN MOUNT STAGE( IF IN READ-ONLY MODE):

3. RESTORE THE DATAFILE ( STANDBY)

Now connect to RMAN in standby and use restore command.

SYNTAXRESTORE DATAFILE < FILE_ID> FROM SERVICE < PRIMARY DB SERVICE NAME >

4. START THE RECOVERY ( STANDBY)

5. CANCEL RECOVERY AND START DATABASE IN READ ONLY:

6 . START THE RECOVERY AGAIN:

Now all datafiles are online :

MORE ARTICLES ON STANDBY:

1. Oracle dataguard Concepts:

2. How to create physical standby database

3 . Convert physical standby database to snapshot database

4.  Switchover in physical standby database 

5. Applying PSU patch in physical standby database 

6. Rolling forward standby database if archive missing in primary – 12c