Oracle® Database Backup and Recovery Reference 11g Release 1 (11.1) Part Number B28273-01 |
|
|
View PDF |
Purpose
Use the keepOption
subclause to specify the status of a backup or copy in relation to a retention policy.
Syntax
keepOption::=
Usage Notes
RMAN does not consider backup pieces with the KEEP
option when computing the backup retention policy. If available, RMAN uses these backups for disaster recovery restore operations, but their purpose is to produce a snapshot of the database that can be restored on another system for testing or historical usage.
Semantics
Syntax Element | Description |
---|---|
KEEP |
Specifies the backup as an archival backup, which is a self-contained backup that is exempt from the configured retention policy.
An archival backup is self-contained because is contains all files necessary to restore the backup and recover it to a consistent state. If the database is open during the backup, then RMAN automatically generates and backs up the archived redo logs needed to make the database backup consistent (see Example 2-26). RMAN does not consider backup pieces with the Note: You cannot use When Note: A recovery catalog is only required for |
FOREVER |
Specifies that the backup or copy never becomes obsolete (see Example 2-27). A recovery catalog is required when FOREVER is specified because the backup records eventually age out of the control file. |
UNTIL TIME
|
Specifies the time until which the backup or copy must be kept. After this time the backup is obsolete, regardless of the backup retention policy settings.
You can either specify a specific time by using the current |
RESTORE POINT
|
Creates a normal restore point matching the SCN to which RMAN must recover the backup to a consistent state (see Example 2-26). The restore point name must not already exist.
The SCN is captured just after the datafile backups complete. The restore point is a label for the SCN to which this archival backup can be restored and recovered, enabling the database to be opened. In contrast, the Note: The |
NOKEEP |
Specifies that any KEEP attributes no longer apply to the backup. Thus, the backup is a normal backup that is subject to the configured backup retention policy. This is the default behavior if no KEEP option is specified. |
Examples
Example 3-23 Creating a Consistent Database Backup for Archival
This example makes a database backup with tag Q107
and specifies that it should never be considered obsolete (partial sample output included). The archived redo logs necessary to make the datafiles consistent are included in the backup set.
RMAN> BACKUP TAG Q107 DATABASE KEEP FOREVER; Starting backup at 24-JAN-07 current log archived allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=105 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Oracle Secure Backup backup will never be obsolete archived logs required to recover from this backup will be backed up channel ORA_SBT_TAPE_1: starting full datafile backup set channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set . . .
Example 3-24 Removing the KEEP Attributes for a Backup
This example backs up all archived redo logs. The KEEP
clause specifies that one second after midnight on January 1, 2008 the backup is considered obsolete.
RMAN> BACKUP KEEP UNTIL TIME '01-JAN-08' ARCHIVELOG ALL;
The following command removes the KEEP
attributes of all archived redo log backups (sample output included):
RMAN> CHANGE BACKUP OF ARCHIVELOG ALL NOKEEP; using channel ORA_SBT_TAPE_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=77 device type=DISK keep attributes for the backup are deleted backup set key=330 RECID=19 STAMP=612722760 keep attributes for the backup are deleted backup set key=397 RECID=22 STAMP=612722884