以下的文章主要向你解答Oracleg 中的current_scn是如何正確的計算運行我們大家都知道Oracleg在v$database 視圖裡引入了current_scn其實這個SCN是來自底層表代表當前的SCN
在Oraclei中我們可以通過dbms_flashbackget_system_change_number來獲得系統的SCN
但是注意current_scn還是有所不同的我們看一下一個查詢
復制代碼
oracle@danaly ~]$ sqlplus / as sysdba
SQL*Plus: Release Production on Thu Jun ::
Copyright (c) Oracle All rights reserved
Connected to:
Oracle Database g Enterprise Edition Release Production
With the Partitioning Oracle Label Security OLAP and Data Mining Scoring Engine options
SQL> @scn
SQL> col current_scn for
SQL> select current_scn from v$database;
CURRENT_SCN
SQL> select dbms_flashbackget_system_change_number current_scn from dual;
CURRENT_SCN
SQL> select dbms_flashbackget_system_change_number current_scn from dual;
CURRENT_SCN
SQL> select current_scn from v$database;
CURRENT_SCN
SQL> select dbms_flashbackget_system_change_number current_scn from dual;
CURRENT_SCN
SQL> select dbms_flashbackget_system_change_number current_scn from dual;
CURRENT_SCN
SQL> select current_scn from v$database;
CURRENT_SCN
我們看到current_scn的查詢會直接導致SCN的增進而其他方式並不會也就是說在這裡的current_scn就像是一個Sequence一樣查詢會導致增進這也很好理解v$database只能通過增進當前的SCN才能保證獲得的SCN是Current的可是如果不查詢呢?這個值肯定是不會增長的以上的相關內容就是對Oracleg的current_scn計算的介紹望你能有所收獲
From:http://tw.wingwit.com/Article/program/Oracle/201311/17256.html