在分布式事务环境中数据库的SCN可能瞬间暴增,这种行为被称作SCN jump in distributed transaction,注意这种现象是正常的。在发生分布式事务的2个数据库中,SCN较低的DB会将SCN和较高的那个数据库同步,这有时候会造成我们的一些误解认为可能是Hot backup等操作引起了SCN的猛增。
我们来具体看一下这种现象:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
www.oracledatabase12g.com
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
5072553
SQL> select current_scn from v$database@PROD;
CURRENT_SCN
-----------
7798262
SQL> insert into testlink@PROD values(1);
1 row created.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
7798282
由于这种SCN跳跃可能引起ORA-600 [2252]内部错误,相关的bug case.