天天看點

low cache rba vs on disk rba

low cache rba就是CKPT記錄的DBWR寫的進度, on disk rba就是LGWR的寫進度.

low cache rba 以前的更前的已經寫入資料檔案,不需要重做, on disk rba以後的

日志還沒寫入到online logfile.是以不需要恢複.

記錄在控制檔案的CHECKPOINT PROGRESS RECORDS條目中。

SQL> create table anran(id int)

  2  /

表已建立。

SQL> insert into anran values(7)

已建立 1 行。

SQL> commit

送出完成。

SQL> shutdown abort

ORACLE 例程已經關閉。

SQL> startup mount;

ORACLE 例程已經啟動。

Total System Global Area  603979776 bytes

Fixed Size                  1298112 bytes

Variable Size             171966784 bytes

Database Buffers          423624704 bytes

Redo Buffers                7090176 bytes

資料庫裝載完畢。

SQL> oradebug setmypid

已處理的語句

SQL> oradebug dump controlf 4

打開控制檔案找到CHECKPOINT PROGRESS RECORDS:

***************************************************************************

CHECKPOINT PROGRESS RECORDS

 (size = 8180, compat size = 8180, section max = 11, section in-use = 0,

  last-recid= 0, old-recno = 0, last-recno = 0)

 (extent = 1, blkno = 2, numrecs = 11)

THREAD #1 - status:0x2 flags:0x0 dirty:32

low cache rba:(0x12.5c85.0) on disk rba:(0x12.5ced.0)

on disk scn: 0x0000.001414d0 07/09/2010 00:06:12

resetlogs scn: 0x0000.000fffeb 07/05/2010 11:10:48

heartbeat: 723882252 mount id: 886034360

....

THREAD #8 - status:0x0 flags:0x0 dirty:0

low cache rba:(0x0.0.0) on disk rba:(0x0.0.0)

on disk scn: 0x0000.00000000 01/01/1988 00:00:00

resetlogs scn: 0x0000.00000000 01/01/1988 00:00:00

heartbeat: 0 mount id: 0

隻有Thread 1 是對我們有用的。其中

low cache rba:(0x12.5c85.0) 0x12.5c85.0 = 18.23685.0

on disk rba:(0x12.5ced.0)   0x12.5ced.0 = 18.23789.0

SQL> alter database open;

資料庫已更改。

檢視alert.log可以看到:

Beginning crash recovery of 1 threads

 parallel recovery started with 2 processes

Fri Jul 09 00:12:54 2010

Started redo scan

Fri Jul 09 00:12:55 2010

Completed redo scan

 104 redo blocks read, 34 data blocks need recovery

Started redo application at

 Thread 1: logseq 18, block 23685   ---恢複起點

Recovery of Online Redo Log: Thread 1 Group 1 Seq 18 Reading mem 0

  Mem# 0: D:\ORACLE\PRODUCT\10.2.0\ORADATA\ANRAN\ONLINELOG\O1_MF_1_63007KDR_.LOG

  Mem# 1: D:\ORACLE\PRODUCT\10.2.0\ORADATA\ANRAN\ONLINELOG\O1_MF_1_63007J6X_.LOG

Completed redo application

Completed crash recovery at

 Thread 1: logseq 18, block 23789, scn 1336048  ---恢複終點

 34 data blocks read, 32 data blocks written, 104 redo blocks read

本文轉自 anranran 51CTO部落格,原文連結:http://blog.51cto.com/guojuanjun/346545