15 June, 2020

Datafile in a PDB added but not backed up

(I think I've covered this with a pre-12c non-PDB example earlier, but this demo is with a 12c PDB)

What happens if you add a datafile to a PDB and then lose it without having a backup of the datafile ?

Here is a quick demo

$sqlplus '/ as sysdba'

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 15 22:10:19 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter db_create_file_dest

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest       string
SQL> alter session set db_create_file_dest='/u01/app/oracle/oradata';

Session altered.

SQL> create pluggable database newpdb admin user newpdb_adm identified by newpdb_adm;

Pluggable database created.

SQL> 
SQL> alter pluggable database newpdb open;

Pluggable database altered.

SQL> alter session set container=newpdb;

Session altered.

SQL> create user hemant_newpdb identified by hemant_newpdb;

User created.

SQL> grant dba to hemant_newpdb;

Grant succeeded.

SQL> 

SQL> !vi $ORACLE_HOME/network/admin/tnsnames.ora  --- added the entry for newpdb

SQL> 
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$sqlplus hemant_newpdb/hemant_newpdb@newpdb

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 15 22:16:29 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> 
SQL> alter session set db_create_file_dest='/u01/app/oracle/oradata';

Session altered.

SQL> create tablespace my_user_data;

Tablespace created.

SQL> select file_name from dba_data_files
  2  where tablespace_name  = 'MY_USER_DATA'
  3  /

FILE_NAME
------------------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf

SQL> select file_id, file_name
  2  from dba_data_files
  3  order by 1
  4  /

   FILE_ID
----------
FILE_NAME
------------------------------------------------------------------------------------------------------------------------------------
 41
/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_system_hgh0ddlg_.dbf

 42
/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_sysaux_hgh0ddlw_.dbf

 43
/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_undotbs1_hgh0ddlw_.dbf

 44
/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf


SQL> create table my_user_data_tbl tablespace my_user_data as select * from dba_objects;

Table created.

SQL> select count(*) from my_user_data_tbl;

  COUNT(*)
----------
     72623

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


So, I now have a new PDB, a custom tablespace in the PDB and a table with data in that Tablespace.

I have NOT yet taken a backup of the PDB.

For the purpose of this demo, I will corrupt the datafile.

$cat  >/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
abcdef 
junk data
overwriting the datafile
$ls -l /u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
-rw-r----- 1 oracle oinstall 43 Jun 15 22:22 /u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
$cat /u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
abcdef 
junk data
overwriting the datafile
$


Any attempt to read or write the Datafile will fail.

$sync;sync
$sqlplus '/ as sysdba'

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 15 22:23:38 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter system flush buffer_cache;

System altered.

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$sqlplus hemant_newpdb/hemant_newpdb@newpdb

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 15 22:23:59 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jun 15 2020 22:16:29 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select count(*) from my_user_data_tbl;
select count(*) from my_user_data_tbl
                     *
ERROR at line 1:
ORA-01115: IO error reading block from file  (block # )
ORA-01110: data file 44: '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-27072: File I/O error
Additional information: 4
Additional information: 130


SQL> exit 
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$      


The sync and flush buffer_cache commands ensure that Oracle does not try to read the table blocks from memory but actually has to attempt to read the Datafile.

Now it reports that the Datafile has an error.

However, I have not taken a backup of the Datafile.

I go ahead to use RMAN to "restore" and "recover" the Datafile.

$rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Jun 15 22:30:32 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL12C (DBID=768045447)

RMAN> list failure;

using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
171        HIGH     OPEN      15-JUN-20     One or more non-system datafiles are corrupt

RMAN> advise failure;

Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
171        HIGH     OPEN      15-JUN-20     One or more non-system datafiles are corrupt

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=267 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. Automatic repairs may be available if you shutdown the database and restart it in mount mode

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 44  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u01/app/oracle/diag/rdbms/orcl12c/orcl12c/hm/reco_3798852352.hm

RMAN> 
RMAN> quit


Recovery Manager complete.
$cat /u01/app/oracle/diag/rdbms/orcl12c/orcl12c/hm/reco_3798852352.hm
   # restore and recover datafile
   sql 'NEWPDB' 'alter database datafile 44 offline';
   restore ( datafile 44 );
   recover datafile 44;
   sql 'NEWPDB' 'alter database datafile 44 online';
$
$rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Jun 15 22:31:44 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL12C (DBID=768045447)

RMAN> sql 'NEWPDB' 'alter database datafile 44 offline';

using target database control file instead of recovery catalog
sql statement: alter database datafile 44 offline

RMAN> restore ( datafile 44 );

Starting restore at 15-JUN-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=289 device type=DISK

creating datafile file number=44 name=/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
restore not done; all files read only, offline, excluded, or already restored
Finished restore at 15-JUN-20

RMAN> recover datafile 44;

Starting recover at 15-JUN-20
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 15-JUN-20

RMAN> sql 'NEWPDB' 'alter database datafile 44 online';

sql statement: alter database datafile 44 online

RMAN> exit


Recovery Manager complete.
$


Note that the message "restore not done; all files read only, offline, excluded, or already restored" can be misleading.  This occurs when RMAN actually *creates* a Datafile because there is no backup of the Datafile.

I can now query the data.

$sqlplus hemant_newpdb/hemant_newpdb@newpdb

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jun 15 22:34:40 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jun 15 2020 22:24:00 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select count(*) from my_user_data_tbl;

  COUNT(*)
----------
     72623

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$
$cd /u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile
$ls -l
total 829540
-rw-r----- 1 oracle oinstall 104865792 Jun 15 22:32 o1_mf_my_user__hgh0qyh7_.dbf
-rw-r----- 1 oracle oinstall 377495552 Jun 15 22:23 o1_mf_sysaux_hgh0ddlw_.dbf
-rw-r----- 1 oracle oinstall 262152192 Jun 15 22:40 o1_mf_system_hgh0ddlg_.dbf
-rw-r----- 1 oracle oinstall  67117056 Jun 15 22:14 o1_mf_temp_hgh0ddlw_.dbf
-rw-r----- 1 oracle oinstall 104865792 Jun 15 22:40 o1_mf_undotbs1_hgh0ddlw_.dbf


Here are the interesting messages from the alert log file :

2020-06-15T22:31:53.166607+08:00
NEWPDB(4):alter database datafile 44 offline
NEWPDB(4):Completed: alter database datafile 44 offline
2020-06-15T22:32:01.797043+08:00
Errors in file /u01/app/oracle/diag/rdbms/orcl12c/orcl12c/trace/orcl12c_m000_5900.trc:
ORA-01110: data file 44: '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-27048: skgfifi: file header information is invalid
Additional information: 2
2020-06-15T22:32:03.419839+08:00
Errors in file /u01/app/oracle/diag/rdbms/orcl12c/orcl12c/trace/orcl12c_m000_5900.trc:
ORA-01122: database file 44 failed verification check
ORA-01110: data file 44: '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-27048: skgfifi: file header information is invalid
Additional information: 2
2020-06-15T22:32:15.922471+08:00
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover
 if needed datafile 44
2020-06-15T22:32:15.939087+08:00
Media Recovery Start
2020-06-15T22:32:15.947485+08:00
Serial Media Recovery started
2020-06-15T22:32:16.148455+08:00
Recovery of Online Redo Log: Thread 1 Group 2 Seq 71 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/orcl12c/redo02.log
2020-06-15T22:32:16.536560+08:00
Media Recovery Complete (orcl12c)
Completed: alter database recover
 if needed datafile 44
2020-06-15T22:32:22.582888+08:00


Unfortunately, the alert log does not show the "creating datafile" of the RESTORE command from RMAN.  It does show that the RECOVER command actually read from the Online Redo Log file.  In fact, if there had been multiple ArchiveLogs generated since the creation of the Datafile and the attempt to RECOVER the datafile, it would read from all those ArchiveLogs at this phase.  (Of course, if any ArchiveLog was missing, the RECOVER phase would fail).

So, if you lose any Datafile, ensure that you have all the ArchiveLogs generated since the Datafile was created and RMAN would recreate and recover the datafile for you.



UPDATE 16-Jun-20 :  Yesterday, I had demonstrated the RECOVER using only the Online Redo Log file.  Here is the same demo where the RECOVER uses ArchiveLogs as well.

Since yesterday, a few ArchiveLogs have been created.

I also add to the table :

$sqlplus hemant_newpdb/hemant_newpdb@newpdb

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jun 16 22:23:40 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Mon Jun 15 2020 22:34:40 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> insert into my_user_data_tbl select * from my_user_data_tbl;

72623 rows created.

SQL> /

145246 rows created.

SQL> commit;

Commit complete.

SQL> 
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$


Now I corrupt the datafile as before :

$cat  >/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
Corrupt the file again
and again
$cat /u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
Corrupt the file again
and again
$
$sync;sync
$sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jun 16 22:27:15 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter system flush buffer_cache;

System altered.

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$sqlplus hemant_newpdb/hemant_newpdb@newpdb

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jun 16 22:27:29 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Tue Jun 16 2020 22:23:40 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select count(*) from my_user_data_tbl;
select count(*) from my_user_data_tbl
                     *
ERROR at line 1:
ORA-01115: IO error reading block from file  (block # )
ORA-01110: data file 44: '/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf'
ORA-27072: File I/O error
Additional information: 4
Additional information: 130


SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
$


Now I go into RMAN

$rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Jun 16 22:28:48 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL12C (DBID=768045447)

RMAN> list backup of datafile 44;

using target database control file instead of recovery catalog
specification does not match any backup in the repository

RMAN> sql 'NEWPDB' 'alter database datafile 44 offline';

sql statement: alter database datafile 44 offline

RMAN> restore ( datafile 44 );

Starting restore at 16-JUN-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=267 device type=DISK

creating datafile file number=44 name=/u01/app/oracle/oradata/ORCL12C/A821006A1F6B14B3E0530100007FE3FA/datafile/o1_mf_my_user__hgh0qyh7_.dbf
restore not done; all files read only, offline, excluded, or already restored
Finished restore at 16-JUN-20

RMAN> recover datafile 44;

Starting recover at 16-JUN-20
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 71 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_71_hgko9xjy_.arc
archived log for thread 1 with sequence 72 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_72_hgkofp8l_.arc
archived log for thread 1 with sequence 73 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_73_hgkofpn2_.arc
archived log for thread 1 with sequence 74 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_74_hgkofsjc_.arc
archived log for thread 1 with sequence 75 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_75_hgkofsky_.arc
archived log for thread 1 with sequence 76 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_76_hgkokj9r_.arc
archived log for thread 1 with sequence 77 is already on disk as file /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_77_hgkokjvh_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_71_hgko9xjy_.arc thread=1 sequence=71
archived log file name=/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_72_hgkofp8l_.arc thread=1 sequence=72
archived log file name=/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_73_hgkofpn2_.arc thread=1 sequence=73
archived log file name=/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_74_hgkofsjc_.arc thread=1 sequence=74
archived log file name=/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_75_hgkofsky_.arc thread=1 sequence=75
media recovery complete, elapsed time: 00:00:01
Finished recover at 16-JUN-20

RMAN> sql 'NEWPDB' 'alter database datafile 44 online';

sql statement: alter database datafile 44 online

RMAN> 
RMAN> quit


Recovery Manager complete.
$


Note how RMAN shows that ArchiveLogs 71 to 77 are still available on disk (if they had already been backed-up and deleted, I would have restored them using RESTORE ARCHIVELOG ...).
Then it shows that it applied ArchiveLogs 71 to 75.

Let's look at the alert log :

2020-06-16T22:29:48.344825+08:00
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover
 if needed datafile 44
2020-06-16T22:29:48.347256+08:00
Media Recovery Start
2020-06-16T22:29:48.369410+08:00
Serial Media Recovery started
ORA-279 signalled during: alter database recover
 if needed datafile 44
...
alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_71_hgko9xjy_.arc'
2020-06-16T22:29:48.694688+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_71_hgko9xjy_.arc
ORA-279 signalled during: alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_71_hgko9xjy_.arc'...
alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_72_hgkofp8l_.arc'
2020-06-16T22:29:49.017502+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_72_hgkofp8l_.arc
ORA-279 signalled during: alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_72_hgkofp8l_.arc'...
alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_73_hgkofpn2_.arc'
2020-06-16T22:29:49.047588+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_73_hgkofpn2_.arc
ORA-279 signalled during: alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_73_hgkofpn2_.arc'...
alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_74_hgkofsjc_.arc'
2020-06-16T22:29:49.059974+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_74_hgkofsjc_.arc
ORA-279 signalled during: alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_74_hgkofsjc_.arc'...
alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_75_hgkofsky_.arc'
2020-06-16T22:29:49.097870+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_75_hgkofsky_.arc
2020-06-16T22:29:49.103703+08:00
Recovery of Online Redo Log: Thread 1 Group 1 Seq 76 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/orcl12c/redo01.log
2020-06-16T22:29:49.217227+08:00
Recovery of Online Redo Log: Thread 1 Group 2 Seq 77 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/orcl12c/redo02.log
2020-06-16T22:29:49.442896+08:00
Recovery of Online Redo Log: Thread 1 Group 3 Seq 78 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/orcl12c/redo03.log
2020-06-16T22:29:49.511976+08:00
Media Recovery Complete (orcl12c)
Completed: alter database recover logfile '/u01/app/oracle/fast_recovery_area/orcl12c/ORCL12C/archivelog/2020_06_16/o1_mf_1_75_hgkofsky_.arc'
2020-06-16T22:29:54.072385+08:00


The alert log shows that Log Sequences 76 to 78 were the Online Redo Logs that were applied to complete the Recovery.  Note that although 76 and 77 had already been archived, since they were still available as Online Redo Logs, the RECOVER preferred to use the Online Redo Logs instead of the archive copies of these.


2 comments:

Unknown said...

Great article , please confirm if this is applicable also for RAC db or only to non Rac db only

Hemant K Chitale said...

Yes, a RAC database File Restore would behave the same. You need the ArchiveLogs from all the Threads (Instances) of the database.