Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 57 of 59


untilClause

Syntax

Text description of untilClause.gif follows
Text description of the illustration untilClause.gif


Purpose

A subclause that specifies an upper limit by time, SCN, or log sequence number for various RMAN operations.

See Also:

Oracle9i Recovery Manager User's Guide to learn how to set the Globalization Support date format used by RMAN

Restrictions and Usage Notes

When specifying dates in RMAN commands, the date string must be either:

Following are examples of typical date settings in RMAN commands:

BACKUP ARCHIVELOG FROM TIME 'SYSDATE-31' UNTIL TIME 'SYSDATE-14';
RESTORE DATABASE UNTIL TIME "TO_DATE('09/20/00','MM/DD/YY')";

Keywords and Parameters

Syntax Element Description

UNTIL TIME = 'date_string'

Specifies a time as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified time. For example, LIST BACKUP UNTIL TIME 'SYSDATE-7' lists all backups that could be used to recover to a point one week ago.

UNTIL SCN = integer

Specifies an SCN as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified SCN. For example, RESTORE DATABASE UNTIL SCN 1000 chooses only backups that could be used to recover to SCN 1000.

UNTIL SEQUENCE = integer THREAD = integer

Specifies a redo log sequence number and thread as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified sequence number. For example, REPORT OBSOLETE UNTIL SEQUENCE 8000 THREAD 1 reports only backups that could be used to recover through log sequence 7999.

Examples

Performing Incomplete Recovery Until a Log Sequence Number: Example

This example assumes that log sequence 1234 was lost due to a disk failure and the database needs to be recovered by using available archived redo logs.

RUN
{
  SET UNTIL SEQUENCE 1234 THREAD 1;
  RESTORE CONTROLFILE TO '?/oradata/cf.tmp';
  RESTORE CONTROLFILE FROM '?/oradata/cf.tmp'; # restores to all CONTROL_FILES locations
  ALTER DATABASE MOUNT;
  RESTORE DATABASE;
  RECOVER DATABASE;  # recovers through log 1233
  ALTER DATABASE OPEN RESETLOGS;
  # you must add new tempfiles to locally-managed temporary tablespaces after restoring
  # a backup control file
  SQL "ALTER TABLESPACE temp ADD TEMPFILE ''?/oradata/trgt/temp01.dbf'' REUSE";
}
Performing Incomplete Recovery to a Specified SCN: Example

This example (which assumes a mounted database) recovers the database until a specified SCN:

RUN
{
  ALLOCATE CHANNEL ch1 TYPE sbt;
  RESTORE DATABASE;
  RECOVER DATABASE UNTIL SCN 1000;  # recovers through SCN 999
  ALTER DATABASE OPEN RESETLOGS;
}
Reporting Obsolete Backups: Example

This example assumes that you want to be able to recover to any point within the last week. It considers as obsolete all backups that could be used to recover the database to a point one week ago:

REPORT OBSOLETE UNTIL TIME 'SYSDATE-7';

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback