| Lesson 4 | Media recovery with noarchivelog mode |
| Objective | Discuss media recovery options with noarchivelog mode. |
Media Recovery with Noarchivelog Mode in Oracle AI Database 26ai
You have some options for recovering a noarchivelog mode database after certain kinds of media failure, though which option applies depends heavily on exactly what was lost. Losing a data file can make the database unusable until either the tablespace is dropped and recreated (if the data in it was disposable) or the whole database is restored from the last consistent backup. Losing a tempfile, as this lesson will show, is a much smaller problem than it used to be.
What a Missing File Actually Looks Like
This illustrative SQL*Plus session assumes a local operating-system account authorized for
SYSDBA. Memory statistics are omitted; the file number and path are examples.
C:\> sqlplus /nolog
SQL> CONNECT / AS SYSDBA
Connected to an idle instance.
SQL> STARTUP
ORACLE instance started.
[Instance memory statistics omitted]
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: 'D:\ORADATA\ORCL\USERS01.DBF'
SQL>
SQL*Plus and
CONNECT / AS SYSDBA replace the legacy Server Manager session and
CONNECT INTERNAL that older Oracle material still shows.
The instance starts and the database mounts, but opening fails because Oracle cannot identify or lock a required data file.
ORA-01110 identifies the affected file. Examine the DBWR trace and the accompanying operating-system errors to determine whether the file is missing, inaccessible, or already in use, then restore access or perform the appropriate restore and recovery before attempting to open the database again. This example deliberately uses an ordinary data file rather than a file with a "TMP" prefix, since a filename alone doesn't establish whether something is a genuine tempfile, and the two are recovered very differently, covered next.
Not All Lost Files Are Equal
The single biggest factor in how hard a recovery is turns out to be whether the lost file ever held permanent data in the first place.
A lost tempfile is barely a recovery scenario at all. Temporary tablespaces cannot contain permanent objects, only transient sort and temporary-segment data, so RMAN doesn't even back tempfiles up. It tracks their locations in the control file instead, and during recovery it simply recreates them. If you're not going through RMAN, fixing a missing tempfile is just:
ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/oradata/orcl/temp02.dbf' SIZE 200M;
No shutdown, no downtime, no drop-and-recreate ceremony. This wasn't always true: in much older Oracle releases, before true tempfiles existed, a temporary tablespace was really just an ordinary datafile-based tablespace used only for sorting, which meant losing it actually did require the full offline-drop, drop-tablespace, and recreate cycle older training material still shows, walked through step by step with an interactive Java applet on older versions of this course's site. That applet technology has been unsupported in every modern browser since 2021, but even setting the applet aside, the underlying procedure it taught isn't wrong for what it was written against, it's just describing an architecture modern Oracle doesn't use anymore.
A lost ordinary data file is the real recovery scenario, and it's what the error demonstration above actually shows. That's covered in the practical options below.
What Media Recovery Can and Cannot Do in Noarchivelog Mode
`NOARCHIVELOG` protects against instance failure, not media failure. After losing a data file, the recoverable point is the checkpoint of the latest usable consistent whole-database backup, plus any later consistent incremental backups. Transactions after that checkpoint cannot be reconstructed, since the redo that would describe them no longer exists.
You also cannot:
- Take or reuse online (hot) tablespace backups
- Perform complete media recovery of a single damaged data file to the current time, if the needed redo sequence has already been overwritten
- Use Flashback Database or Data Guard as designed; both require ARCHIVELOG mode
If a data file needs recovery, Oracle also won't let you switch the database from ARCHIVELOG to NOARCHIVELOG until that media recovery is no longer required.
Practical Media Recovery Options
1. Restore a consistent whole-database backup (the primary option). Restore all permanent data files and control files from the same consistent backup, not only the damaged files; mixing files from different backups leaves the database inconsistent.
- Shut the instance down.
- Repair media if possible, or restore to new paths and update
CONTROL_FILES/file names accordingly.
- Copy the latest closed backup of the data files and control files into place.
STARTUP MOUNT
- Open with
ALTER DATABASE OPEN RESETLOGS if the online logs no longer match that backup, which is typical after media loss.
RESETLOGS discards every change made after the backup. That's expected in this mode, not a sign something went wrong.
2. RMAN restore plus RECOVER DATABASE NOREDO. This is the supported RMAN path when archived redo doesn't exist. The incremental backups used here must themselves be consistent, taken while the database was closed or mounted after a clean shutdown; you cannot RMAN-back up a NOARCHIVELOG database that's open read/write in the first place. Typical flow after losing data files and online logs:
STARTUP FORCE NOMOUNT;
RESTORE CONTROLFILE;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
RECOVER DATABASE NOREDO;
ALTER DATABASE OPEN RESETLOGS;
NOREDO tells RMAN to apply only the incremental backups and not search for archived or online redo; omit it and RMAN looks for logs that don't exist and fails. The recovered database reflects the last applied consistent incremental, not the moment of failure.
Example: a level 0 backup taken Sunday (closed), consistent level 1 incrementals Wednesday and Friday, media failure Saturday. Restore Sunday's full backup, apply the incrementals with
NOREDO, open with
RESETLOGS. Everything after Friday's incremental is lost.
3. Apply consistent incrementals only, rolling a baseline forward. Same
NOREDO mechanism as above, useful for shrinking your recovery point objective without enabling archiving: take frequent closed incrementals so a restore lands closer to the failure time. Every incremental still requires a consistent shutdown,
NORMAL,
IMMEDIATE, or
TRANSACTIONAL, never
ABORT.
4. Logical rebuild with Data Pump. If physical redo can't close the gap, restore an older physical backup, or start from a new empty database, and import a Data Pump export taken after that backup. This isn't physical media recovery; it rebuilds the objects and data that were actually exported, and anything not exported is still lost. Treat this as a supplement, not a substitute for consistent physical backups.
5. Temporary media failure only. If the disk comes back and the data files weren't actually overwritten, a restart may complete ordinary crash recovery from whatever's still in the online redo logs. That's instance recovery, not media recovery. A genuinely permanent loss of a data file still forces option 1 or 2.
6. Taking a data file offline in this mode. ALTER DATABASE DATAFILE ... OFFLINE in NOARCHIVELOG mode requires the
FOR DROP clause. That doesn't delete the file from the operating system, and it doesn't give you a later roll-forward path; dropping and recreating the object, or restoring the whole database, remains the real recovery path for a permanent data file.
CDB and PDB Considerations
The same rules apply inside a 26ai CDB. If a missing redo sequence prevents one restored file from reaching the current SCN, you restore the complete consistent set for the CDB root, PDB$SEED, and every affected PDB together, so they all share one recovery point; you can't media-recover just the damaged PDB's file to "now" if the redo that would get it there is already gone. RECOVER DATABASE NOREDO after a consistent whole-CDB restore is the clean RMAN response.
What You Should Actually Plan Around
| Goal | Realistic in NOARCHIVELOG? |
| Survive an instance crash | Yes, via online redo and ordinary crash recovery |
| Restore to the last consistent backup | Yes |
| Roll that backup forward with closed incrementals | Yes, using NOREDO |
| Recover one data file to its current SCN after logs are reused | No |
| Point-in-time recovery to an arbitrary moment | No, only to a backup or incremental's own checkpoint |
| Online backups, Flashback Database, Data Guard redo shipping | No |
If the workload can't accept losing everything since the last closed backup, the operational answer is still to enable ARCHIVELOG mode, usually with FORCE LOGGING too, rather than inventing a richer media recovery procedure inside NOARCHIVELOG. Frequent consistent backups and incrementals only shrink the loss window; they don't create a redo-based recovery chain that isn't there.
That's really the throughline for this whole lesson: NOARCHIVELOG mode isn't broken, and none of these options are workarounds for some missing Oracle feature. They're the honest, complete set of what's actually possible once redo has been discarded, which is exactly the trade this mode was built to make. The next lesson covers ARCHIVELOG mode itself, where most of these same failure scenarios have a very different, much less lossy answer.
A Second Possible Alternative
One other option is to use Data Pump between full backups to export critical data. You can then use Data Pump Import to restore lost data from that export. This is an incomplete recovery option, since any transactions after the last export are lost, but it gives you a way to recover at least some of your data. Data Pump itself is covered in more depth in a later module.
Media Recovery with Noarchivelog Mode - Exercise
