Time for action – recovering a primary database using a standby database disk backup
Let's simulate a case where a datafile is lost by renaming one of the datafiles. Shut down the database, rename the datafile with the
mv
command, and start the database again. We'll see thecannot identify/lock data file
error on startup.SQL> shutdown immediate $ mv /u01/app/oracle2/datafile/ORCL/users01.dbf /u01/app/oracle2/datafile/ORCL/users01.dbf.old SQL> startup ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 872417392 bytes Database Buffers 671088640 bytes Redo Buffers 57692160 bytes Database mounted. ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ORA-01110: data file 4: '/u01/app/oracle2/datafile/ORCL/users01.dbf'
Now we'll run an RMAN datafile backup using the standby database as the source and locating the backup file in the primary database. Connect the standby...