Oracle7 Server Administrator's Guide

Contents Index Home Previous Next

Turning Archiving On and Off

This section describes aspect of archiving, and includes the following topics:

You set a database's initial archiving mode as part of database creation. Usually, you can use the default of NOARCHIVELOG mode at database creation because there is no need to archive the redo information generated then. After creating the database, decide whether to change from the initial archiving mode.

After a database has been created, you can switch the database's archiving mode on demand. However, you should generally not switch the database between archiving modes.

See Also: If a database is automatically created during Oracle installation, the initial archiving mode of the database is operating system specific. See your operating system-specific Oracle documentation.

Setting the Initial Database Archiving Mode

When you create the database, you set the initial archiving mode of the redo log in the CREATE DATABASE statement. If you do not specify either ARCHIVELOG or NOARCHIVELOG, NOARCHIVELOG is the default.

See Also: See Chapter 2 for more information about creating a database.

Changing the Database Archiving Mode

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

ALTER DATABASE ARCHIVELOG;

Before switching the database's archiving mode, perform the following operations:

To Prepare to Switch Database Archiving Mode

Note: If you are using the Oracle Parallel Server, you must mount the database exclusively, using one instance, to switch the database's archiving mode.

After using the ALTER DATABASE command to switch a database's archiving mode, open the database for normal operation. If you switched to ARCHIVELOG mode, you should also set the archiving options--decide whether to enable Oracle to archive groups of online redo log files automatically as they fill.

See Also: For more information about starting an instance and mounting a database, see Chapter 3.

If you want to archive filled groups, you may have to execute some additional steps at this point, depending on your operating system; see your operating system-specific Oracle documentation for details for your system.

For more information about database backup, see Chapter 23.

See the Oracle7 Parallel Server Concepts & Administration guide for more information about switching the archiving mode when using the Oracle Parallel Server.

Enabling Automatic Archiving

If your operating system permits, you can enable automatic archiving of the online redo log. Under this option, no action is required to copy a group after it fills; Oracle automatically archives groups after they are filled. For this convenience alone, automatic archiving is the method of choice for archiving the filled groups of online redo log files.

To enable automatic archiving after instance startup, you must be connected to Oracle with administrator privileges.

Attention: Oracle does not automatically archive log files unless the database is also in ARCHIVELOG mode.

Automatic archiving can be enabled before or after instance startup.

See Also: See your operating system-specific Oracle documentation to determine whether this is a valid option for your Oracle Server.

Always specify an archived redo log destination and filename format when enabling automatic archiving; see "Specifying the Archived Redo Log Filename Format and Destination" [*].

If automatic archiving is enabled, manual archiving is still possible; see "Performing Manual Archiving" [*].

Enabling Automatic Archiving at Instance Startup

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

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 command ALTER SYSTEM with the ARCHIVE LOG START parameter; you can optionally include the archiving destination.

The following statement enables archiving:

ALTER SYSTEM ARCHIVE LOG START;

Using either of the options above, the instance does not have to be shut down to enable automatic archiving. However, if an instance is shut down and restarted after automatic archiving is enabled, the instance is reinitialized using the settings of the parameter file, which may or may not enable automatic archiving.

Disabling Automatic Archiving

You can disable automatic archiving of the online redo log groups at any time. However, once automatic archiving is disabled, you must manually archive groups of online redo log files in a timely fashion. If a database is operated in ARCHIVELOG mode, automatic archiving is disabled, and all groups of online redo log files are filled but not archived, then LGWR cannot reuse any inactive groups of online redo log groups to continue writing redo log entries. Therefore, database operation is temporarily suspended until the necessary archiving is performed.

To disable automatic archiving after instance startup, you must be connected with administrator privilege and have the ALTER SYSTEM privilege.

Automatic archiving can be disabled at or after instance startup.

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 parameter of a database's 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 command ALTER SYSTEM with the ARCHIVE LOG STOP parameter. The following statement stops archiving:

ALTER SYSTEM ARCHIVE LOG STOP;

If ARCH is archiving a redo log group when you attempt to disable automatic archiving, ARCH finishes archiving the current group, but does not begin archiving the next filled online redo log group.

The instance does not have to be shut down to disable automatic archiving. However, if an instance is shut down and restarted after automatic archiving is disabled, the instance is reinitialized using the settings of the parameter file, which may or may not enable automatic archiving.

Performing Manual Archiving

If a database is operating in ARCHIVELOG mode, inactive groups of filled online redo log files must be archived. You can manually archive groups of the online redo log whether or not automatic archiving is enabled:

To manually archive a filled online redo log group, you must be connected with administrator privileges.

Manually archive inactive groups of filled online redo log members using the SQL command ALTER SYSTEM with the ARCHIVE LOG clause.

The following statement archives all unarchived log files:

ALTER SYSTEM ARCHIVE LOG ALL;

See Also: With both manual or automatic archiving, you need to specify a thread only when you are using the Oracle Parallel Server. See the Oracle7 Parallel Server Concepts & Administration guide for more information.


Contents Index Home Previous Next