欢迎各界计算机爱好者加入,弘扬极客精神!

什么是 redo logs????????

0 喜欢 0 不喜欢
问题关闭原因: enough answers
最新提问 9月 9, 2016 分类:数据库 | 用户: ζއއ、魚忘七秒℡ (4,498 分)  
已关闭 12月 9, 2016 用户:Re

19 个回答

0 喜欢 0 不喜欢
0 喜欢 0 不喜欢
0 喜欢 0 不喜欢
每当数据库状态改变就会生成一条事件记录,也就是Redo条目, 就会写入位于SGA(system global area)的数据库缓存。 每三秒或者一个COMMIT发生,Oracle Log Writer程序就会把缓存中的内容写入磁盘中的文件。
最新回答 9月 10, 2016 用户: shenme (3,438 分)  
0 喜欢 0 不喜欢
最新回答 9月 10, 2016 用户: litianran (1,406 分)  
1 喜欢 0 不喜欢
最新回答 9月 10, 2016 用户: 5 (5,178 分)  
0 喜欢 0 不喜欢
一个写满日志文件要被reuse,必须等待这个写满日志的日志文件的重做日志被写入磁盘的数据文件中,需要进行日志切换。
最新回答 9月 11, 2016 用户: die when I am 27 (2,000 分)  
0 喜欢 0 不喜欢
How Oracle Database Writes to the Redo Log
1.在非归档模式下
    一个写满日志的日志文件要被reuse,必须等待这个写满日志的日志文件的重做日志被写入磁盘的数据文件中
2.在归档模式下
一个写满日志的日志文件要被reuse,必须等待这个写满日志的日志文件的重做日志被写入磁盘的数据文件中,并且这个写满日志的日志文件必须被归档
3. Whenever atransaction is committed, LGWR writes the transaction redo records from the redo log buffer of the SGA to a redo log file, and assigns a system change number (SCN) to identify the redo records for each committed transaction(当事务提交时候,oracle将分配一个系统改变号,即SCN,目的是标示每一个提交的事务。)
 
 
Active (Current) and Inactive Redo Log Files
日志状态:
Active:这个状态的日志文件,实例恢复的时候使用要求使用
Current:当前日志文件,就是LGWR进程写的日志文件
Inacitve:这个状态的日志文件,实例恢复的时候不需要使用
 
Log Switches and Log Sequence Numbers
日志切换的概念:
日志切换处于这个点上:数据库停止写一个日志文件,而开始写另外一个日志文件,称日志切换。
一般情况下,当前日志文件满了之后,就开始写下一个日志文件;但是你也可以手工进行日志切换,强迫日志切换,即当前日志文件还没有满的时候强迫进行日志切换。
手工切换日志组:Alter system switch logfile
(Oracle Database assigns each redo log file a new log sequence number every time a
log switch occurs and LGWR begins writing to it. When the database archives redo log
files, the archived log retains its log sequence number. A redo log file that is cycled
back for use is given the next available log sequence number.当进行日志切换时候,数据库分配一个新的日志序列号给当前日志文件,LGWR开始写入redo logfile里面,归档日志文件保留了它的序列号)
最新回答 9月 11, 2016 用户: xkes❤Room (2,000 分)  
1 喜欢 0 不喜欢

Redo log files are filled with redo records. A redo record, also called a redo entry, is made up of a group of change vectors, each of which is a description of a change made to a single block in the database. For example, if you change a salary value in an employee table, you generate a redo record containing change vectors that describe changes to the data segment block for the table, the undo segment data block, and the transaction table of the undo segments.

Redo entries record data that you can use to reconstruct all changes made to the database, including the undo segments. Therefore, the redo log also protects rollback data. When you recover the database using redo data, the database reads the change vectors in the redo records and applies the changes to the relevant blocks.

Redo records are buffered in a circular fashion in the redo log buffer of the SGA (see "How Oracle Database Writes to the Redo Log") and are written to one of the redo log files by the Log Writer (LGWR) database background process. Whenever a transaction is committed, LGWR writes the transaction redo records from the redo log buffer of the SGA to a redo log file, and assigns a system change number (SCN) to identify the redo records for each committed transaction. Only when all redo records associated with a given transaction are safely on disk in the online logs is the user process notified that the transaction has been committed.

Redo records can also be written to a redo log file before the corresponding transaction is committed. If the redo log buffer fills, or another transaction commits, LGWR flushes all of the redo log entries in the redo log buffer to a redo log file, even though some redo records may not be committed. If necessary, the database can roll back these changes.

最新回答 9月 13, 2016 用户: Megan (2,582 分)  
0 喜欢 0 不喜欢

The most crucial structure for recovery operations is the redo log, which consists of two or more preallocated files that store all changes made to the database as they occur. Every instance of an Oracle Database has an associated redo log to protect the database in case of an instance failure.

最新回答 9月 13, 2016 用户: Parsifal (1,714 分)  
...