Log Switches and Log Sequence Numbers

本文解释了数据库中日志切换(log switch)的概念及其发生时机,并介绍了日志序列号(log sequence number)的作用及如何在故障恢复过程中利用这些信息正确地应用重做日志文件。
Log Switches and Log Sequence Numbers

A log switch is the point at which the database stops writing to one redo log file and begins writing to another. Normally, a log switch occurs when the current redo log file is completely filled and writing must continue to the next redo log file. However, you can configure log switches to occur at regular intervals, regardless of whether the current redo log file is completely filled. You can also force log switches manually.

 

Oracle Database assigns each redo log file a new log sequence number every time a log switch occurs a nd 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.

--log sequence number 是在如下时刻被分配的: 当  log switch occurs时, the next redo log获得最新的 log sequence number。

举例:

3组日志 :1;2;3 。

2组的状态是current,此时2组的 log sequence number是100

日志切换后:

3组的状态是current,此时3组的 log sequence number是101


 

Each online or archived redo log file is uniquely identified by its log sequence number. During crash, instance, or media recovery, the database properly applies redo log files in ascending order by using the log sequence number of the necessary archived and redo log files.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值