Skip Headers
Oracle® Database Administrator's Guide
11g Release 1 (11.1)

B28310-04
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
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

Specifying the Archive Destination

Before you can archive redo logs, you must determine the destination to which you will archive and familiarize yourself with the various destination states. The dynamic performance (V$) views, listed in "Viewing Information About the Archived Redo Log", provide all needed archive information.

The following topics are contained in this section:

Specifying Archive Destinations

You can choose whether to archive redo logs to a single destination or multiplex them. If you want to archive only to a single destination, you specify that destination in the LOG_ARCHIVE_DEST initialization parameter. If you want to multiplex the archived logs, you can choose whether to archive to up to ten locations (using the LOG_ARCHIVE_DEST_n parameters) or to archive only to a primary and secondary destination (using LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST). The following table summarizes the multiplexing alternatives, which are further described in the sections that follow.

Method Initialization Parameter Host Example
1 LOG_ARCHIVE_DEST_n

where:

n is an integer from 1 to 10

Local or remote LOG_ARCHIVE_DEST_1 = 'LOCATION=/disk1/arc'

LOG_ARCHIVE_DEST_2 = 'SERVICE=standby1'

2 LOG_ARCHIVE_DEST and

LOG_ARCHIVE_DUPLEX_DEST

Local only LOG_ARCHIVE_DEST = '/disk1/arc'

LOG_ARCHIVE_DUPLEX_DEST = '/disk2/arc'


See Also:

  • Oracle Database Reference for additional information about the initialization parameters used to control the archiving of redo logs

  • Oracle Data Guard Concepts and Administration for information about using the LOG_ARCHIVE_DEST_n initialization parameter for specifying a standby destination. There are additional keywords that can be specified with this initialization parameter that are not discussed in this book.

Method 1: Using the LOG_ARCHIVE_DEST_n Parameter

Use the LOG_ARCHIVE_DEST_n parameter (where n is an integer from 1 to 10) to specify from one to ten different destinations for archival. Each numerically suffixed parameter uniquely identifies an individual destination.

You specify the location for LOG_ARCHIVE_DEST_n using the keywords explained in the following table:

Keyword Indicates Example
LOCATION A local file system location. LOG_ARCHIVE_DEST_1 = 'LOCATION=/disk1/arc'
SERVICE Remote archival through Oracle Net service name. LOG_ARCHIVE_DEST_2 = 'SERVICE=standby1'

If you use the LOCATION keyword, specify a valid path name for your operating system. If you specify SERVICE, the database translates the net service name through the tnsnames.ora file to a connect descriptor. The descriptor contains the information necessary for connecting to the remote database. The service name must have an associated database SID, so that the database correctly updates the log history of the control file for the standby database.

Perform the following steps to set the destination for archived redo logs using the LOG_ARCHIVE_DEST_n initialization parameter:

  1. Use SQL*Plus to shut down the database.

    SHUTDOWN 
    
  2. Set the LOG_ARCHIVE_DEST_n initialization parameter to specify from one to ten archiving locations. The LOCATION keyword specifies an operating system specific path name. For example, enter:

    LOG_ARCHIVE_DEST_1 = 'LOCATION = /disk1/archive'
    LOG_ARCHIVE_DEST_2 = 'LOCATION = /disk2/archive'
    LOG_ARCHIVE_DEST_3 = 'LOCATION = /disk3/archive'
    

    If you are archiving to a standby database, use the SERVICE keyword to specify a valid net service name from the tnsnames.ora file. For example, enter:

    LOG_ARCHIVE_DEST_4 = 'SERVICE = standby1'
    
  3. Optionally, set the LOG_ARCHIVE_FORMAT initialization parameter, using %t to include the thread number as part of the file name, %s to include the log sequence number, and %r to include the resetlogs ID (a timestamp value represented in ub4). Use capital letters (%T, %S, and %R) to pad the file name to the left with zeroes.

    Note:

    If the COMPATIBLE initialization parameter is set to 10.0.0 or higher, the database requires the specification of resetlogs ID (%r) when you include the LOG_ARCHIVE_FORMAT parameter. The default for this parameter is operating system dependent. For example, this is the default format for UNIX:

    LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf

    The incarnation of a database changes when you open it with the RESETLOGS option. Specifying %r causes the database to capture the resetlogs ID in the archived redo log file name. See Oracle Database Backup and Recovery User's Guide for more information about this method of recovery.

    The following example shows a setting of LOG_ARCHIVE_FORMAT:

    LOG_ARCHIVE_FORMAT = arch_%t_%s_%r.arc
    

    This setting will generate archived logs as follows for thread 1; log sequence numbers 100, 101, and 102; resetlogs ID 509210197. The identical resetlogs ID indicates that the files are all from the same database incarnation:

    /disk1/archive/arch_1_100_509210197.arc, 
    /disk1/archive/arch_1_101_509210197.arc, 
    /disk1/archive/arch_1_102_509210197.arc
    
    /disk2/archive/arch_1_100_509210197.arc, 
    /disk2/archive/arch_1_101_509210197.arc, 
    /disk2/archive/arch_1_102_509210197.arc
    
    /disk3/archive/arch_1_100_509210197.arc, 
    /disk3/archive/arch_1_101_509210197.arc, 
    /disk3/archive/arch_1_102_509210197.arc
    

Method 2: Using LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST

To specify a maximum of two locations, use the LOG_ARCHIVE_DEST parameter to specify a primary archive destination and the LOG_ARCHIVE_DUPLEX_DEST to specify an optional secondary archive destination. All locations must be local. Whenever the database archives a redo log, it archives it to every destination specified by either set of parameters.

Perform the following steps the use method 2:

  1. Use SQL*Plus to shut down the database.

    SHUTDOWN
    
  2. Specify destinations for the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST parameter (you can also specify LOG_ARCHIVE_DUPLEX_DEST dynamically using the ALTER SYSTEM statement). For example, enter:

    LOG_ARCHIVE_DEST = '/disk1/archive'
    LOG_ARCHIVE_DUPLEX_DEST = '/disk2/archive'
    
  3. Set the LOG_ARCHIVE_FORMAT initialization parameter as described in step 3 for method 1.

Understanding Archive Destination Status

Each archive destination has the following variable characteristics that determine its status:

  • Valid/Invalid: indicates whether the disk location or service name information is specified and valid

  • Enabled/Disabled: indicates the availability state of the location and whether the database can use the destination

  • Active/Inactive: indicates whether there was a problem accessing the destination

Several combinations of these characteristics are possible. To obtain the current status and other information about each destination for an instance, query the V$ARCHIVE_DEST view.

The characteristics determining a locations status that appear in the view are shown in Table 11-1. Note that for a destination to be used, its characteristics must be valid, enabled, and active.

Table 11-1 Destination Status

STATUS Characteristics Meaning
Valid Enabled Active

VALID

True

True

True

The user has properly initialized the destination, which is available for archiving.

INACTIVE

False

n/a

n/a

The user has not provided or has deleted the destination information.

ERROR

True

True

False

An error occurred creating or writing to the destination file; refer to error data.

FULL

True

True

False

Destination is full (no disk space).

DEFERRED

True

False

True

The user manually and temporarily disabled the destination.

DISABLED

True

False

False

The user manually and temporarily disabled the destination following an error; refer to error data.

BAD PARAM

n/a

n/a

n/a

A parameter error occurred; refer to error data.


The LOG_ARCHIVE_DEST_STATE_n (where n is an integer from 1 to 10) initialization parameter lets you control the availability state of the specified destination (n).

  • ENABLE indicates that the database can use the destination.

  • DEFER indicates that the location is temporarily disabled.

  • ALTERNATE indicates that the destination is an alternate.

The availability state of the destination is DEFER, unless there is a failure of its parent destination, in which case its state becomes ENABLE.