OverviewoftheOnlineRedoLog---在线重做日志概述(二)

2015-01-21 11:32:31 · 作者: · 浏览: 10
group consists of an online redo log file and its redundant copies. Each identical copy is a member of the online redo log group. Each group is defined by a number, such as group 1, group 2, and so on.

?

Oracle 数据库能够自动管理两个或者多个不同位置的在线重做日志文件的相同备份集。一个在线重做日志文件组包含一个在线重做日志文件和它的冗余备份。每个完全相同的备份是在线重做日志文件组中的一个成员。每个组用数字来定义,例如 group 1, group 2 等等。

?

Maintaining multiple members of an online redo log group protects against the loss of the redo log. Ideally, the locations of the members should be on separate disks so that the failure of one disk does not cause the loss of the entire online redo log.

?

保存在线重做日志文件组的多个成员来保证重做日志不丢失。理论上说,日志文件组的成员的存放位置应该放在磁盘上的不同位置,这样即使一个磁盘损坏也不会导致整个在线重做日志文件丢失。

?

In Figure 11-7, A_LOG1 and B_LOG1 are identical members of group 1, while A_LOG2 and B_LOG2 are identical members of group 2. Each member in a group must be the same size. LGWR writes concurrently to group 1(members A_LOG1 and B_LOG1), then writes concurrently to group2 (members A_LOG2 and B_LOG2), then writes to group 1, and so on. LGWR never writes concurrently to members of different groups.

?

在图 11-7 中,A_LOG1 和 B_LOG1 是 group 1 中的相同的成员,而 A_LOG2 和 B_LOG2 是 group 2中的相同的成员。每个组中的成员必须大小一致。后台进程 LGWR 并发的写数据到 group 1,然后并发的写数据到 group 2,然后再并发的写数据到 group 1. LGWR 从不会并发写数据到不同的组。

?

Figure 11-7 Multiple Copies of Online Redo Log Files

?

\
?

注意:

Oracle recommends that you multiplex the online redo log. The loss of log files can be catastrophic if recovery is required. When you multiplex the online redo log, the database must increase the amount of I/O it performs. Depending on your system, this additional I/O may impact overall database performance.

Oracle 推荐保留多份在线重做日志文件。日志文件的丢失对于恢复来说将是致命的。但是当你保留多份在线重做日志时,数据库必须增加执行 I/O 的数量。这种额外的 I/O 是否会影响数据库的整体性能取决于你的系统

?

Archived Redo Log Files(归档重做日志文件)

?

归档日志文件是在线重做日志文件的一个备份,也不认为是数据库的一部分,但是归档日志文件是数据库创建的在线重做日志文件的离线备份并且可以写到指定的位置。

归档日志文件是和恢复策略中非常重要的部分,你可以使用归档日志文件用来:

Recover a database backup (恢复数据库)
Update a standby database (更新备用数据库)
Obtain information about the history of a database using the LogMiner utility (通过logminer获取数据库的历史信息)

归档是产生归档日志文件的一个操作,归档这个操作只有在数据库运行在归档日志模式才有效,可以自动也可以手动

?

An archived redo log file includes the redo entries and the log sequence number of the identical member of the online redo log group. In Figure 11-7, files A_LOG1 and B_LOG1 are identical members of Group 1. If the database is in ARCHIVELOG mode, and if automatic archiving is enabled, then the archiver process (ARCn) will archive one of these files. If A_LOG1 is corrupted, then the process can archive B_LOG1. The archived redo log contains a copy of every group created since you enabled archiving.

?

一个归档日志文件包含redo entries(重做条目)和在线重做日志文件组相同的日志序列号。在图 11-7 中,文件 A_LOG1 和 B_LOG1 是 Group 1 相同的成员。如果数据库运行在归档日志模式下并且开启了自动归档,那么归档进程(ARCn)将他们中一个进行归档。如果 A_LOG1 损坏了,归档进程可以对 B_LOG1 进行归档。如果你开启了归档,已经归档的重做日志文件将包含每个在线重做日志文件组的备份。

?

?

Online Redo Log结构

?

在线重做日志中包含许多 redo records(重做记录).一条重做记录由一组改变向量组成,每个改变向量描述了对一个数据块的修改。例如,在employees表中修改salary就会产生一条redo记录,用来描述这个表的数据段发生的变化,undo段数据块以及undo段的事务表。

重做记录包含改变的所有相关的基本元数据,具体如下:

改变时的SCN和时间戳
产生这个变化的事务的ID
事务提交的SCN和时间戳(如果已经提交)
产生变化的操作类型
被修改的数据段的名字和类型