RelationalDBDesign RelationalDBDesign

Archiving Redo log   «Prev  Next»

Archive log destination

Lesson 3 The archive log destination
ObjectiveSpecify the destination for archived log files.
With archivelog mode turned on, you need to make a copy of each log file before Oracle will reuse it. This process of copying the log files is referred to as archiving. Before you can archive a log file, you must specify the location in which the archived copies are to be placed. This location is known as the archive log destination.

Setting the Archive Log Destination

You can control the archive log destination using the log_archive_dest initialization parameter. You set this in your initialization parameter file, and the setting takes effect the next time the database is started. The following setting, for example, sets the archive log destination to a directory on the E: drive:
log_archive_dest = 'E:\ORADATA\COIN\ARCHIVE'

This parameter may also be modified while the database is open. For that, use the ALTER SYSTEM command, as shown here:

SET log_archive_dest = 'E:\ORADATA\COIN\ARCHIVE';
Once the destination is set, whenever a log file is archived (whether manually or automatically), Oracle will copy it to that location.

Setting Second destination

For added security, you can define a second archive log destination. You might choose to do this if your drives are not mirrored. You define a second archive log destination using the log_archive_duplex_dest initialization parameter. If you define two destinations, Oracle makes an archive copy of each log file in both directories. By default, the duplex destination is optional. If a copy to that destination fails, Oracle will still continue to function. You can control whether or not the duplex destination is mandatory by using the log_archive_min_succeed_dest parameter. Here's an example:

log_archive_dest = 'E:\ORADATA\COIN\ARCHIVE'

log_archive_duplex_dest = 'H:\ORADATA\COIN\ARCHIVE'

log_archive_min_succeed_dest = 2

Here, two destinations have been defined, and the log_archive_min_succeed_dest parameter has been set to 2. If Oracle cannot archive a log file to both locations, then Oracle will stop until you fix the problem. If a value of 1 had been used, which is the default, Oracle would ignore failures when copying to the duplex destination.


Oracle8i changed the way that archive log destinations were specified.

Archive log destinations in Oracle8i

Oracle8i changes the way in which archive log destinations are specified. Instead of just two locations controlled by the log_archive_dest and log_archive_duplex_dest parameters, Oracle8i allows you to have up to five archive log destinations. These locations are specified using the parameters log_archive_dest_1 through log_archive_dest_5. The following syntax must be used:

log_archive_dest_n = '{SERVICE=service_name




The parameters are as follows:
  1. n: A number from 1 through 5.
  2. service_name: A Net8 service name.
  3. directory: A directory path.
  4. MANDATORY: The destination is a required destination.
  5. OPTIONAL: The destination is optional. This is the default setting. However, the log_archive_min_succeed_dest setting still applies.
  6. seconds: A retry interval. Oracle will retry a failed transfer after the specified number of seconds.

Using this new method of specifying archive log destinations is not compatible with the 8.0 method. Oracle8i still supports the old method, but you must use either the old or the new. You can't mix them.
You will learn how to name archive log files in the next lesson.