oracle学习笔记08_Maintaining Online Redo Log Files

--------Characteristics:
Recored all changes made to data.
Provide a recovery mechanism.
Can be organized into group.
At least two group required.
--------Online Redo Log File Groups
A set of identical copies of online redo log files is called an online redo log file group.
The LGWR background process concurrently writes the same information to all online redo log files in a group.
The oracle server needs a minimum of two online redo log file groups for the normal operation of a data base.
--------Online Redo log File Members
Each online redo log file in a group is called a member.
Each member is a group has identical log sequence numbers and are of the same size.
The LSN(log sequence number) is assigned each time that the Oracle server writes to a log group to uniquely identify each online redo log file.
--------How Redo Filew Work
Online Redo log files are used in cyclic fashion.
When a online redo log file is full,LGWR will move to the next log group.
    Called a log switch
    Checkpoint operation also occurs
    Information written to the control file
--------Log switch
The act of switching from one log file group to the other is called a log switch.
--------Checkpoint
A checkpoint is the writing of dirty(modified) blocks from the buffer cache to disk.
--------When will LGWR write redo?
When a transaction commits.
Every three seconds.
When the Redo Log Buffer becomes one-third full.
When there is more than a megabyte of changed records in the Redo Log Buffer.
Before the DBWn writes modified blocks in the Database Buffer Cahce to the data files.
--------强制切换日志
alter system switch logfile;
--------强制checkpoint的发生
fast_start_mttr_target(0-3600)
alter system set fast_start_mttr_target=300 scope=spfile|both|pfile;alter system checkpoint;
--------管理Redo log files
alter database add logfile group 3('$HOMR/oradata/u01/log3a.rdo','$HOMR/oradata/u01/log3b.rdo') size 100m;
select * from v$logfile;
alter database add logfile member '$HOMR/oradata/u04/log1c.log' to group 1,'$HOMR/oradata/u04/log2c.log' to group 2,'$HOMR/oradata/u04/log3c.log' to group 3;
--------Drop Redo File Members:
alter database drop logfile member '$HOME/ORADATA/U04/log3c.rdo';
--------Drop Redo Files Groups
alter database drop logfile group 4;
--------Relocate & Rename
alter database rename file 'path and name1' to 'path and name2';
--------清空redo log file
alter database clear logfile group 2;
alter database clear unarchived logfile group 2;
--------
Archived Redo Log Files
--------
总结:oracle redo log file至少两组,每组至少两个,每组的重做日志文件放到不同的磁盘里(应对单点故障,提高安全性)。

猜你喜欢

转载自shanming0088-163-com.iteye.com/blog/1539451