Physical Backups  «Prev  Next»

Lesson 7Open database backup options
ObjectiveExplain the options for tablespace backups.

Online Backup Options and Fuzzy Datafile Copies

An online physical backup protects database files while an Oracle AI Database 26ai database remains open. Applications can continue to read and modify data during the operation, so the backup avoids the planned outage required for a consistent closed backup. This availability is valuable, but it changes the recovery model. The backed-up files do not all represent one common instant, and redo is required to make restored files consistent.

For a self-managed database, online backups of active data files require ARCHIVELOG mode. Filled online redo logs must be archived before they are reused so the recovery chain can retain the changes needed after a restore. ARCHIVELOG mode makes online recovery possible, but it does not guarantee recoverability by itself. The required data file backups, archived redo, control-file information, encryption material, and repository metadata must all remain available.

Recovery Manager, or RMAN, is the preferred tool for online physical backups. RMAN understands Oracle block structure, discovers the files that belong to the selected backup scope, records backup metadata, and integrates backup creation with validation, restore, and recovery. User-managed operating-system copies remain supported for specialized requirements, but they require more DBA coordination and do not provide RMAN's native automation.

Choose the Appropriate Backup Scope

Oracle AI Database 26ai uses the multitenant architecture. A backup plan can protect the complete container database, the CDB root, one or more pluggable databases, selected tablespaces, or individual data files. The right scope depends on the recovery objective. A narrow backup can protect a frequently changing or operationally important area, but it does not replace periodic protection of the complete CDB and its recovery metadata.

Backup scopeRMAN examplePurpose and connection context
Complete CDB BACKUP DATABASE; Connect to the CDB root. This protects the data files for the root and eligible PDBs as one database-level operation.
CDB root BACKUP DATABASE ROOT; Protects the root and its critical metadata. It is not a substitute for backing up application PDBs.
One or more PDBs BACKUP PLUGGABLE DATABASE sales, hr; Connect to the root to name one or more PDBs. When connected directly to one PDB, BACKUP DATABASE; applies to that PDB.
One or more tablespaces BACKUP TABLESPACE users, tools; Protects every data file belonging to the named tablespaces. Connect directly to a PDB when its tablespace names could be ambiguous.
Selected data files BACKUP DATAFILE 10, 13; Protects specific files. Data file numbers and paths identify the files across the CDB, subject to the connection's permitted scope.

A typical online whole-CDB operation also protects the archived redo needed through the end of the backup:

BACKUP DATABASE PLUS ARCHIVELOG;

RMAN switches and archives redo as part of the operation and creates database and archived redo log backup sets. The command is a useful starting pattern, not a complete production policy. The DBA must still configure destinations, retention, encryption, channels, monitoring, and restore testing. When an individual PDB is backed up, the necessary archived redo also must be protected at the CDB level. A PDB backup without its required redo might not support the intended media recovery.

Choose the Backup Format and Frequency

RMAN can create backup sets or image copies. A backup set is an RMAN-specific structure containing one or more backup pieces. It can omit blocks that do not need to be backed up and can use RMAN compression and encryption. An image copy is a block-for-block representation of one data file, control file, or archived redo log. An image copy can be switched into service during some recovery procedures, while a backup set must be restored by RMAN.

The word full means that a backup is not incremental. It does not necessarily mean that the complete database is included. A full backup can target one data file or one tablespace. Incremental level 0 and level 1 backups provide another way to control backup volume and recovery work. A level 0 establishes an incremental baseline. A level 1 captures blocks changed after an applicable earlier backup. Incrementally updated image-copy strategies can roll level 1 changes into an older image copy to maintain a more current recovery copy.

A more recent usable backup can reduce the redo that must be applied after a restore and may improve the recovery-time objective. It does not guarantee a particular recovery duration. Recovery time also depends on the target SCN or time, the database change rate, incremental strategy, storage throughput, channel configuration, and whether all required media can be accessed promptly.

Do not use arbitrary weekly or monthly schedules simply because a tablespace has a particular name. Set frequency according to the organization's recovery-point objective, recovery-time objective, data-change rate, storage capacity, and measured restore performance. Current databases use undo tablespaces and automatic undo management, not legacy rollback-segment tablespaces. Tempfiles are not backed up as ordinary RMAN data files because temporary contents can be recreated. Read-only tablespaces may need less frequent backup, but their valid backups and the control-file metadata that describes their state still must be preserved.

Why an Online Datafile Copy Becomes Fuzzy

Database writer processes can continue writing blocks while an online data file is being copied. The copy operation reads blocks in sequence, but transactions and checkpoints continue independently. A block near the beginning of the file may be copied before a transaction changes it, while a block near the end may be copied after another part of the same transaction changes it. The resulting copy therefore contains blocks representing different points in the redo history.

Oracle describes a data file as fuzzy when at least one block has a system change number greater than or equal to the checkpoint SCN recorded in the data file header. A restored fuzzy file always requires media recovery. Recovery applies redo until the file's blocks and checkpoint information represent a valid recovery point. Fuzziness is expected for an online backup and does not by itself mean that the backup is corrupt or unusable.

The timeline in the following diagram uses a logical copy cursor. At T1, the copy begins while redo sequence N is current. At T2, a log switch archives redo N and makes N+1 current. At T3, one transaction changes blocks X1 and X2. The copy cursor has already passed X1 but has not yet reached X2. At T4, the copy captures X2 but not the newer version of X1. At T5, the completed file is fuzzy because its blocks do not represent one common SCN. Applying the retained redo reconstructs both changes at the selected recovery SCN.

Oracle 26ai timeline showing how a user-managed online datafile copy becomes fuzzy, how archived redo restores consistency, and how RMAN handles online backups without backup mode
A user-managed online datafile copy can contain blocks from different SCNs. Media recovery applies the required archived redo to produce a consistent file; RMAN handles fractured blocks without BEGIN BACKUP.

Fuzzy Files and Fractured Blocks Are Different

A fuzzy file and a fractured block describe different levels of inconsistency. A fuzzy file contains complete Oracle blocks, but those blocks do not all correspond to one common recovery point. A fractured block can occur when an operating-system copy utility reads a block at the same time that DBWR is writing it. One part of the copied block may contain the new version while another part contains the old version, so its header and footer do not represent the same block write.

RMAN reads Oracle blocks through database server sessions. It compares block headers and footers, and it rereads a block when it detects a possible fracture. Because RMAN understands the order in which blocks are read and can capture a usable checkpoint, it does not require ALTER TABLESPACE ... BEGIN BACKUP. The RMAN backup can still be inconsistent as a whole and require redo after restoration, but RMAN does not knowingly place a fractured block in the backup.

A user-managed copy utility does not understand Oracle block boundaries or recovery metadata. Backup mode supplies the additional protection needed for an online copy of a read/write data file. While a file is in backup mode, Oracle writes the required whole-block images to redo so media recovery can reconstruct a block if the copied version was fractured. This behavior increases redo generation, which is one reason backup mode should be used only for the required interval.

CharacteristicRMAN online backupUser-managed online copy
Preferred production methodYesSpecialized alternative
ARCHIVELOG required for open active filesYesYes
BEGIN BACKUP requiredNoYes for online read/write data files, unless a validated integration provides equivalent protection
Fractured-block handlingDetects and rereads fractured blocksRelies on backup mode or an Oracle-compatible snapshot method
Backup formatsBackup sets or image copiesImage copies or validated storage snapshots
Incremental backup supportYesNo native incremental metadata from an operating-system copy
File discovery and metadataRMAN discovers files and records them in its repositoryThe administrator inventories files; copies can later be cataloged in RMAN
Redo required after restoreYes for an online backupYes for an online backup

User-Managed Online Tablespace Copies

A user-managed backup can target every data file in an online tablespace or selected data files, but the DBA must identify the correct files before starting. For example, query DBA_DATA_FILES in the correct container to map a read/write tablespace to its data files. Do not rely on a filename pattern that might omit a file or include a file from another database.

The following sequence illustrates a user-managed copy of the online USERS tablespace. The operating-system copy step is deliberately generic because commands, storage paths, permissions, and snapshot facilities differ among environments.

ALTER TABLESPACE users BEGIN BACKUP;
# Copy every inventoried data file belonging to the USERS tablespace.
ALTER TABLESPACE users END BACKUP;
ALTER SYSTEM ARCHIVE LOG CURRENT;

The final log switch archives redo needed through the end of the copy. The DBA must protect that redo together with a suitable control-file backup and the copied data files. For a coordinated copy of all eligible data files, Oracle also supports ALTER DATABASE BEGIN BACKUP and ALTER DATABASE END BACKUP. Placing many busy tablespaces in backup mode simultaneously can generate substantial redo, so a serial tablespace procedure may be more appropriate when using this specialized method.

If an instance fails during a user-managed online backup, query V$BACKUP after mounting or opening the database as appropriate. An ACTIVE status identifies files recorded as being in backup mode:

SELECT file#, status, change#, time, con_id
FROM   v$backup
WHERE  status = 'ACTIVE';

Do not issue END BACKUP blindly after files may have been restored. First determine whether the files are current or restored copies and follow the appropriate recovery procedure. Leaving current files in backup mode increases redo generation and can interfere with normal operations.

Storage snapshots of an open database require the same care. Use snapshot technology validated for Oracle online backups, take the relevant files offline, or surround the snapshot with the supported backup-mode procedure. Oracle AI Database 26ai desupports RECOVER ... SNAPSHOT TIME. Current snapshot planning uses supported backup coordination and recovery to a specified time or SCN while retaining the necessary archived redo.

Protect the Complete Recovery Chain

Selecting a tablespace or data file is only the first backup decision. Recovery depends on every asset required to interpret, decrypt, restore, and roll that backup forward. A practical recovery chain can include:

Keep recoverable backup copies outside the failure domain and administrative boundary of the primary database storage. ASM redundancy, RAID, storage snapshots, replication, Data Guard, and multiplexed files can improve availability, but none replaces an independently protected and tested backup. Corruption, an unwanted database change, credential compromise, or malicious deletion can be reproduced across redundant storage.

Redo-based recovery also has a limit: some NOLOGGING operations can create changes that redo cannot fully reconstruct. After significant NOLOGGING work, back up the affected data files according to the recovery policy. Do not assume that the presence of archived redo repairs data that was never fully logged.

Validate the Selected Backup Strategy

A successful backup command proves that a job completed, not that the organization can restore service within its objectives. Monitor RMAN job results and errors, crosscheck repository records against physical storage, validate database files and backup pieces, and retain more than one recovery point. An older validated backup can be essential if corruption or an unwanted change existed before the newest backup was created.

Periodically perform a complete restore and recovery in an isolated environment. Verify that the team can access encryption keys, credentials, network paths, media libraries, archived redo, and sufficient recovery capacity. Measure the recovery point and elapsed recovery time during the test. Those measurements show whether the chosen whole-CDB, PDB, tablespace, data-file, and incremental schedules actually satisfy the documented RPO and RTO.

Online backup flexibility is therefore a recovery-planning tool, not permission to protect files independently without context. Choose a scope that matches the failure being addressed, retain the redo and metadata that make the backup usable, and prove the procedure through restoration. The next lesson shows how to perform an open database backup.


SEMrush Software 7 SEMrush Banner 7