Lesson 8
Creating Managing Backup Sets - Conclusion
In this module, you learned about the use of backup sets with Recovery Manager.
Now that you have completed this module, you should be able to:
- Review the concept of a backup set
- Identify the syntax of the
backup
command
- Discuss how and why Recovery Manager multiplexes backup sets
- Demonstrate how Recovery Manager parallelizes backup sets
- Identify data file backup sets
- Identify archive log backup sets
Any backup and recovery plan that you create will no doubt make extensive use of backup sets.
Backup Set in Oracle 19c
A backup set in Oracle 19c is a logical collection of backup pieces created by Recovery Manager (RMAN) during a backup operation. It is the fundamental structure RMAN uses to store backed-up data efficiently.
Key Concepts of a Backup Set
-
Definition
- A backup set consists of one or more backup pieces.
- A backup piece is a physical file that contains the actual backed-up data.
- RMAN stores data in backup sets rather than individual files, allowing better space management and compression.
-
Components of a Backup Set
- Backup pieces: Physical binary files that hold the backed-up data.
- Data file backups: Can contain one or more database datafiles.
- Control file backup: Can be included in the backup set.
- Archived redo logs: Can be backed up separately or along with data files.
-
Types of Backup Sets
- Full Backup Set: A complete copy of selected data files, control files, or archived logs.
- Incremental Backup Set: Contains only the blocks changed since the last backup (LEVEL 0 or LEVEL 1).
- Compressed Backup Set: Reduces storage by compressing backed-up data.
- Encrypted Backup Set: Uses RMAN encryption to secure sensitive data.
Backup Set vs. Image Copy
Feature |
Backup Set |
Image Copy |
Format |
RMAN proprietary format |
Exact copy of original file |
Compression |
Supported |
Not supported |
Encryption |
Supported |
Not supported |
Performance |
Requires restoration and recovery |
Can be used directly for restoration |
Storage |
More space-efficient |
Requires more storage |
Creating a Backup Set Using RMAN
-
Full Database Backup
RMAN> BACKUP DATABASE;
- Creates a backup set containing all data files.
-
Incremental Backup
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;
- Backs up only the blocks that changed since the last backup.
-
Backup Specific Tablespaces
RMAN> BACKUP TABLESPACE users;
- Backs up the
users
tablespace.
-
Backup Control File and Archived Logs
RMAN> BACKUP CURRENT CONTROLFILE;
RMAN> BACKUP ARCHIVELOG ALL;
- Ensures recoverability by backing up control files and redo logs.
Viewing Backup Sets
To list backup sets:
RMAN> LIST BACKUP SET;
To check details:
RMAN> LIST BACKUP SUMMARY;
To validate a backup set:
RMAN> VALIDATE BACKUPSET 1;
Restoring from a Backup Set
-
Restore Database from Backup Set
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
-
Restore a Specific Tablespace
RMAN> RESTORE TABLESPACE users;
-
Restore Control File
RMAN> RESTORE CONTROLFILE FROM BACKUPSET;
Conclusion
Backup sets in Oracle 19c provide an efficient, flexible way to store and manage database backups. Using RMAN, administrators can create full, incremental, compressed, and encrypted backups while optimizing storage. Understanding backup sets is crucial for implementing effective backup and recovery strategies.
`formatspec` in Oracle 19c
`formatspec` is still used in Oracle 19c as part of the `FORMAT` clause in RMAN (Recovery Manager) commands to specify the naming convention of backup files. It provides placeholders (format variables) to dynamically generate file names for backups, archivelogs, and other RMAN outputs.
Common Use of `formatspec` in Oracle 19c
The `FORMAT` clause is typically used in the `BACKUP`, `RESTORE`, and `COPY` commands in RMAN. It helps create unique, structured filenames for backup sets, backup pieces, image copies, and archive logs.
Syntax
FORMAT 'location_and_naming_pattern'
The placeholders within `formatspec` are dynamically replaced with actual values at runtime.
Common `formatspec` Placeholders in Oracle 19c
Placeholder |
Description |
Example Output |
%d |
Database name |
ORCL |
%t |
Backup timestamp (unique) |
2319856410 |
%s |
Backup set number |
10 |
%p |
Backup piece number |
01 |
%c |
Copy number of backup set |
1 |
%U |
Unique backup identifier (combines %d, %t, %s, and %p) |
ORCL_2319856410_10_01 |
%T |
Date in YYYYMMDD format |
20250312 |
Examples of Using `formatspec` in Oracle 19c
-
1. Backup the Database with a Custom Format
RMAN> BACKUP DATABASE FORMAT '/backup/oracle/db_%d_%T_%s_%p.bkp';
-
2. Archive Log Backup with Auto Naming
RMAN> BACKUP ARCHIVELOG ALL FORMAT '/backup/logs/arch_%d_%t_%s.bkp';
-
3. Incremental Level 1 Backup with Unique Identifier
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE FORMAT '/backup/inc_%U.bkp';
Why Use `formatspec` in Oracle 19c?
- ✅ Ensures Unique File Names – Avoids overwriting old backups.
- ✅ Improves Backup Organization – Helps structure backup locations and filenames.
- ✅ Facilitates Automation – Works dynamically with RMAN scripts for scheduled backups.
Conclusion:
`formatspec` is still relevant and widely used in Oracle 19c for structuring backup filenames in RMAN. Using the right format placeholders helps in efficient backup management and recovery.
The following term was introduced in this module:
- formatspec: A variable placeholder. The formatspec tag can be used as part of the BACKUP command, which means it will apply to all backup specs in the command or on an individual backup_spec. The tag can also be used in the ALLOCATE command to apply to all files which will use that channel.
In the next module, you will learn some advanced techniques for using Recovery Manager.
Backup Set - Exercise
Click the Exercise link below to do a matching exercise to test the knowledge gained in this chapter.
Backup Set - Exercise

