增量檢查點(diǎn)的作用是為了均衡負(fù)載,由fast_start_mttr_target這個(gè)參數(shù)觸發(fā),增量漸進(jìn)寫出。所以,CHECKPOINT_CHANGE#會(huì)有延遲,不會(huì)馬上更新。
下面用三種方法證明:
法一:
理論:日志卻會(huì)有active,即:被RBA指針覆蓋的日志。如是完全檢查點(diǎn),則RBA會(huì)一下子干到重做日志組的最后一條,沒有了RBA,那么日志的狀態(tài)便是inactive了;而如是增量檢查點(diǎn),則RBA會(huì)慢慢下移,有被RBA覆蓋的都是active。Oracle總是希望RBA與重做日志組的最后一條的距離最短,增量檢查點(diǎn)就是時(shí)不時(shí)要移動(dòng)它。
-
實(shí)驗(yàn):
SQL> alter system switch logfile;
System altered
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 CURRENT
2 INACTIVE
3 ACTIVE
SQL> alter system switch logfile;
System altered
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 ACTIVE
2 CURRENT
3 ACTIVE
法二:
理論:增量檢查點(diǎn)沒有全部寫,所以checkpoint_change#沒有馬上更新;但完全檢查點(diǎn),因?yàn)槿繉,checkpoint_change#會(huì)馬上更新。
實(shí)驗(yàn):
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
1716093
SQL> alter system checkpoint;
System altered
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
1716275
法三:
實(shí)驗(yàn):
SQL> show parameter log_checkpoints_to_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_checkpoints_to_alert boolean FALSE
SQL> alter system set log_checkpoints_to_alert=true;
System altered
SQL> alter system checkpoint;
System altered
手工觸發(fā)一個(gè)完全檢查點(diǎn),告警日志記錄如下:
Thu Jun 07 01:27:17 2012
Beginning global checkpoint up to RBA [0x2d.1e4.10], SCN: 1716634
Completed checkpoint up to RBA [0x2d.1e4.10], SCN: 1716634
接下來手工觸發(fā)一個(gè)增量檢查點(diǎn):
SQL> alter system switch logfile;
System altered
告警日志如下:
Thu Jun 07 01:28:15 2012
Beginning log switch checkpoint up to RBA [0x2e.2.10], SCN: 1716660
Thread 1 advanced to log sequence 46
Current log# 3 seq# 46 mem# 0: D:\Oracle\PRODUCT\10.2.0\ORADATA\ORCL\ONLINELOG\O1_MF_3_7TQZWZOY_.LOG
Current log# 3 seq# 46 mem# 1: D:\Oracle\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ONLINELOG\O1_MF_3_7TQZX11D_.LOG
從這兩個(gè)告警日志中,我們可以看到,完全檢查點(diǎn)會(huì)馬上將RBA下移,而增量檢查點(diǎn)就會(huì)悠著點(diǎn)了 本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|