This page contains materials that were copied from Oracle's on-line documents.

Oracle enables you to save filled groups of online redo log files to one or more offline destinations, known collectively as the archived redo log, or more simply archive logs. Archiving is only possible if the database is running in ARCHIVELOG mode. You can configure an instance to archive filled online redo log files automatically, or you can archive manually. For convenience and efficiency, automatic archiving is usually best.

There are several dynamic performance views that contain useful information about archived redo logs.

 
Dynamic Performance View  Description 

V$DATABASE 

Identifies whether the database is in ARCHIVELOG or NOARCHIVELOG mode. 

V$ARCHIVED_LOG 

Displays historical archived log information from the control file. If you use a recovery catalog, the RC_ARCHIVED_LOG view contains similar information. 

V$ARCHIVE_DEST 

Describes the current instance, all archive destinations, and the current value, mode, and status of these destinations. 

V$ARCHIVE_PROCESSES 

Displays information about the state of the various archive processes for an instance. 

V$BACKUP_REDOLOG 

Contains information about any backups of archived logs. If you use a recovery catalog, the RC_BACKUP_REDOLOG contains similar information. 

V$LOG 

Displays all online redo log groups for the database and indicates which need to be archived. 

V$LOG_HISTORY 

Contains log history information such as which logs have been archived and the SCN range for each archived log. 

The ARCHIVE LOG LIST Command

The SQL*Plus command ARCHIVE LOG LIST can be used to show archiving information for the connected instance. For example:

SQL> ARCHIVE LOG LIST

Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\ORANT\oradata\IDDB2\archive
Oldest online log sequence     11160
Next log sequence to archive   11163
Current log sequence           11163

This display tells you all the necessary information regarding the archived redo log settings for the current instance:

bulletThe database is currently operating in ARCHIVELOG mode.
bulletAutomatic archiving is enabled.
bulletThe archived redo log's destination is D:\ORANT\oradata\IDDB2\archive.
bulletThe oldest filled online redo log group has a sequence number of 11160.
bulletThe next filled online redo log group to archive has a sequence number of 11163.
bulletThe current online redo log file has a sequence number of 11163.

To switch a database's archiving mode between NOARCHIVELOG and ARCHIVELOG mode, use the SQL statement ALTER DATABASE with the ARCHIVELOG or NOARCHIVELOG option. The following steps switch a database's archiving mode from NOARCHIVELOG to ARCHIVELOG:

  1. Shut down the database instance: SHUTDOWN
  2. Back up the database.
  3. Edit the initialization parameter file to include initialization parameters specifying whether automatic archiving is enabled and the destinations for the archive log files.
  4. Start a new instance and mount, but do not open, the database: STARTUP MOUNT
  5. Switch the database's archiving mode. Then open the database for normal operations.
    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;
    

Enabling Automatic Archiving at Instance Startup

To enable automatic archiving of filled groups each time an instance is started, include the initialization parameter LOG_ARCHIVE_START in the database's initialization parameter file and set it to TRUE:

LOG_ARCHIVE_START=TRUE

The new value takes effect the next time you start the database.

Enabling Automatic Archiving After Instance Startup

To enable automatic archiving of filled online redo log groups without shutting down the current instance, use the SQL statement ALTER SYSTEM with the ARCHIVE LOG START clause. You can optionally include the archiving destination.

ALTER SYSTEM ARCHIVE LOG START;

Disabling Automatic Archiving at Instance Startup

To disable the automatic archiving of filled online redo log groups each time a database instance is started, set the LOG_ARCHIVE_START initialization parameter of a database's initialization parameter file to FALSE:

LOG_ARCHIVE_START=FALSE

The new value takes effect the next time the database is started.

Disabling Automatic Archiving after Instance Startup

To disable the automatic archiving of filled online redo log groups without shutting down the current instance, use the SQL statement ALTER SYSTEM with the ARCHIVE LOG STOP parameter. The following statement stops archiving:

ALTER SYSTEM ARCHIVE LOG STOP;

Specifying Archive Destinations

You must decide whether to make a single destination for the logs or multiplex them. When you multiplex them, you archive the logs to more than one location. You specify your choice by setting initialization parameters in "path\pfile\init.ora" according to one of the following methods. Make sure the database is shut down before modifying the parameters.

Initialization Parameter  Host  Example 

LOG_ARCHIVE_DEST_n where: n is an integer from 1 to 10 

Local or remote 

LOG_ARCHIVE_DEST_1 = 'LOCATION= \path1\arc' 
LOG_ARCHIVE_DEST_2 = 'SERVICE = standby1' 

LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST 

Local only 

LOG_ARCHIVE_DEST = '\path1\arc' 
LOG_ARCHIVE_DUPLEX_DEST ='path2\arc' 

Back to CS643 schedule