Oracle® Database Administrator's Guide 11g Release 2 (11.2) Part Number E10595-04 |
|
|
View PDF |
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.
This section contains:
You can choose to archive redo logs to a single destination or to multiple destinations. Destinations can be local—within the local file system or an Oracle Automatic Storage Management (Oracle ASM) disk group—or remote (on a standby database). When you archive to multiple destinations, a copy of each filled redo log file is written to each destination. These redundant copies help ensure that archived logs are always available in the event of a failure at one of the destinations.
If you want to archive to only a single destination, then specify that destination using the LOG_ARCHIVE_DEST
initialization parameter. If you want to archive to multiple destinations, then you can choose to archive to two or more locations using the LOG_ARCHIVE_DEST_n
initialization parameters, or to archive only to a primary and secondary destination using the LOG_ARCHIVE_DEST
and LOG_ARCHIVE_DUPLEX_DEST
initialization parameters.
For local destinations, in addition to the local file system or an Oracle ASM disk group, you can archive to the Fast Recovery Area. The database uses the Fast Recovery Area to store and automatically manage disk space for a variety of files related to backup and recovery. See Oracle Database Backup and Recovery User's Guide for details about the Fast Recovery Area.
Typically, you determine archive log destinations during database planning, and you set the initialization parameters for archive destinations during database installation. However, you can use the ALTER
SYSTEM
command to dynamically add or change archive destinations after your database is running. Any destination changes that you make take effect at the next log switch (automatic or manual).
The following table summarizes the archive destination alternatives, which are further described in the sections that follow.
Use the LOG_ARCHIVE_DEST_
n
parameter (where n is an integer from 1 to 31) to specify from one to 31 different destinations for archived logs. 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 or Oracle ASM disk group | LOG_ARCHIVE_DEST_ n = 'LOCATION=/disk1/arc'
|
LOCATION |
The Fast Recovery Area | LOG_ARCHIVE_DEST_ n = 'LOCATION=USE_DB_RECOVERY_FILE_DEST' |
SERVICE |
Remote archival through Oracle Net service name. | LOG_ARCHIVE_DEST_ n = 'SERVICE=standby1' |
If you use the LOCATION
keyword, specify one of the following:
A valid path name in your operating system's local file system
An Oracle ASM disk group
The keyword USE_DB_RECOVERY_FILE_DEST
to indicate the Fast Recovery Area
If you specify SERVICE
, supply a net service name that Oracle Net can resolve to a connect descriptor for a standby database. The connect descriptor contains the information necessary for connecting to the remote database.
Perform the following steps to set the destination for archived redo logs using the LOG_ARCHIVE_DEST_
n
initialization parameter:
Set the LOG_ARCHIVE_DEST_
n
initialization parameter to specify from one to 31 archiving locations. For example, enter:
LOG_ARCHIVE_DEST_1 = 'LOCATION = /disk1/archive' LOG_ARCHIVE_DEST_2 = 'LOCATION = /disk2/archive' LOG_ARCHIVE_DEST_3 = 'LOCATION = +RECOVERY'
If you are archiving to a standby database, then use the SERVICE
keyword to specify a valid net service name. For example, enter:
LOG_ARCHIVE_DEST_4 = 'SERVICE = standby1'
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 theCOMPATIBLE
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
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:
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'
Set the LOG_ARCHIVE_FORMAT
initialization parameter as described in step 2 for method 1.
Note:
If you configure a Fast Recovery Area (by setting theDB_RECOVERY_FILE_DEST
and DB_RECOVERY_FILE_DEST_SIZE
parameters) and do not specify any local archive destinations, the database automatically selects the Fast Recovery Area as a local archive destination and sets LOG_ARCHIVE_DEST_1
to USE_DB_RECOVERY_FILE_DEST
.WARNING:
You must ensure that there is sufficient disk space at all times for archive log destinations. If the database encounters a disk full error as it attempts to archive a log file, a fatal error occurs and the database stops responding. You can check the alert log for a disk full message.
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.
Oracle Database Net Services Administrator's Guide for a discussion of net service names and connect descriptors.
Oracle Database Backup and Recovery User's Guide for information about the Fast Recovery Area
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 LOG_ARCHIVE_DEST_STATE_
n
(where n is an integer from 1 to 31) 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 an alternate destination is DEFER
. If its parent destination fails, the availability state of the alternate becomes ENABLE
. ALTERNATE
cannot be specified for destinations LOG_ARCHIVE_DEST_11
to LOG_ARCHIVE_DEST_31
.
If you want to specify that a location be an archive destination only in the event of a failure of another destination, you can make it an alternate destination. Both local and remote destinations can be alternates. The following example makes LOG_ARCHIVE_DEST_4
an alternate for LOG_ARCHIVE_DEST_3
:
ALTER SYSTEM SET LOG_ARCHIVE_DEST_4 = 'LOCATION=/disk4/arch'; ALTER SYSTEM SET LOG_ARCHIVE_DEST_3 = 'LOCATION=/disk3/arch ALTERNATE=LOG_ARCHIVE_DEST_4'; ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_4=ALTERNATE; SQL> SELECT dest_name, status, destination FROM v$archive_dest; DEST_NAME STATUS DESTINATION ----------------------- --------- ---------------------------------------------- LOG_ARCHIVE_DEST_1 VALID /disk1/arch LOG_ARCHIVE_DEST_2 VALID +RECOVERY LOG_ARCHIVE_DEST_3 VALID /disk3/arch LOG_ARCHIVE_DEST_4 ALTERNATE /disk4/arch