咱們知道ORACLE中有SCN(System Change Number)和Checkpoint_Change#,那這二者的關係是什麼呢,其實Checkpoint_Change#是來源於SCN,SCN是時刻在變化的,Checkpoint_Change#是在數據發生了檢查點的時候才改變的,它的值來源於SCN.下面經過一個例子來講明.orm
1.獲取當前的SCNget
SQL> select dbms_flashback.get_system_change_number() from dual;flash
DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER()form
-----------------------------------------file
1275075select
2.產生檢查點數據
SQL> alter system checkpoint;db
System altered.文件
3.從數據文件和數據頭文件中查看檢查點poi
SQL> column name format a50;
SQL> select name,checkpoint_change# from v$datafile;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF 1275080
SQL> select name, checkpoint_change# from v$datafile_header;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF 1275080
E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF 1275080
從以上的輸出能夠看出Checkpoint_Change#很是接近SCN的值,說明Checkpoint_Change#來源於SCN,由於SCN時刻在變化,沒法捕獲到Checkpoint_Change#等於SCN的時刻.