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.
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:
The database is currently operating in ARCHIVELOG mode. |
| Automatic archiving is enabled. | |||||||
The archived redo log's destination is D:\ORANT\oradata\IDDB2\archive.
The oldest filled online redo log group has a sequence number of 11160. | The next filled online redo log group to archive
has a sequence number of 11163.
| The 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:
ALTER DATABASE ARCHIVELOG; ALTER DATABASE OPEN;
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.
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;
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.
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;
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.
Back to CS643 schedule