apps-dba journal

A working journal for Oracle DBAs.

October 02, 2026

Oracle DBA Lesson 31C — Choosing an Incremental Backup Chain

An incremental backup copies changed blocks and depends on an earlier base. Level 0 starts that chain. A level 1 is either differential or cumulative. An ordinary full backup is not a level 0.

Oracle DBA Lesson 31C — Choosing an incremental backup chain

What each backup is

BackupWhat it copiesRole
Ordinary fullData blocks selected by a full backupRestore a data file, then recover with redo. Not part of the incremental chain.
Level 0The same data content as a full backup under the same conditionsThe base later level 1 backups use.
Differential level 1Blocks changed since the latest applicable level 0 or level 1Default level 1. Apply each one in order after the base.
Cumulative level 1Blocks changed since the latest applicable level 0Apply the latest cumulative to the level 0. It already includes earlier changes in this sequence.

Create the base with this command. Nothing else does it.

BACKUP INCREMENTAL LEVEL 0 DATABASE;

BACKUP DATABASE creates an ordinary full backup. It does not become tomorrow's level 0. No command converts an existing full backup into a level 0. Keep those full backups. They still restore on their own. See incremental backups.

BACKUP INCREMENTAL LEVEL 1 DATABASE;
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

The first command is differential. That is RMAN's default for level 1. Add CUMULATIVE when the level 1 must reach back to the level 0.

Do not mix these up

  • A full backup and a level 0 can hold the same blocks. Only the level 0 is the incremental base.
  • A differential level 1 starts at the latest applicable level 0 or level 1. A cumulative level 1 starts at the latest level 0.
  • A tag labels the job. It does not choose the parent backup.
  • LIST BACKUP SUMMARY shows level 0 or 1. It does not say differential or cumulative. The command does.
  • Drop the level 0 and this incremental path has no starting data-file contents. Keep every piece in the path you will restore, plus the redo through the target.

Sunday, Monday, Tuesday

Six blocks, A through F, stand for one data file. Sunday's level 0 copies all six. Monday changes A and C. Tuesday changes C again and E. One incarnation. No other incremental jobs. The two chains below are alternatives, not one mixed schedule.

DayChangeDifferentialCumulative
SundayBaseL0: A B C D E FL0: A B C D E F
MondayA, CL1: A, CL1: A, C
TuesdayC again, EL1: latest C, EL1: A, latest C, E

Tuesday's differential starts at Monday, so A is already in Monday's backup and is not copied again. C is copied again because the block changed again. Tuesday's cumulative starts at Sunday, so it includes A, the latest C, and E.

To reach Tuesday's backup checkpoint:

  • Differential: restore Sunday's level 0, then apply Monday's level 1 and Tuesday's level 1.
  • Cumulative: restore Sunday's level 0, then apply Tuesday's cumulative level 1.

Both paths still need archived redo to make the restored files consistent, and more redo if the target is later than the backup checkpoint, such as Tuesday noon. Keep every piece that belongs to the backups you selected. One job can write more than one backup set and more than one piece.

In this model the two differential level 1s copy 2 + 2 = 4 blocks. The two cumulative level 1s copy 2 + 3 = 5 blocks. Both also copy the six-block base. Tuesday recovery applies two level 1s on the differential path and one on the cumulative path. Those counts are the teaching model. Real time and size depend on the workload, compression, channels, and storage. Measure backup time, storage, and a timed restore against the recovery time objective. See RMAN backup concepts.

Before you run it

Use the disposable ARCHIVELOG CDB from Lesson 31B. Run CDB-level RMAN from the root as SYSBACKUP or SYSDBA. COURSE_OWNER inserts the marker only in LABPDB.

The Lesson 31B baseline is a full backup. Make a new level 0 for this exercise and record it. Confirm the backup destination, free space, and that redo, the control file, and the SPFILE can still be recovered. Leave compression, channels, block change tracking, encryption, and retention as they are. Do not delete existing pieces or archived logs.

If another backup runs between this level 0 and the level 1, stop and check the starting point before you continue.

Create the level 0 and one differential

In the authorized RMAN session, keep the command log:

SHOW ALL;
LIST INCARNATION;
LIST BACKUP SUMMARY;

Create and list the level 0:

BACKUP INCREMENTAL LEVEL 0 DATABASE TAG 'COURSE_L0';
LIST BACKUP TAG 'COURSE_L0';

Record the backup-set keys, piece handles, file numbers, incremental level, completion times, and checkpoint SCNs. A tag can be reused, so keep the keys and times as well.

In SQL*Plus as COURSE_OWNER in LABPDB, confirm the container and that the assigned marker id is unused. Replace the placeholder with the numeric id you were given:

SHOW USER
SHOW CON_NAME
SELECT marker_id, marker_text
FROM recovery_marker
WHERE marker_id = <UNIQUE_MARKER_ID>;

INSERT INTO recovery_marker (marker_id, marker_text)
VALUES (<UNIQUE_MARKER_ID>, '31C AFTER LEVEL 0');
COMMIT;

SELECT marker_id, marker_text, created_at
FROM recovery_marker
WHERE marker_id = <UNIQUE_MARKER_ID>;

The first query must return no row. On a duplicate-key error, use another unused id. Do not change existing rows. COMMIT makes the marker durable. One inserted row can change several blocks, so the real level 1 will not match the six-block model.

Back in RMAN, on the same CDB:

BACKUP INCREMENTAL LEVEL 1 DATABASE TAG 'COURSE_L1_DIFF';
BACKUP ARCHIVELOG ALL TAG 'COURSE_31C_REDO';
LIST BACKUP SUMMARY;
LIST BACKUP TAG 'COURSE_L1_DIFF';
LIST BACKUP TAG 'COURSE_31C_REDO';

This copies archived logs. It does not delete them. The archive backup covers redo that is already archived. Redo through the recovery target still has to be archived and backed up. Stop if a required log range or piece is missing.

From the root, read the per-file backup rows:

SELECT file#, incremental_level, incremental_change#,
       checkpoint_change#, completion_time,
       set_stamp, set_count
FROM v$backup_datafile
WHERE file# > 0
ORDER BY completion_time, file#;

INCREMENTAL_LEVEL is null for an ordinary full, 0 for level 0, and 1 for level 1. INCREMENTAL_CHANGE# is the SCN this incremental starts from. CHECKPOINT_CHANGE# is the backup checkpoint. Match the row to this run by the RMAN log, set stamp, and set count, not by the tag alone. See V$BACKUP_DATAFILE.

Read the summary

LIST BACKUP SUMMARY is one line per backup set. TY is the backup type. LV is F for full, A for archived log, or 0 / 1 for an incremental. S is repository status. S=A means available. Use LIST BACKUP TAG for files, checkpoints, and piece names. Headings are defined in LIST.

Level 1 in that summary does not tell you differential or cumulative. Keep the command that created the backup. A restore is what proves the chain. That drill is the next exercise, not this one.

Cumulative, on paper

Do not create a second copy of the same changes unless you need it. From the same Sunday level 0 and the same Monday and Tuesday changes, this is the cumulative command:

BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE TAG 'COURSE_L1_CUM';

Tuesday's cumulative includes Monday's A and the latest C because both blocks changed after Sunday's level 0. Restore that level 0, apply Tuesday's cumulative, and keep redo through Tuesday noon.

Done when

You can point at the level 0 and the level 1, show the per-file start SCN, and name the pieces and redo for the target time. You can also explain the cumulative path on paper, and why deleting the level 0 breaks that path.

Keep the level 0, every related incremental, every piece, and the archived logs until recovery has been checked. This lesson does not delete backups and does not restore.

After the later recovery exercises, remove only the marker you inserted, and only when that is authorized. In LABPDB as COURSE_OWNER, confirm the id and text, delete that row, commit, and confirm it is gone. Leave the shared baseline row and other markers. Cleanup of the marker is not a backup retention decision.

Recap

Make the base with BACKUP INCREMENTAL LEVEL 0 DATABASE. Differential level 1s follow the latest level 0 or level 1. Cumulative level 1s reach back to the level 0. Keep the chain and the redo, and time a restore before you pick the pattern.

Quiz

1. Does BACKUP DATABASE become the level 0 for tomorrow's incremental?

2. What does BACKUP INCREMENTAL LEVEL 1 DATABASE copy?

3. Tuesday's cumulative level 1 contains A, the latest C, and E. Why is A included?

4. Which backups restore Tuesday's checkpoint on the differential path?

5. LIST BACKUP SUMMARY shows LV 1. Does that tell you the backup is cumulative?

No comments:

Post a Comment

Oracle DBA Lesson 33A — Follow a Client Into the Right PDB

A successful remote connection passes through naming, the listener, and the requested service before creating a database session. Follo...