Managing File Copies   «Prev  Next»

Lesson 5Using the Backup Command
ObjectiveRecognize the use of tags and backups

Using the Backup Command in Oracle

In Oracle 12c, tags are utilized with the `BACKUP` command to facilitate the management and identification of backups. When executing a database backup, a tag can be specified, serving as an identifier or label for that particular backup set. This tagging feature is especially useful in large environments where numerous backups are created and managed.
The syntax for incorporating a tag in the `BACKUP` command is as follows:
BACKUP DATABASE TAG 'your_tag_name';

Here, `'your_tag_name'` should be replaced with a meaningful identifier that adheres to your organization's naming conventions. The tag name is case insensitive and can include a combination of alphanumeric characters and underscores.
For instance:
BACKUP DATABASE TAG 'weekly_full_backup';

This command will perform a full database backup and assign the tag 'weekly_full_backup' to it. Tags are particularly beneficial for the following purposes:
  1. Identification: Tags enable easy identification of specific backups for recovery operations.
  2. Organization: Helps in categorizing and organizing backups based on criteria like frequency (e.g., daily, weekly), purpose (e.g., test, production), or any other organizational need.
  3. Maintenance: Simplifies the management of backup retention and deletion policies, as backups can be referred to by their tags.

It is important to design a consistent and descriptive tagging strategy to maximize the benefits of this feature. This strategy should be documented and adhered to by all team members involved in the database backup and recovery processes.
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:
    1. FULL: Backs up all datafiles, control files, and archived redo logs.
    2. 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.
    3. INCREMENTAL LEVEL 1: Backs up only the blocks changed since the last level 0 or level 1 backup.
    4. 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:
    1. Datafiles to be backed up.
    2. Control files.
    3. Archived redo logs.
    4. Specific tablespaces.
    5. 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


Click the Quiz link below to review the allocate and backup commands.
Allocate Backup Commands - Quiz

SEMrush Software Target 5SEMrush Software Banner 5