| Lesson 10 | Monitoring an open database backup |
| Objective | Explain how to check the state of an open database backup. |
An open database backup, also called an online or hot backup, protects physical database files while the database remains available to applications. Monitoring is essential because an administrator must know whether the backup is still running, whether a user-managed data file was left in backup mode, whether the job completed with warnings or errors, and whether the resulting recovery assets are usable.
Oracle AI Database 26ai supports two fundamentally different online physical-backup methods. Recovery Manager, or RMAN, is the recommended method. RMAN reads Oracle blocks through database server sessions, detects fractured blocks, and rereads them when necessary. It does not require the DBA to place data files in backup mode. A user-managed online backup uses an operating-system utility, storage snapshot, or another external copy mechanism. Online read/write data files involved in that procedure must be placed in backup mode according to the supported workflow.
This difference determines which monitoring view to use. V$BACKUP reports user-managed backup-mode state. It does not show RMAN backup
progress. RMAN activity is monitored with RMAN output, RMAN-specific dynamic performance views, job logs, and long-operation statistics.
| Question | Primary source | What it establishes |
|---|---|---|
| Is a data file in user-managed backup mode? | V$BACKUP |
Whether Oracle currently marks the file as ACTIVE, NOT ACTIVE, offline, or in an error state |
| What does the physical file header report? | V$DATAFILE_HEADER |
Header status, read errors, checkpoint information, recovery requirement, and fuzziness |
| Is an RMAN job running or finished? | V$RMAN_STATUS and V$RMAN_BACKUP_JOB_DETAILS |
Operation status, timing, sizes, throughput, object type, and output device |
| How far has qualifying RMAN work progressed? | V$SESSION_LONGOPS |
An estimated progress percentage and remaining time for reported long operations |
| Were usable backup records produced? | RMAN job log, LIST BACKUP, validation, and restore tests |
Evidence that must be combined before the backup is accepted for recovery |
The examples in this lesson apply to a self-managed Oracle AI Database 26ai CDB. Connect with an authorized administrative account, such as one
using the SYSBACKUP or SYSDBA privilege. Autonomous AI Database uses Oracle-managed backup services and does not expose the
same host-level user-managed workflow.
V$BACKUP contains one row for each data file represented in the current control file. It is useful when an online read/write tablespace
or a database has been placed in backup mode before an external copy. It is also useful after an interruption because it can reveal files that Oracle
still considers to be in backup mode.
The principal columns are:
FILE#, the absolute data file number;STATUS, the backup-mode or file status;CHANGE#, the SCN at which backup mode began;TIME, the time at which backup mode began; andCON_ID, the container identifier for the row.An ACTIVE status means that the file is currently in user-managed backup mode. NOT ACTIVE means that it is not in backup
mode. Other possible results include OFFLINE NORMAL or an error description, so an operational script should not assume that every row
has only one of two values.
The following query returns only files currently marked ACTIVE. It joins the backup-mode record to the data file and tablespace so the
DBA can identify the affected file rather than working only from a file number:
SELECT b.con_id,
t.name AS tablespace_name,
d.file#,
d.name AS datafile_name,
b.status,
b.change#,
TO_CHAR(b.time, 'YYYY-MM-DD HH24:MI:SS') AS backup_start
FROM v$backup b
JOIN v$datafile d
ON d.file# = b.file#
AND d.con_id = b.con_id
JOIN v$tablespace t
ON t.ts# = d.ts#
AND t.con_id = d.con_id
WHERE b.status = 'ACTIVE'
ORDER BY b.con_id, d.file#;
The explicit TO_CHAR format makes the displayed time predictable instead of depending on NLS_DATE_FORMAT. Including
CON_ID is important in a multitenant database because it identifies the container associated with the row. For CDB-wide monitoring,
connect to the root and interpret each result in its container context. If the work concerns one PDB, use the appropriate container connection or an
approved CDB-level filter.
An empty result means that this query found no data files marked ACTIVE. It does not mean that no RMAN backup is running, and it does not
prove that the database has a recent recoverable backup. The query answers only the backup-mode question.
A user-managed tablespace backup begins with a valid tablespace name:
ALTER TABLESPACE users BEGIN BACKUP;
After this statement completes, the affected data files appear as ACTIVE in V$BACKUP. The external utility can then copy the
data files according to the approved procedure. After the copy completes successfully, the administrator ends backup mode:
ALTER TABLESPACE users END BACKUP;
For a coordinated operation involving all applicable data files, Oracle also supports the database-level forms:
ALTER DATABASE BEGIN BACKUP;
ALTER DATABASE END BACKUP;
The status changes back from ACTIVE when the appropriate END BACKUP statement completes. The operating-system copy does not
change the Oracle status by itself. Therefore, a script must coordinate the database statements with the external copy and record the success or
failure of both operations.
Do not use these statements for a normal RMAN backup. RMAN understands Oracle block structure, checks for fractured blocks, and does not require
backup mode. During an RMAN online backup, V$BACKUP can show every file as NOT ACTIVE even though RMAN is actively reading and
writing backup data.
Backup mode should last only as long as the external copy requires it. While an online read/write tablespace remains in this state, Oracle can place
complete changed blocks into redo. Heavy update activity can therefore increase redo volume, archive-storage consumption, and performance pressure.
A normal shutdown can also fail with ORA-01149 when files remain in backup mode.
An unexpected ACTIVE row requires investigation, not an automatic END BACKUP command. The external copy may still be running,
an automation job may have failed between steps, or the instance may have restarted after an interruption. Use this response sequence:
V$BACKUP also has recovery-related limitations. If the current control file was restored from a backup or re-created after a media
failure, it may not contain the information needed to populate the view accurately. If a data file was restored, its row can reflect the status of
the older restored file instead of the latest pre-failure state. During recovery, correlate this view with the alert log, recovery status, data file
headers, RMAN records, and the files that actually survived.
V$DATAFILE_HEADER obtains information from the physical data file headers. It complements V$BACKUP, but the two views answer
different questions. Useful columns include STATUS, ERROR, RECOVER, FUZZY,
CHECKPOINT_CHANGE#, CHECKPOINT_TIME, and CON_ID.
SELECT con_id,
file#,
name,
status,
error,
recover,
fuzzy,
checkpoint_change#,
checkpoint_time
FROM v$datafile_header
ORDER BY con_id, file#;
The ERROR column can report a problem encountered while Oracle reads or validates the header. RECOVER indicates whether the
header shows that media recovery is required. FUZZY = YES means that the file is not checkpoint-consistent and needs redo before it can
be opened consistently.
Do not interpret FUZZY as proof that an operating-system copy is currently running. Fuzziness is a file-consistency and recovery
characteristic, while V$BACKUP.STATUS is the direct indicator of user-managed backup mode. A restored online backup is expected to need
redo even after the live database has left backup mode.
Because this view reads file-header information, unavailable storage or an unreadable file can produce an error or unexpected result. Investigate the storage path and alert log instead of treating a null or unusual value as evidence that the file is healthy.
Most production online backups use RMAN. Monitor them with RMAN-specific views and the RMAN client or scheduler log. The following query displays recent backup jobs, including current jobs represented by the view:
SELECT session_key,
input_type,
status,
start_time,
end_time,
input_bytes_display,
output_bytes_display,
time_taken_display,
output_device_type
FROM v$rman_backup_job_details
ORDER BY session_key DESC
FETCH FIRST 20 ROWS ONLY;
INPUT_TYPE identifies the general type of work, such as a full database, incremental database, data file, archived redo log, control
file, or SPFILE backup. The display columns provide readable input and output sizes and elapsed time. OUTPUT_DEVICE_TYPE identifies disk,
SBT, or more than one device type.
Interpret STATUS carefully. Typical values include RUNNING, COMPLETED, COMPLETED WITH WARNINGS,
COMPLETED WITH ERRORS, and FAILED. A job that finishes with warnings or errors needs review. Do not count every row containing
the word COMPLETED as an acceptable backup.
V$RMAN_STATUS displays ongoing and finished RMAN jobs and their operation hierarchy. Ongoing records reside in memory; completed records
are stored in the control file. The following query shows session and command rows with their timing and destination information:
SELECT session_recid,
session_stamp,
operation,
status,
object_type,
output_device_type,
start_time,
end_time
FROM v$rman_status
WHERE row_type IN ('SESSION', 'COMMAND')
ORDER BY start_time DESC;
V$RMAN_OUTPUT can expose messages produced by RMAN work that is still represented in memory. These messages can help identify the
channel, file, backup piece, or error involved. They are not a durable substitute for capturing the RMAN client output or scheduler log in protected,
centralized monitoring.
Use SET COMMAND ID in operational RMAN scripts when an organization needs to correlate a job with database views, scheduler records, or
an external monitoring system. A meaningful command identifier makes concurrent jobs easier to distinguish.
V$SESSION_LONGOPS can expose progress for RMAN operations that qualify for long-operation reporting. A focused query avoids unrelated
database work:
SELECT sid,
serial#,
opname,
sofar,
totalwork,
units,
ROUND(sofar / NULLIF(totalwork, 0) * 100, 2) AS pct_complete,
elapsed_seconds,
time_remaining
FROM v$session_longops
WHERE opname LIKE 'RMAN%'
AND totalwork > 0
AND sofar < totalwork
ORDER BY start_time;
SOFAR and TOTALWORK support an estimated completion percentage. TIME_REMAINING is also an estimate. Rows can
appear, disappear, or restart as RMAN advances through data files, archived logs, backup sets, channels, and processing phases. A missing row does not
prove that the RMAN job stopped, and one long-operation row does not represent every component of the complete backup.
Correlate the session, operation name, RMAN command ID, job status, and job log. Capacity or throughput alerts should also examine the backup destination, fast recovery area, SBT media manager, cloud object storage integration, or Recovery Appliance involved in the operation.
A production monitor should evaluate several signals instead of looking only for a failed status. Alert when a scheduled backup does not start, remains in a running state substantially longer than its established baseline, finishes with warnings or errors, or produces no expected output. Also watch the destination for capacity exhaustion, media-manager failures, unavailable object storage, authentication failures, and network interruptions.
For an ARCHIVELOG database, backup health also depends on the redo recovery chain. A successful data file backup is not sufficient if
archived redo cannot be created, transported, retained, or retrieved. Monitor the fast recovery area and archive destinations so that a full
destination does not interrupt archiving or invalidate the expected recovery point. Coordinate archive-log deletion with the approved retention,
Data Guard, and backup policies.
Thresholds should reflect the database's normal workload and service objectives. A large level 0 backup, a small archived-log backup, and an SBT backup across a shared network have different duration and throughput profiles. Compare like jobs by input type, device, schedule, and database size instead of assigning one universal elapsed-time threshold.
Retain monitoring history outside the target control file when the recovery design requires longer analysis. Finished RMAN records in the control
file are subject to repository retention and record reuse, while in-progress information and V$RMAN_OUTPUT messages are memory based.
Protected job logs and centralized monitoring provide evidence that remains available after an instance restart or control-file loss.
Live monitoring answers whether an operation is running and whether obvious errors have occurred. After the job finishes, shift from progress monitoring to verification. RMAN commands such as these inspect records in the repository:
LIST BACKUP SUMMARY;
LIST BACKUP OF DATABASE;
LIST BACKUP inventories backups known to RMAN. REPORT SCHEMA, by contrast, describes the target database's data files and
structure. It can help identify what should be protected, but it does not prove that a backup job succeeded.
Before accepting the run, confirm that:
A status of COMPLETED is valuable evidence, but it is not a guarantee that the organization can recover. The strongest evidence is a
successful restore and recovery test in an isolated environment using the same credentials, keys, media libraries, network paths, and documented
procedures that a real incident would require.
Effective monitoring therefore combines the correct database view with RMAN logs, storage observations, alerting, and recovery testing. Use
V$BACKUP for user-managed backup mode, V$DATAFILE_HEADER for file-header diagnostics, and RMAN-specific views for RMAN jobs.
The next lesson examines the backup implications of logging and nologging modes.
Use the following quiz to review your understanding of open database backup monitoring: