|Oracle7 Server Administrator's Guide||
This chapter contains several references to Oracle Server Manager. For more information about performing specific tasks using Server Manager/GUI or Server Manager/LineMode, see the Oracle Server Manager User's Guide.
NOARCHIVELOG mode protects a database only from instance failure, not from disk (media) failure. Only the most recent changes made to the database, stored in the groups of the online redo log, are available for instance recovery. In other words, if you are using NOARCHIVELOG mode, you can only restore (not recover) the database to the point of the most recent full database backup. You cannot recover subsequent transactions.
Also, in NOARCHIVELOG mode, you cannot perform online tablespace backups. Furthermore, you cannot use online tablespace backups previously taken while the database operated in ARCHIVELOG mode. Only full backups taken while the database is closed can be used to restore a database operating in NOARCHIVELOG mode. Therefore, if you decide to operate a database in NOARCHIVELOG mode, take full database backups at regular, frequent intervals.
Figure 22 - 1 illustrate how the database's online redo log is generated by the process archiving the filled groups (ARCH in this illustration).
Figure 22 - 1. Online Redo Log File Use in ARCHIVELOG Mode
ARCHIVELOG mode enables complete recovery from disk failure as well as instance failure, because all changes made to the database are permanently saved in an archived redo log.
If all databases in a distributed database operate in ARCHIVELOG mode, you can perform coordinated distributed database recovery. However, if any database in a distributed database uses NOARCHIVELOG mode, recovery of a global distributed database (to make all databases consistent) is limited by the last full backup of any database operating in NOARCHIVELOG mode.
Also, the entire database can be open and available for normal use while you back up or recover all or part of the database in ARCHIVELOG mode. Note that extra administrative operations are required to manage the files of the archived redo log, and that you must have a dedicated tape drive or additional disk space to store the archived redo log files when the database operates in ARCHIVELOG mode.
You must also decide how filled groups of the online redo log are to be archived. An instance can be configured to have Oracle automatically archive filled online redo log files, or you can manually archive filled groups.
See Also: You can also configure Oracle to verify redo log blocks when they are archived. For more information, see "Verifying Blocks in Redo Log Files" .
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.
See Also: See Chapter 2 for more information about creating a database.
ALTER DATABASE ARCHIVELOG;
Before switching the database's archiving mode, perform the following operations:
To Prepare to Switch Database 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.
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" .
The new value takes effect the next time you start the database.
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.
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.
The new value takes effect the next time the database is started.
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.
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.
For these large database sites, you can tune archiving, to cause it to run either as slowly as possible without being a bottleneck, or as quickly as possible without reducing system performance substantially. To do so, adjust the values of the initialization parameters LOG_ARCHIVE_BUFFERS (the number of buffers allocated to archiving) and LOG_ARCHIVE_BUFFER_SIZE (the size of each such buffer).
Note: When you change the value of LOG_ARCHIVE_BUFFERS or LOG_ARCHIVE_BUFFER_SIZE, the new value takes effect the next time you start the instance.
If the performance of the system drops significantly while the archiver is working, make the value of LOG_ARCHIVE_BUFFER_SIZE lower, until system performance is no longer reduced when the archiver runs.
Note: If you want to set archiving to be very slow, but find that Oracle frequently has to wait for redo log files to be archived before they can be reused, consider creating additional redo log file groups. Adding groups can ensure that a group is always available for Oracle to use.
See Also: This maximum is operating system dependent; see your operating system-specific Oracle documentation.
For more information about these parameters, see the Oracle7 Server Reference guide.
To see the current archiving mode, query the V$DATABASE view :
SELECT log_mode FROM sys.v$database;
The V$ARCHIVE and V$LOG data dictionary views also contain archiving information of a database. For example, the following query lists all log groups for the database and indicates the ones that remain to be archived:
SELECT group#, archived
The command ARCHIVE LOG with the LIST parameter also shows archiving information for the connected instance:
ARCHIVE LOG LIST;
Database log mode ARCHIVELOG
Automatic archival ENABLED
Archive destination destination
Oldest online log sequence 30
Next log sequence to archive 32
Current log sequence number 33
This display tells you all the necessary information regarding the redo log settings for the current instance:
Archived redo log files are uniquely named as specified by the LOG_ARCHIVE_FORMAT parameter. Filename format is operating system specific; for most operating systems it consists of a text string, one or more parameters, and a filename extension. When a filled online redo log group is archived, the archiving process concatenates the supplied text string with the return values of the specified parameters to create uniquely identified archived redo log files. Each parameter has an upper bound, which is operating system dependent.
Table 22 - 1 lists the parameters that can be included in a filename format and corresponding examples to show how the parameter affects the filenames created by the archiving process.
|%T||thread number, left-zero-padded||arch0000000001|
|%t||thread number, not padded||arch1|
|%S||log sequence number, left-zero-padded||arch0000000251|
|%s||log sequence number, not padded||arch251|
|Table 22 - 1. Archived Redo Log Filename Format Parameters|
The different options are provided so that you can customize the archived redo log filenames as you need. For example, you might want to take into account the operating system sorting algorithm used to list filenames.
The %T and %t are useful only when the Oracle Parallel Server is used. In a non-Parallel Server configuration, you must decide whether to use %S or %s to identify each archived redo log file uniquely. The following is a typical example of a common archived redo log filename format:
LOG_ARCHIVE_FORMAT = arch%S.arc
Here, arch is the filename, %S is the zero-padded log sequence parameter, and .arc is the file extension. Assuming the upper bound for the %S parameter is four, this filename format generates archived redo log filenames of the following format:
Take into account the maximum operating system filename length when specifying the archive filename format. If ARCH or a user process attempts to archive a file and the supplied filename format is too large, the process fails to archive the file.
Note: If no archived filename format is specified using LOG_- ARCHIVE_FORMAT, Oracle uses a default filename format that is operating system-specific.
The archived redo log destination is also operating system-specific. For most operating systems, the archive redo log destination points to a disk drive and a file directory. If permitted by your Oracle Server, this destination can also point to a tape drive dedicated to Oracle for archiving filled online redo log files.
The archived redo log destination is determined at instance startup by the LOG_ARCHIVE_DEST initialization parameter, but can be overridden while the instance is up:
For more information about filename format parameters and the term "thread" see the Oracle7 Parallel Server Concepts & Administration guide.
Copyright © 1996 Oracle Corporation.
All Rights Reserved.