Skip Headers

Oracle® Database Recovery Manager Reference
10g Release 1 (10.1)

Part Number B10770-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 current chapter
Up
Go to next page
Next
View PDF

archivelogRecordSpecifier

Syntax

archivelogRecordSpecifier::=

Text description of archivelogRecordSpecifier.gif follows


Text description of archivelogRecordSpecifier

 

archlogRange::=

Text description of archlogRange.gif follows


Text description of archlogRange

Purpose

A subclause used to specify an archived log or range of archived redo logs files for use in backup, restore, recovery, and maintenance operations.

When backing up archived redo logs, RMAN can perform archived log failover automatically. RMAN backs up the log when at least one archived log corresponding to a given log sequence number and thread is available. Also, if the copy that RMAN is backing up contains corrupt blocks, then it searches for good copies of these blocks in other copies of the same archived logs.

Specifying a range of archived redo logs does not guarantee that RMAN includes all redo data in the range: for example, the last available archived log file may end before the end of the range, or an archived log file in the range may be missing from all archiving destinations. RMAN includes the archived redo logs it finds and does not issue a warning for missing files.


Note:

Query the V$ARCHIVED_LOG view or RC_ARCHIVED_LOG recovery catalog view to determine the time stamps, SCNs, and log sequence numbers for an archived log. For information on how to use the NLS_LANG and NLS_DATE_FORMAT environment variables to specify the format for the time, see Oracle Database Reference.


Keywords and Parameters

archivelogRecordSpecifier
Syntax Element Description

ALL

Specifies all available archived logs.

LIKE 'string_pattern'

Specifies all archived logs that match the specified string_pattern. The same pattern matching characters that are valid in the LIKE operator in the SQL language can be used to match multiple files.

See Also: Oracle Real Application Clusters Administrator's Guide to learn about using RMAN in a RAC configuration

archlogRange
Syntax Element Description

FROM SCN = integer

Specifies the beginning SCN for a sequence of archived redo log files. If you do not specify the UNTIL SCN parameter, RMAN will include all available log files beginning with SCN specified in the from SCN parameter.

SCN BETWEEN integer AND integer

Specifies a range of SCNs. SCN BETWEEN integer1 AND integer2 is exactly equivalent to FROM SCN integer1 UNTIL SCN integer2.

UNTIL SCN = integer

Specifies the ending SCN for a sequence of archived redo log files. If you do not specify the FROM SCN parameter, then RMAN will start with the earliest available archived log.

If the database is open when you run BACKUP ARCHIVELOG, and if the UNTIL clause is specified, then RMAN does not run ALTER SYSTEM ARCHIVE LOG CURRENT.

FROM SEQUENCE integer

Specifies the beginning log sequence number for a sequence of archived redo log files. If you do not specify the UNTIL SEQUENCE parameter, RMAN will include all available log files beginning with log sequence number specified in the FROM SEQUENCE parameter.

Note: You can specify all log sequence numbers in a thread by using the following syntax, where thread_number is an integer referring to the thread:

... ARCHIVELOG FROM SEQUENCE 0 THREAD thread_number

SEQUENCE

Specifies either a single log sequence number or a range of sequence numbers. If the database is open when you run BACKUP ARCHIVELOG, and if the SEQUENCE keyword is specified, then RMAN does not run ALTER SYSTEM ARCHIVE LOG CURRENT.

integer

Specifies a single log sequence number.

BETWEEN integer AND integer

Specifies a range of log sequence numbers. SEQUENCE BETWEEN integer1 AND integer2 is exactly equivalent to FROM SEQUENCE integer1 UNTIL SEQUENCE integer2.

UNTIL SEQUENCE = integer

Specifies the terminating log sequence number for a sequence of archived redo log files. If you do not specify the FROM SEQUENCE parameter, RMAN uses the lowest available log sequence number to begin the sequence.

If the database is open when you run BACKUP ARCHIVELOG, and if the UNTIL clause is specified, then RMAN does not run ALTER SYSTEM ARCHIVE LOG CURRENT.

FROM TIME = 'date_string'

Specifies the beginning date for a sequence of archived redo log files. The clause specifies those logs that could be used in a recovery starting at the indicated time.

The time specified in the string must be formatted according to the Globalization Technology date format specification currently in effect, but can also be any SQL expression with the DATE datatype, such as SYSDATE. The TO_DATE function can be used to specify hard-coded dates that work regardless of the current Globalization Technology settings.

If you do not specify the UNTIL TIME parameter, RMAN will include all available log files beginning with the date specified in the FROM TIME parameter. Use the V$ARCHIVED_LOG data dictionary view to determine the time stamps for the first and last entries in a log file.

Note: The FROM TIME clause is not the same as the COMPLETED AFTER clause. FROM TIME specifies logs that could be used to recover starting at the indicated time, whereas COMPLETED AFTER specifies logs that were created after the indicated time (refer to "completedTimeSpec").

See Also: Oracle Database Reference for information on how to use the NLS_LANG and NLS_DATE_FORMAT environment variables to specify the format for the time

TIME BETWEEN 'date_string' AND 'date_string'

Specifies a range of times. Note that TIME BETWEEN 'date_string' AND 'date_string' is exactly equivalent to FROM TIME 'date_string' UNTIL TIME 'date_string'.

UNTIL TIME = 'date_string'

Specifies the end date for a sequence of archived redo log files. The clause specifies those logs that could be used to recover to the indicated time.

The time specified in the string must be formatted according to the Globalization Technology date format specification currently in effect, but can also be any SQL expression with the DATE datatype, such as SYSDATE. The TO_DATE function can be used to specify hard-coded dates that work regardless of the current Globalization Technology settings.

If you do not specify the FROM TIME parameter, then the beginning time for the sequence will be the earliest available archived redo log.

If the database is open when you run BACKUP ARCHIVELOG, and if the UNTIL clause is specified, then RMAN does not run ALTER SYSTEM ARCHIVE LOG CURRENT.

Note: The UNTIL TIME clause is not the same as the COMPLETED BEFORE clause. UNTIL TIME specifies logs that could be used to recover to the indicated time, whereas COMPLETED BEFORE specifies logs that were created before the indicated time (refer to "completedTimeSpec").

See Also: Oracle Database Reference for information on how to use the NLS_LANG and NLS_DATE_FORMAT environment variables to specify the format for the time

THREAD = integer

Specifies the thread containing the archived redo log files you wish to include. You only need to specify this parameter when running the database in an Oracle Real Application Clusters (RAC) configuration.

THREAD is only valid when SEQUENCE is also specified. Although the SEQUENCE parameter does not require that THREAD be specified, a given log sequence always implies a thread. The thread defaults to 1 if not specified. Query V$ARCHIVED_LOG to check the thread number for a log.

Examples

Specifying Records by Time: Example

This example backs up all logs that could be used to recover to a point one week ago, and then deletes all archived redo logs that were created more than two weeks ago:

BACKUP ARCHIVELOG UNTIL TIME 'SYSDATE-7';
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-14';
Specifying Records by SCN: Example

This example restores backup archived redo log files from tape that fall within a range of SCNs:

RESTORE ARCHIVELOG SCN BETWEEN 94097 AND 106245;
Specifying a Single Log Sequence Number: Example

This example backs up only archived log 30 of thread 1 and then deletes it.

BACKUP ARCHIVELOG SEQUENCE 30 DELETE INPUT;
Specifying a Range of Records by Log Sequence Number: Example

This example backs up all archived logs from sequence 431 to sequence 440 on thread 1 and deletes the archived logs after the backup is complete. If the backup fails, the logs are not deleted.

RUN
{
  ALLOCATE CHANNEL dev1 DEVICE TYPE sbt;
  BACKUP ARCHIVELOG 
    SEQUENCE BETWEEN 31 AND 40 THREAD 1
    # delete original archived redo logs after backup completes
    DELETE INPUT;
}
Specifying All Log Sequence Numbers in a Thread

This example crosschecks all archived redo logs in thread 1:

CROSSCHECK ARCHIVELOG FROM SEQUENCE 0 THREAD 1;