Databases Reference
In-Depth Information
damages the datafiles, you must restore the entire database to the point in time when
the last backup occurred. Since no redo log history exists to reproduce the changes made
since the last backup occurred, you will lose the effects of those changes. Very few Oracle
shops make this choice, because the inability to recover to the point of failure is unac‐
ceptable—it results in lost data.
The second and more practical way to address the issue is to archive the redo logs as
they fill. To understand archiving redo logs, you must first understand that there are
actually two types of redo logs for Oracle:
Online redo logs
The operating system files that Oracle cycles through to log the changes made to
the database
Archived redo logs
Copies of the filled online redo logs made to avoid losing redo data as the online
redo logs are overwritten
An Oracle Database can run in one of two modes with respect to archiving redo logs:
NOARCHIVELOG
As the name implies, no redo logs are archived. As Oracle cycles through the logs,
the filled logs are reinitialized and overwritten, which erases the history of the
changes made to the database. This mode essentially has the disadvantage men‐
tioned above, where a failure could lead to unrecoverable data.
Choosing not to archive redo logs significantly reduces your options for database
backups, as we'll discuss in Chapter 11 , and is not advised by Oracle.
ARCHIVELOG
When Oracle rolls over to a new redo log, it archives the previous redo log. To
prevent gaps in the history, a given redo log cannot be reused until it is successfully
archived. The archived redo logs, plus the online redo logs, provide a complete
history of all changes made to the database. Together, they allow Oracle to recover
all committed transactions up to the exact time a failure occurred. Operating in this
mode enables tablespace and datafile backups.
The internal sequence numbers discussed earlier act as the guide for Oracle while it is
using redo logs and archived redo logs to restore a database.
ARCHIVELOG mode and automatic archiving
Starting with Oracle Database 10 g , automatic archiving for an Oracle Database is en‐
abled with the following SQL command:
ARCHIVE LOG START
If the database is in ARCHIVELOG mode, Oracle marks the redo logs for archiving as
it fills them. The full logfiles must be archived before they can be reused. The ARCHIVE
Search WWH ::




Custom Search