oracle-Archive Log details (operating mode, classification)

Source: Internet
Author: User
Tags documentation switches

I. Oracle LOG classification

There are three main categories: Alert log files--alarm logs, Trace files--trace logs (user and process), and
Redo log Redo logs (records database changes).

This article focuses on Oracle's redo logs.
Redo logs are divided into online redo logs and archived redo logs.
Online Redo log files--in-line redo log, also known as online redo log, refers to Oracle in the form of SQL scriptReal-time recordingDatabase updates, in other words, saves the executed SQL script to the online log file (in a specific format) in real time.
Archive Redo Log files--archive redo log, referred to as archive log, means that when the condition is met, Oracle saves the online redo log to the hard disk (persisted) as a file.

The simple principle of redo log: Writes the changed SQL script to the redo log before the data update operation commits. Used primarily for incremental and incremental restores of databases.

Redo logs correspond directly to hard disk redo log files (there are two types of online and archived), redo log files are organized as groups (group), and a redo log group contains one or more log files.


Ii. on-line redo log (online redo log)

The principle of online redo log:

For online redo logs, Oracle 11g defaults to 3 online log groups for each DB instance, one log file per set, and a file name called Redo01.log,redo02.log and REDO03.LOG. (Users can add/modify/delete log groups and log files through view actions to customize the online redo log)
The contents of the log files within each group are exactly the same, and are saved in different locations for disk log mirroring to make multiple backups to improve security. By default, these 3 groups usually have only one set of active, continuously write to the action script, when the log file is full (up to the specified space quota), if the current database is in archive mode, the online logs will be archived to the hard disk to become the archive log; If the current database is in non-archive mode, no archive operation is made. The contents of the current online log are overwritten by the next re-write and cannot be saved. Therefore, the database is typically at run time, in archive mode, to hold the log of data updates.
When the current archive log group is full, Oracle switches to the next log group, continues to write, and then cycles through, when in archive mode, switches to the original log group that is already full, if the log group is archived overwrites the write, and if not, only the log buffer is used, waiting for the archive to overwrite the write. Of course, in non-archive mode, the write is overwritten directly. (I'll talk about the settings for the database archiving mode in another blog post).

Oracle provides 2 views for maintaining online redo logs: V$log and V$logfile, which allow us to view and modify online logs through these two views.

Detailed property fields about the V$log view are available in the official documentation for Oracle 11g: http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_2029.htm
Detailed property fields about the V$logfile view are available in the official documentation for Oracle 11g:
Http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_2031.htm

Official documents are still the most force Ah, do not neglect!!

Querying online log file information through the V$logfile view:
Sql> SELECT * from V$logfile ORDER by group#;

group# tatus TYPE MEMBER is_recovery_dest_file

1 ONLINE E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01. LOG NO
2 ONLINE E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02. LOG NO
3 ONLINE E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03. LOG NO


Query the overall information of the online logs through the V$log view:
Sql> SELECT * from V$log;

group# thread# sequence# BYTES members archived STATUS first_change# First_time

1 1 52428800 1 NO current 1466615 July-January-11
2 1 52428800 1 YES INACTIVE 1434125 June-January-11
3 1 52428800 1 YES INACTIVE 1460403 July-January-11

Of course, you can also add/modify/delete online logs or log groups via the Alter DATABASE add, delete, and more to view http://blog.csdn.net/robinson_0612/archive/2010/07/ 20/5749556.aspx


Third, about archive redo log (Archive redo log)

In fact, the so-called archive, refers to the online log archive, persistent to a fixed file to the hard disk, easy to recover and query later.
Of course, the precondition is that the database is in archive mode.

The default for Oracle 11g is to set 2 archive locations for archived logs, which are identical in the archive log for the 2 archive locations, but with different file names.

oracle-Archive Log details (operating mode, classification)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.