Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Online Redo Log File (online redo log)

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Online Redo Log File (online redo log)

I. Online Redo Log File function

1. Record all changes made to the data.

two。 Provide a recovery mechanism.

II. Redo Log File Groups (online redo log group)

Oracle divides Redo Log Files into different groups, and at least two groups are needed to run Oracle properly, so Oracle must have at least two online redo logs, and the contents of Redo Log File files in the same group are the same, and the LGWR background process is responsible for writing relevant information to Redo Log File (because LGWR writes to all Log files in the same group, the contents of Log files in the same group are the same) Each record (entries) in Redo Log File has a Log sequence numbers (LSN: equivalent to a serial number).

III. Online Redo Log File correlation

1.Online Redo Log File is used in a circular manner (once a redo log file is full, LGWR switches to the next log group).

2.LGWR writes the Redo Log File file in the following situations:

(1)。 When committing a transaction (Transaction commit).

(2)。 Write every 3 seconds.

(3)。 When the redo log buffer (Redo Log Buffer) is one-third full.

(4)。 When the changed record in the redo log buffer (Redo Log Buffer) exceeds 1MB.

(5)。 Before DBWn writes blocks modified in the database buffer cache to the data file (before writing Data file).

When 3.LGWR switches log groups, it also triggers:

(1)。 Perform checkpoint (checkpoint:writing of dirty/mdified block from the buffer cache to disk) operations.

(2)。 Writes the information to the control file (Control file).

Related commands of 4.Redo Log File

(1)。 Add Redo Log File Group and its corresponding Redo Log Files:

Alter database add logfile group 3

('$HOME/Oradata/u01/log3a.rdo'

'$HOME/Oradata/u02/log3b.rdo')

Copy the code

(2)。 Add a Redo Log File file to a Group:

Alter database add logfile member

'$HOME/Oradata/u04/log1c.rdo' to group 1

'$HOME/Oradata/u04/log2c.rdo' to group 2

'$HOME/Oradata/u04/log3c.rdo' to group 3

Copy the code

(3)。 Delete Redo Log File Member (each Log file in each Redo Log File Group is called a Member)

Alter database drop logfile member

'$HOME/Oradata/u04/log3c.rdo'

Copy the code

(4)。 Delete Redo Log File Group

Alter database drop logfile group 2

5.Redo Log File recommends ending with ".rdo".

6. Information about Redo Log File can be queried through the dynamic performance View (Dynamic Performance View).

(1) v$log:Display the redo log fileinformation from the control file.

Select * from v$logfile

(2) v$logfile:Identifies redo log froups and menbers an menbers status.

Select group#, thread#,sequence#,status from v$log

7. Only one of the Group and one Redo Log File is normal, the Oracle will work properly. Unlike Control File, if one of the Control File is damaged, the Oracle will not function properly

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report