What are the steps to restore and recover of an oracle database data file in noarchivelog mode?
Here are the steps to restore and recover a lost data file while the database is in noarchivelog mode.
Assumptions: There is a full backup of the database
-----Shutdown the instance if it is not shutdown and startup in mount state SQL> conn sys/orcl@to_primary as sysdba Connected. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ----- Starts the background processes, allocates memory and reads controlfiles. ORACLE instance started. Total System Global Area 2499805184 bytes Fixed Size 8749920 bytes Variable Size 687869088 bytes Database Buffers 1795162112 bytes Redo Buffers 8024064 bytes Database mounted. -----Restore the entire database; including controlfiles and system/application data files from backup SQL> $ rman target "'/ as sysbackup '" Recovery Manager: Release 12.2.0.1.0 - Production on Sat Feb 12 13:12:57 2022 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1623755738, not open) RMAN> restore database; Starting restore at 12-FEB-22 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=263 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\SYSTEM01.DBF channel ORA_DISK_1: restoring datafile 00003 to D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\SYSAUX01.DBF channel ORA_DISK_1: restoring datafile 00005 to D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\UNDOTBS01.DBF channel ORA_DISK_1: restoring datafile 00007 to D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\USERS01.DBF channel ORA_DISK_1: reading from backup piece D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\BACKUPSET\2022_02_07\O1_MF_NNNDF_TAG20220207T223402_K02X1CT0_.BKP channel ORA_DISK_1: piece handle=D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\BACKUPSET\2022_02_07\O1_MF_NNNDF_TAG20220207T223402_K02X1CT0_.BKP tag=TAG20220207T223402 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:01:26 Finished restore at 12-FEB-22 RMAN>recover database; Starting recover at 12-FEB-22 using channel ORA_DISK_1 starting media recovery archived log for thread 1 with sequence 8 is already on disk as file D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_09\O1_MF_1_8_K083SYDC_.ARC archived log for thread 1 with sequence 9 is already on disk as file D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_11\O1_MF_1_9_K0DBW8L6_.ARC archived log for thread 1 with sequence 10 is already on disk as file D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_11\O1_MF_1_10_K0F59GT1_.ARC archived log for thread 1 with sequence 11 is already on disk as file D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_11\O1_MF_1_11_K0F63TFT_.ARC archived log file name=D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_09\O1_MF_1_8_K083SYDC_.ARC thread=1 sequence=8 archived log file name=D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\ARCHIVELOG\2022_02_11\O1_MF_1_9_K0DBW8L6_.ARC thread=1 sequence=9 media recovery complete, elapsed time: 00:00:32 Finished recover at 12-FEB-22 -----open the database RMAN> alter database open; --Starts the background processes, allocates memory, reads controlfiles and opens online redo and data files. Statement processed RMAN> Finally, users are advised to re-enter all the changes that were made since the last backup
If your database has an incremental backup strategy , RMAN first restores the most recent level 0 backup and then RMAN recovery applies the incremental backup.
You must restore all data files before executing a recovery operation because the database is in noarchivelog mode.
N.B: In noarchivelog mode lost data file recovery is possible only up to the time of the last backup