預設情況下,SCN多長時間遞增一次呢,今天同事突然討論這個問題,資料庫版本如下:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
當前的SCN如下:
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
1544192
採用scn_to_timestamp擷取scn與時間的對應關係如下:
SQL> select scn_to_timestamp(&scn) from dual;
Enter value for scn: 1544192
old 1: select scn_to_timestamp(&scn) from dual
new 1: select scn_to_timestamp(1544192) from dual
SCN_TO_TIMESTAMP(1544192)
---------------------------------------------------------------------------
28-MAR-12 05.18.36.000000000 PM
將scn遞增一次檢查時間如下:
SQL> /
Enter value for scn: 1544193
old 1: select scn_to_timestamp(&scn) from dual
new 1: select scn_to_timestamp(1544193) from dual
SCN_TO_TIMESTAMP(1544193)
---------------------------------------------------------------------------
28-MAR-12 05.18.39.000000000 PM
如上可見2個時間差為3秒,
可見時間差仍然沒變。