Oracle® Database Backup and Recovery Reference 11g Release 1 (11.1) Part Number B28273-01 |
|
|
View PDF |
Purpose
Use the archivelogRecordSpecifier subclause to specify a set of archived redo logs for use in RMAN operations.
Syntax
archlogRange::=
Semantics
This subclause specifies either all archived redo logs or logs whose filenames match a specified pattern.
Syntax Element | Description |
---|---|
ALL |
Specifies all available archived logs. |
LIKE ' string_pattern ' |
Specifies all archived logs that match the specified string_pattern . You can use the same pattern matching characters that are valid in the LIKE operator in the SQL language to match multiple files.
See Also: Oracle Real Application Clusters Administration and Deployment Guide to learn about using RMAN in an Oracle RAC configuration |
archlogRange
This subclause specifies a range of archived redo logs by SCN, time, restore point (which is a label for a timestamp or SCN), or log sequence number. This subclause is useful for identifying the point to which you want the database to be recoverable.
RMAN queries the V$ARCHIVED_LOG
or RC_ARCHIVED_LOG
view to determine which logs to include in the range. When you specify a time, SCN, or restore point, RMAN determines the range according to the contents of the archived redo logs, not when the logs were created or backed up. When you specify the range by log sequence number, then RMAN uses the sequence number to determine the range.
Table 3-1 explains how RMAN determines which logs are in the range. The columns FIRST_TIME
, NEXT_TIME
, and so on refer to columns in V$ARCHIVED_LOG
. For example, if you specify FROM SCN 1000
UNTIL SCN 2000
, then RMAN includes all logs whose V$ARCHIVED_LOG.NEXT_SCN
value is greater than 1000 and whose V$ARCHIVED_LOG.FIRST_SCN
value is less than or equal to 2000.
Table 3-1 Determining Logs for Inclusion in the Range
Subclause | FIRST_TIME | NEXT_TIME | FIRST_SCN | NEXT_SCN | SEQUENCE# |
---|---|---|---|---|---|
|
n/a |
Later than t1 |
n/a |
n/a |
n/a |
|
Earlier than or the same as t2 |
Later than t1 |
n/a |
n/a |
n/a |
|
Earlier than or the same as t2 |
n/a |
n/a |
n/a |
n/a |
|
n/a |
n/a |
n/a |
Greater than s1 |
n/a |
|
n/a |
n/a |
Less than or equal to s2 |
Greater than s1 |
n/a |
|
n/a |
n/a |
Less than or equal to s2 |
n/a |
n/a |
|
n/a |
n/a |
n/a |
n/a |
Between q1 and the maximum sequence (inclusive) |
|
n/a |
n/a |
n/a |
n/a |
Between q1 and q2 (inclusive) |
|
n/a |
n/a |
n/a |
n/a |
Between 0 and q2 (inclusive) |
The time must be formatted according to the Globalization Technology date format specification currently in effect. If your current Globalization settings do not specify the time, then string dates default to 00 hours, 00 minutes, and 00 seconds.
The date_string
can be any SQL expression of type DATE
, such as SYSDATE
. You can use TO_DATE
to specify hard-coded dates that work regardless of the current Globalization Technology settings. SYSDATE
always has seconds precision regardless of the Globalization settings. Thus, if today is March 15, 2007, then SYSDATE-10
is not equivalent to 05-MAR-07
or TO_DATE('03/15/2007','MM/DD/YYYY')-10
.
Specifying a sequence of archived redo logs does not guarantee that RMAN includes all redo data in the sequence. For example, the last available archived log file may end before the end of the sequence, 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.
See Also:
Oracle Database Reference to learn how to use theNLS_LANG
and NLS_DATE_FORMAT
environment variables to specify time formatSyntax Element | Description |
---|---|
FROM SCN integer |
Specifies the beginning SCN for a range of archived redo log files. If you do not specify the UNTIL SCN parameter, then RMAN includes all available log files beginning with SCN specified in the FROM SCN parameter. |
SCN BETWEEN integer AND integer |
Specifies the beginning and ending SCN for a range of logs. This syntax is semantically equivalent to FROM SCN integer1 UNTIL SCN integer2 . |
UNTIL SCN integer |
Specifies the ending SCN for a range of archived redo log files (see Table 3-1 for the rules determining the range). |
FROM SEQUENCE integer |
Specifies the beginning log sequence number for a sequence of archived redo log files (see Table 3-1 for the rules determining the range).
Note: You can specify all log sequence numbers in a thread by using the syntax shown in Example 3-6. |
SEQUENCE integer |
Specifies a single log sequence number. |
SEQUENCE BETWEEN integer AND integer |
Specifies a range of log sequence numbers. This syntax is semantically 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 (see Table 3-1 for the rules determining the range). |
THREAD integer |
Specifies the thread containing the archived redo log files you wish to include. This parameter is only necessary the database is in an Oracle RAC configuration.
Although the |
FROM TIME ' date_string ' |
Specifies the beginning time for a range of archived redo logs (see Table 3-1 for the rules determining the range). Example 3-5 shows FROM TIME in a LIST command. |
TIME BETWEEN ' date_string ' AND 'date_string ' |
Specifies a range of times. This syntax is semantically equivalent to FROM TIME ' date_string ' UNTIL TIME ' date_string ' . |
UNTIL TIME ' date_string ' |
Specifies the end time for a range of archived redo logs (see Table 3-1 for the rules determining the range). Example 3-4 shows UNTIL TIME in a BACKUP command. |
Examples
Example 3-4 Specifying Records by Recovery Point-in-Time
Assume that you want to be able to recover the database to a point in time 5 days before now. You want to back up a range of archived redo logs that makes this point-in-time recovery possible.
You can use the UNTIL TIME 'SYSDATE-5'
clause to specify that all logs in the range have a first time (shown by V$ARCHIVED_LOG.FIRST_TIME
) that is earlier than or the same as SYSDATE-5
. This function resolves to a time with seconds precision five days before now.
CONNECT TARGET / BACKUP ARCHIVELOG UNTIL TIME 'SYSDATE-5';
Example 3-5 Listing Archived Log Backups by Time
As shown in Table 3-1, when you specify date_string
for a range of archived redo logs, you are not specifying the backup time or creation time of the log. Assume that archived log 32 has a next time of March 6.
SQL> SELECT SEQUENCE#, NEXT_TIME 2 FROM V$ARCHIVED_LOG 3 WHERE SEQUENCE#='32'; SEQUENCE# NEXT_TIME ---------- --------- 50 06-MAR-07
On March 8 you run the following BACKUP
and LIST
commands:
RMAN> BACKUP ARCHIVELOG SEQUENCE 32; Starting backup at 08-MAR-07 allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=109 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Oracle Secure Backup channel ORA_SBT_TAPE_1: starting archived log backup set channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set input archived log thread=1 sequence=32 RECID=125 STAMP=616528547 channel ORA_SBT_TAPE_1: starting piece 1 at 08-MAR-07 channel ORA_SBT_TAPE_1: finished piece 1 at 08-MAR-07 piece handle=6kic3fkm_1_1 tag=TAG20070308T111014 comment=API Version 2.0,MMS Version 10.1.0.3 channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25 Finished backup at 08-MAR-07 Starting Control File and SPFILE Autobackup at 08-MAR-07 piece handle=c-28014364-20070308-08 comment=API Version 2.0,MMS Version 10.1.0.3 Finished Control File and SPFILE Autobackup at 08-MAR-07 RMAN> LIST BACKUP OF ARCHIVELOG FROM TIME 'SYSDATE-1'; RMAN>
Because the next time of log 32 is earlier than the range of times specified in the FROM TIME
clause, the preceding LIST BACKUP
command does not show the backup of archived log 32.