Databases Reference
In-Depth Information
Tagging RMAN Backups
Problem
You want to name your RMAN backup pieces and image copies with symbolic names so that it's easy to refer to them.
Solution
You can assign a character string called a tag to either a backup set or an image file. A tag is simply a symbolic name
such as nightly_backup, for example, that helps you identify the contents of a backup file. Once you associate a
tag with a backup, you can refer to just the tag later in RMAN commands. For example, when executing a restore
command, you can specify the tag nightly_backup instead of having to specify the actual backup file name.
The following example shows how to associate a tag with a backup set:
RMAN> backup copies 1 datafile 5 tag test_bkp;
The following example shows how to associate a tag with an image copy:
RMAN> backup as copy tag users_bkp tablespace users;
To copy an image copy with a specific tag, you can use the following command format:
RMAN> backup as copy
copy of database
from tag=full_cold_cpy
tag=new_full_cold_cpy;
In the following example, we show how you can create backup sets of image copies of the tablespace users, which
has the tag weekend_users, and the tablespace system, which has the tag weekend_system. Note that both of the new
backup sets you're creating are given the same tag, new_backup.
RMAN> backup as backupset tag new_backup
copy of tablespace users from tag weekend_users
copy of tablespace system from tag weekend_system;
Tags are case-insensitive. Even if you specify a tag in lowercase, RMAN will store and display the tag in uppercase.
How It Works
The main benefit in using tags for backups is that a tag can clearly tell you what a given backup's purpose is. For
example, you can have two copies of a backup, one with the tag switch_only and the other with the tag for_restore_
only. During a restore/recovery situation, you can use the first tag if you're using the switch command and the second
if you are restoring the actual file.
You can use tags to identify backups taken for a specific purpose or at a specific time. Examples of such tags are
weekly_incremental and 2006_year_end. It's common to use tags to distinguish among a set of backups that are part
of a backup strategy, such as an incremental backup strategy. If you back up a backup set, you can provide a different
tag for the new copy of the backup set.
Even if you don't expressly specify a tag using the keyword tag , Oracle assigns a default tag to every backup
except for control file backups. The default tag is of the format TAGYYYYMMDDTHHMMSS, where YYYY refers to
the year, MM to the month, DD to the day, HH to the hour, MM to the minutes, and SS to the seconds. For example, a
backup of data file 1 made on July 31, 2012, will receive the tag TAG20120731T062822 .
 
Search WWH ::




Custom Search