Restoring a Lost Datafile from Standby Using RMAN

 If an operating system–level datafile is lost in the primary database environment, this loss can be compensated using the existing datafile on the Data Guard server (provided that the files are compatible).

In versions prior to 12c, the DBA needed to manually transfer the datafile from the Data Guard environment to the primary database at the OS level.

In 12c, this task can be performed using a single RMAN command:

— Primary:

SQL> create tablespace tbs1 datafile ‘/u01/test1.dbf’ size 10m;

SQL>
!mv /u01/test1.dbf /u01/test2.dbf
rman target /
RMAN> RESTORE DATAFILE ‘/u01/test1.dbf’ FROM SERVICE stb;



Starting restore at 05-JUL-16

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=4 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: using network backup set from service stb

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00005 to /u01/test1.dbf

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 05-JUL-16

Note: In this command, you can use the datafile number instead of its name:

RMAN>  RESTORE DATAFILE  5  FROM SERVICE  stb;

Vahid Yousefzadeh

Written by Vahid Yousefzadeh


I have been a DBA since 2011 and I work with Oracle technology. Linkdin: linkedin.com/in/vahidusefzadeh telegram channel ID:@oracledb vahidusefzadeh@gmail.com


Comments

Popular posts from this blog

Oracle 21c Enhancements for TTS Export/Import

Oracle 23ai — Speed up IMPDP Using NOVALIDATE Constraints

Staging Tables in Oracle 23ai