Lesson 5 | Using the Backup Command |
Objective | Recognize the use of tags and backups |
Using the Backup Command in Oracle
In the previous lesson, we discussed the run
command. In this lesson, you will learn the basic syntax for the backup
command.
Oracle backup Command
The backup
command is issued to start a backup job, after the run
command has delimited the job and one or
more allocate
commands have been issued to establish one or more channels. In its simplest form, the backup
command is:
BACKUP DATABASE;
But the backup
command can include other options, as shown below:
BACKUP type tag (backup_spec1) ...;
The backup command
BACKUP type tag (backup_spec1) ...;
is valid and can be used in Oracle 12c. Here's a breakdown of its components:
- BACKUP: Initiates the backup operation.
- type: Specifies the type of backup to perform. Valid types include:
- FULL: Backs up all datafiles, control files, and archived redo logs.
- INCREMENTAL LEVEL 0: Similar to a full backup, but creates a smaller backup set by only copying changed blocks since the last level 0 backup.
- INCREMENTAL LEVEL 1: Backs up only the blocks changed since the last level 0 or level 1 backup.
- CUMULATIVE: Backs up all blocks changed since the last full backup.
- tag: Assigns an optional tag to the backup for identification and management purposes.
- (backup_spec1) ...: Specifies one or more backup specifications, which can include:
- Datafiles to be backed up.
- Control files.
- Archived redo logs.
- Specific tablespaces.
- Other database components.
Example:
BACKUP INCREMENTAL LEVEL 1 TAG 'MONDAY_INCR_L1' DATABASE;
This command initiates an incremental level 1 backup of the entire database with the tag "MONDAY_INCR_L1".
Key Points:
- The `BACKUP` command is a core component of Oracle Recovery Manager (RMAN), the primary backup and recovery tool for Oracle databases.
- Oracle 12c supports various backup types, tags, and backup specifications to tailor backups to specific needs.
- Using appropriate backup strategies is crucial for data protection and disaster recovery.
The type
The type option is used to indicate whether the backup is a standard backup, an incremental backup (with the keyword incremental
), or a cumulative backup (with the keyword cumulative
), as described earlier in this course.
You can also include a level along with the incremental
keyword. If no value is specified for the type of backup, a complete backup is done.
The tag
The tag is an optional piece of syntax you can use to specify a name for the backup. This name is included in the information kept
in the recovery catalog, so it should describe the purpose of the backup, such as 'weekly_cumulative_backup'
. A tag can be reused.
The backup_spec
The backup_spec is an optional piece of syntax that is used to describe a backup set.
You can specify the information such as the data files or tablespaces that are included in the set or the tag for the backup set. You can have more than one backup_spec for a backup
command, but each backup_spec has to be included within a set of parentheses.
The following Simulation walks you through the process of doing a backup with Recovery Manager:
Each channel can be used for only a single backup set.
The details of the backup
command are described more fully in the next module.
In the next lesson, you will learn how to create image copies.
Allocate Backup Commands - Quiz