How to Perform Oracle RMAN Backups? Procedures in NOARCHIVELOG Mode

English

Are you concerned about how to handle backups in Oracle Database when you want to operate without generating archive logs? In NOARCHIVELOG mode, you cannot perform backups while the database is running (online backups).

This article explains the procedure for taking a consistent backup involving a database shutdown to ensure reliable Oracle RMAN backups under NOARCHIVELOG mode. By following this guide, you will be able to safely perform backups in environments such as test systems.

Conclusion: NOARCHIVELOG Mode Backup Procedure (Shortest Path)

To take a backup in NOARCHIVELOG mode, the database must be in the MOUNT state.

  1. Shutdown DB: SHUTDOWN IMMEDIATE;
  2. Start in Mount Mode: STARTUP MOUNT;
  3. Execute Backup: BACKUP DATABASE;
  4. Open DB: ALTER DATABASE OPEN;

Background and Basics: What is NOARCHIVELOG Mode?

NOARCHIVELOG mode is a setting where, when the online REDO log becomes full, its contents are overwritten without being saved (archived).

  • Pros: Reduces disk I/O and space consumption caused by archive log generation.
  • Cons: In the event of a failure, data updated after the last backup cannot be recovered.

Comparison with ARCHIVELOG Mode

ItemARCHIVELOG ModeNOARCHIVELOG Mode
Data ProtectionRecoverable up to the point of failure (Complete Recovery)Recoverable only up to the time of backup
Backup TimingCan be taken while running (OPEN state)Shutdown (MOUNT state) is required
Primary Use CasesProduction environments, mission-critical systemsDevelopment/test environments, read-only DBs

Procedures and Implementation: From Mode Verification to Switching

1. Verify the Current Mode

First, check which mode the database is currently operating in.

-- Execute in SQL*Plus
SELECT LOG_MODE FROM V$DATABASE;

If the result is NOARCHIVELOG, the procedures explained in this article are required.

2. Switching the Mode (Changing to NOARCHIVELOG)

If you are currently in ARCHIVELOG mode and wish to change to NOARCHIVELOG, follow these steps:

-- Shutdown the database normally
SHUTDOWN IMMEDIATE;

-- Start in mount state
STARTUP MOUNT;

-- Change mode
ALTER DATABASE NOARCHIVELOG;

-- Open the database
ALTER DATABASE OPEN;

Execution Example: Consistent Backup via RMAN

This is an example of taking a backup using Recovery Manager (RMAN).

Prerequisite: Execute as a user with SYSDBA privileges (usually the oracle user). In a PDB environment, operations to stop and start the entire CDB are required.

Failure Example: Execution in OPEN State

If you attempt a backup while the database is in the OPEN state, the following error occurs:

RMAN> SELECT STATUS FROM V$INSTANCE;
-- STATUS: OPEN

RMAN> BACKUP DATABASE FORMAT '/u01/app/oracle/backup/db_%U.bkp';
-- RMAN-06149: cannot backup database in NOARCHIVELOG mode

Correct Execution Procedure

Shut down the database once and execute the backup in the MOUNT state.

# 1. Shutdown the database
RMAN> SHUTDOWN IMMEDIATE;

# 2. Start in mount state
RMAN> STARTUP MOUNT;

# 3. Execute backup (explicitly specifying the location)
# Do not use the "@" symbol in passwords, etc.
RMAN> BACKUP DATABASE FORMAT '/u01/app/oracle/backup/db_%U.bkp';

# Note: Once the backup is complete, an autobackup of the control file and SPFILE is performed automatically.

Intent of the SQL: BACKUP DATABASE backs up all data files. The FORMAT clause specifies the destination and filename (%U is a system-generated unique identifier).

RMAN> SELECT LOG_MODE FROM V$DATABASE;

using target database control file instead of recovery catalog
LOG_MODE
------------
NOARCHIVELOG  ★NOARCHIVELOG mode

RMAN> SELECT STATUS FROM V$INSTANCE;

STATUS
------------
OPEN  ★OPEN state

RMAN> BACKUP DATABASE FORMAT '/u01/app/oracle/backup/db_%U.bkp';  ★Backup fails

Starting backup at 25-02-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=104 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: backup command failed at 02/22/2025 00:09:51
RMAN-06149: cannot backup database in NOARCHIVELOG mode

RMAN> SHUTDOWN IMMEDIATE;  ★Shutdown

database closed
database dismounted
Oracle instance shut down

RMAN> STARTUP MOUNT;  ★Start in MOUNT

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area   1543500120 bytes

Fixed Size                     8925528 bytes
Variable Size                889192448 bytes
Database Buffers             637534208 bytes
Redo Buffers                   7847936 bytes

RMAN> BACKUP DATABASE FORMAT '/u01/app/oracle/backup/db_%U.bkp';  ★Backup

Starting backup at 25-02-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=37 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/V19/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/V19/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/V19/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/V19/rctbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/V19/users01.dbf
channel ORA_DISK_1: starting piece 1 at 25-02-22
channel ORA_DISK_1: finished piece 1 at 25-02-22
piece handle=/u01/app/oracle/backup/db_013ictk8_1_1_1.bkp tag=TAG20250222T001048 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36
Finished backup at 25-02-22

Starting Control File and SPFILE Autobackup at 25-02-22
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-2957249400-20250222-00 comment=NONE
Finished Control File and SPFILE Autobackup at 25-02-22

RMAN>

Troubleshooting: Common Errors

Error CodeCauseCountermeasure
RMAN-06149Backup executed while DB was in OPEN stateExecute again after SHUTDOWN and STARTUP MOUNT
ORA-00257(Reference) Archive area is fullDoes not occur in NOARCHIVELOG, but check for missed mode switch
ORA-01031Insufficient privilegesVerify user belongs to OS dba group and connect as sysdba

Operations and Monitoring Notes

  • Risk: If data is updated after a backup and a disk failure occurs, the updates are lost forever.
  • How to Restore (Recovery): In case of failure, perform RESTORE DATABASE and RECOVER DATABASE. Since there are no REDO logs, you can only restore back to the “consistent backup point.”
  • Recommendation: Individually backing up the control file (BACKUP CURRENT CONTROLFILE) and initialization parameters (BACKUP SPFILE) will increase recovery reliability.

FAQ: Frequently Asked Questions

Q1. Is there a way to back up without stopping the instance?

No. In NOARCHIVELOG mode, you must place the database in the mount state (or shut down) to maintain datafile consistency.

Q2. Can I back up only specific tablespaces?

Online backups of individual datafiles are not supported in NOARCHIVELOG mode. As a rule, perform a full database backup.

Q3. Where is the best place to save backup files?

Consider a disk physically separate from the database itself, or Object Storage on Oracle Cloud Infrastructure (OCI).


Summary

  • NOARCHIVELOG mode is advantageous for performance because it discards REDO logs, but it has recovery limitations.
  • When performing RMAN backups, always follow the procedure: SHUTDOWN IMMEDIATESTARTUP MOUNT.
  • In production environments, switching to ARCHIVELOG mode is strongly recommended to prepare for contingencies.

This article covers Oracle Database 19c (screens and default values may differ for other versions).

[reference]
Oracle Database Backup and Recovery Reference, 19c

コメント

Copied title and URL