Skip Headers
Oracle® Database Backup and Recovery Reference
10g Release 2 (10.2)

Part Number B14194-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

keepOption

Syntax

keepOption::=

Description of keepoption.gif follows
Description of the illustration keepoption.gif

Purpose

A subclause specifying the status of a backup or copy in relation to a retention policy. The KEEP option marks the backup or copy as exempt from the retention policy (that is, not obsolete), and the NOKEEP option undoes any existing exemptions.

Limitations and Restrictions

Keywords and Parameters

Syntax Element Description
KEEP Overrides any configured retention policy for this backup or copy so that the backup is not obsolete. The BACKUP ... KEEP command specifies a new retention time for this backup. Use this option to create a long-term backup, that is, a backup that want you to archive.
FOREVER Specifies that the backup or copy never expires. You must use a recovery catalog when FOREVER is specified, because the backup records eventually age out of the control file.
UNTIL TIME = 'date_string' Specifies the date until which the backup or copy must be kept. You can either specify a specific time by using the current NLS_DATE_FORMAT, or a SQL date expression, such as 'SYSDATE+365'.
LOGS Specifies that all of the archived logs required to recover this backup or copy must remain available as long as this backup or copy is available.
NOLOGS Specifies that this backup or copy cannot be recovered because the archived logs needed to recover this backup will not be kept. The only use for this backup or copy is to restore the database to the point in time that the backup or copy was taken. This is the only valid recoverability option when the database operates in NOARCHIVELOG mode. This option is not valid if the backup or copy is inconsistent.
NOKEEP Specifies that the backup or copy expires according to the user's retention policy. This is the default behavior if no KEEP option is specified.

Examples

Making a Long-Term Backup: Example This example makes a long-term backup of the database and specifies that it should never become obsolete and that the logs required to recover it should not be retained:

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
BACKUP DATABASE
  KEEP FOREVER NOLOGS;
ALTER DATABASE OPEN;

Changing the Status of a Copy: Example This example specifies that any long-term image copies of datafiles and control files should lose their exempt status and so become eligible to be obsolete according to the existing retention policy:

CHANGE COPY OF DATABASE CONTROLFILE NOKEEP;