| Lesson 3 | Evaluating operating system backup options |
| Objective | Describe the available user-managed physical backup options. |
A user-managed physical backup is a copy of Oracle database files made with an operating-system utility, a storage utility, or an approved snapshot mechanism. The database administrator uses SQL or SQL*Plus commands to place the database files in an appropriate state, identifies every file that must be protected, creates the copies, and preserves the redo and metadata needed for recovery.
Oracle AI Database 26ai continues to support this approach for self-managed databases. However, Recovery Manager (RMAN) is the preferred tool for routine production backup and recovery. RMAN understands Oracle block structures, discovers database files, records backup metadata, checks for fractured blocks, supports incremental backups, and integrates backup validation, compression, encryption, and media-management destinations. An ordinary file-copy program does not provide those safeguards.
It is important to separate two decisions that the legacy terminology sometimes combines:
ARCHIVELOG or NOARCHIVELOG.The logging mode determines which user-managed backup procedures are safe and how far the database can be recovered. A consistent closed backup
can be made in either mode. An online or otherwise inconsistent user-managed backup requires ARCHIVELOG mode and all redo needed to make
the restored files consistent.
Oracle AI Database 26ai uses the multitenant architecture. A container database (CDB) contains the root and one or more pluggable databases
(PDBs). Consequently, the administrator must know whether a procedure protects the complete CDB or the data files of a particular PDB, and must
connect to the correct container with the required SYSDBA or SYSBACKUP privilege.
Before selecting a procedure, check the current logging mode:
SELECT log_mode
FROM v$database;
In ARCHIVELOG mode, Oracle archives a filled online redo log before that log can be reused. Retaining the required archived redo gives
media recovery a history of database changes to apply after a backup is restored. In NOARCHIVELOG mode, online redo logs can be reused
without preserving that history. This substantially limits recovery after a media failure.
| Capability | ARCHIVELOG mode | NOARCHIVELOG mode |
|---|---|---|
| Consistent closed user-managed backup | Supported | Supported and the normal safe whole-database method |
| Online user-managed backup of read/write data files | Supported when the files are placed in backup mode | Not supported as a recoverable strategy |
| Recovery after restoring an inconsistent backup | Possible when every required redo record is available | Not possible from overwritten, unarchived redo |
| Recovery beyond the last consistent backup | Possible when the recovery chain is complete | Generally unavailable |
| Database point-in-time recovery | Available within retained backup and redo coverage | Not available from unarchived redo history |
A consistent backup is created when the database files are at a consistent system change number (SCN). For a complete CDB, this
normally means shutting down with SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL before copying
the files. A clean shutdown checkpoints the data files and makes their contents consistent with the control file. If the complete backup is later
restored, it can ordinarily be opened at the backup point without media recovery. If the database was in ARCHIVELOG mode, additional
redo may be applied to recover it to a later point.
An inconsistent backup contains files that are not all consistent at one SCN. A backup made while the database is open is
inconsistent. A copy made after an instance failure or SHUTDOWN ABORT is also inconsistent because crash recovery has not yet made the
files consistent. After restoring such a backup, Oracle must apply redo during media recovery before opening the database.
An inconsistent backup must not be used as the protection strategy for a NOARCHIVELOG database. The redo required to make the restored
files consistent may already have been overwritten. For that logging mode, the dependable rule is to perform a complete backup after a clean
shutdown.
An ARCHIVELOG database supports both consistent closed backups and online user-managed backups. The online option improves availability
because applications can continue to use the database while its data files are copied. The tradeoff is that the restored copies require redo, and
the administrator must correctly coordinate backup mode, archived redo retention, control-file protection, and recovery testing.
The figure shows the essential relationship among database files, backup mode, the operating-system copy, and the archived redo required for recovery. The backup copy alone is not a complete recovery chain. The administrator must retain all archived redo logs needed from the backup's checkpoint through the selected recovery target, along with the necessary control-file metadata and security material.
An operating-system utility copies bytes without understanding Oracle block boundaries. While DBWR is writing a data block, a copy utility could read one portion before the database write and another portion afterward. The resulting copy contains a fractured block whose header and footer do not describe one consistent version of the block.
Before copying the data files of an online read/write tablespace, place that tablespace in backup mode. End backup mode immediately after the copy finishes, and force the current redo to be archived:
ALTER TABLESPACE users BEGIN BACKUP;
-- Copy every data file belonging to USERS with an approved OS or storage utility.
ALTER TABLESPACE users END BACKUP;
ALTER SYSTEM ARCHIVE LOG CURRENT;
If all applicable data files are copied together, the database-wide form can bracket the copy:
ALTER DATABASE BEGIN BACKUP;
-- Copy the applicable data files.
ALTER DATABASE END BACKUP;
ALTER SYSTEM ARCHIVE LOG CURRENT;
Backup mode freezes the checkpoint information in the data-file header and causes complete images of changed blocks to be written to redo. That extra information enables recovery to repair a fractured block in the copy. It can also generate substantially more redo during a busy workload, so files should remain in backup mode only for the required copy interval.
After a failed copy, instance failure, or interrupted script, verify that no data files remain in backup mode:
SELECT file#, status, change#, time, con_id
FROM v$backup
WHERE status = 'ACTIVE';
Do not issue an indiscriminate END BACKUP after files have been restored. The correct response depends on whether the files are current
or restored copies that require recovery. This is one reason user-managed recovery procedures require careful runbooks and testing.
With a valid backup and a complete redo history, an ARCHIVELOG database can support complete media recovery or database point-in-time
recovery. Complete recovery attempts to apply all available changes and return the database to the most current possible state. Point-in-time
recovery deliberately stops at a selected time, SCN, or other supported recovery boundary.
ARCHIVELOG mode does not itself guarantee zero data loss or recovery to the exact failure point. A required archived redo log may be
missing, an online redo member may be damaged, a backup may be corrupt, or encryption material may be unavailable. The achievable recovery point is
determined by the usable backup and redo chain that survives the incident.
For a database operating in NOARCHIVELOG mode, use a consistent closed whole-CDB backup as the normal user-managed method. The database
must be shut down cleanly before the files are copied. A simple teaching outline is:
SHUTDOWN IMMEDIATE;
-- Copy all required data files and every control-file member.
STARTUP;
This is an abbreviated pattern, not a complete production script. A real procedure must obtain the authoritative file list, select protected destinations, check copy failures, preserve initialization and security files, and document how the files will be restored.
After a media failure, restoring this backup normally returns the database to the state captured at the backup point. Transactions committed after the backup cannot be reconstructed from archived redo because those logs were not retained. The amount of potential data loss therefore equals the work performed since the most recent usable consistent backup.
NOARCHIVELOG mode may be acceptable for a disposable development database or another system whose owners accept backup downtime and
loss of post-backup changes. It is usually unsuitable when a production recovery-point objective requires recovery beyond the most recent closed
backup.
User-managed backups can operate at a narrower scope than the complete CDB, but each choice has prerequisites and recovery consequences.
Before copying an offline tablespace, identify all its data files from DBA_DATA_FILES. Take the tablespace offline with
OFFLINE NORMAL when possible because that status permits it to return online without first requiring recovery. After copying its data
files, bring the tablespace online and, in an ARCHIVELOG database, archive the current redo so the recovery boundary is preserved.
SELECT tablespace_name, file_name
FROM dba_data_files
WHERE tablespace_name = 'USERS';
ALTER TABLESPACE users OFFLINE NORMAL;
-- Copy every listed USERS data file.
ALTER TABLESPACE users ONLINE;
ALTER SYSTEM ARCHIVE LOG CURRENT;
The SYSTEM tablespace and a tablespace containing active undo segments cannot be taken offline for this procedure. Taking related data
and index tablespaces offline independently can also disrupt application activity, so dependencies must be considered.
An online read/write tablespace must be placed in backup mode before an operating-system copy begins. By contrast, the data files of an online read-only tablespace can be copied without backup mode because the database prevents changes to those files. If a restored read-only backup must be advanced through a period when the tablespace later became read/write, recovery and the corresponding redo are still required.
Do not copy temporary tablespace tempfiles as part of the normal backup. Tempfiles do not contain permanent database objects and can be recreated. Also, do not copy active online redo log files as backup files. Multiplexed online redo members improve availability, but they are active database files rather than backup copies.
To make a user-managed copy of a PDB's data files while it is open, connect to that PDB as a common or local user with SYSDBA or
SYSBACKUP. Use the database-level backup-mode commands in the PDB, copy the PDB data files, and then end backup mode:
ALTER DATABASE BEGIN BACKUP;
-- Copy the data files belonging to the connected PDB.
ALTER DATABASE END BACKUP;
The connection context is significant. These commands protect the data files belonging to the connected PDB; they do not replace CDB-level protection for the control file, root metadata, required redo, or other recovery dependencies.
Control files contain essential structural and recovery metadata. In an ARCHIVELOG database, the preferred user-managed method creates
a binary control-file backup:
ALTER DATABASE BACKUP CONTROLFILE TO '/backup/cf.bak' REUSE;
A binary backup preserves information that a trace script does not fully retain, including archived log history and information about offline or
read-only ranges. Create a new control-file backup after structural changes such as adding or dropping a tablespace or data file. When making a
consistent closed whole-CDB copy, copy every control-file member identified by the CONTROL_FILES parameter.
A practical recovery plan must also protect or document:
Network and listener configuration files are disaster-recovery assets, but they are not Oracle database physical backup files. Inventory them
deliberately instead of assuming that copying every file with an *.ora extension produces a complete or secure recovery package.
A storage snapshot is not automatically an Oracle-valid backup merely because it is crash consistent at the storage layer. For a snapshot of an
open database, use an integration validated for Oracle, take the relevant files offline, or bracket the snapshot with supported
ALTER DATABASE BEGIN BACKUP and ALTER DATABASE END BACKUP procedures. Archived redo must be protected separately when it is
needed for recovery.
The former RECOVER ... SNAPSHOT TIME method is desupported in Oracle AI Database 26ai. Current snapshot planning should use supported
backup-mode procedures and ordinary recovery to a specified time or SCN where appropriate. Storage replication and snapshots can improve recovery
speed, but they do not replace independent, tested backups because they may reproduce corruption, unwanted changes, or administrative deletion.
| Evaluation area | RMAN | User-managed copy |
|---|---|---|
| File discovery | Uses Oracle metadata to identify required files | The administrator must identify and track files |
| Online backup mode | Not required for an RMAN backup | Required for online read/write data-file copies |
| Fractured-block handling | Checks blocks and rereads a fractured block | A generic copy utility is not Oracle block-aware |
| Incremental backups | Supported | Not provided by a basic file copy |
| Backup sets | Supported | Produces image-copy files rather than RMAN backup sets |
| Repository metadata | Recorded in the control file and optionally a recovery catalog | Must be documented or cataloged separately |
| Validation | Provides backup and restore validation operations | Requires separate integrity and recovery testing |
Oracle AI Database 26ai expands RMAN integration through native SBT libraries available from the Oracle home for supported cloud and Recovery Appliance destinations. Destination configuration is environment-specific, but this integration illustrates why RMAN is normally the operational default. User-managed copies remain appropriate for specialized procedures, validated storage workflows, or environments with a carefully tested reason to manage every step directly.
A successful copy command proves only that bytes were written to a destination. It does not prove that every required file was included, that the copy is internally usable, that all required redo exists, or that the organization can access encryption keys and storage during an outage.
A dependable user-managed strategy should therefore:
The restore test should measure whether the database can meet its recovery-time and recovery-point objectives. If the files cannot be restored, decrypted, recovered, opened, and checked within the required period, the copy procedure has not yet demonstrated an effective backup strategy.
The next lesson lists the steps required to prepare for closed database backups.