打完补丁后测试db_link对SCN的影响

环境:11.2.0.4.0 升 11.2.0.4.8 后测试

背景:oracle 的db_link会导致实例间SCN同步,SCN增长速度过快则会产生错误;

方案:oracle官方推荐升级版本,但升级之后该问题依然存在。

新创建orcl11g库
-------------------------------------------------------
SQL> alter user scott identified by tiger account unlock;
SQL> grant create synonym to scott;
SQL> grant create public database link,create database link to scott;


[oracle@red12 dbs]$ export ORACLE_SID=orcl11g
[oracle@red12 dbs]$ sqlplus scott/tiger

create public database link red12 connect to scott identified by tiger using '(DESCRIPTION =
                (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.201.12)(PORT = 1521))
                (CONNECT_DATA =
                    (SERVER = DEDICATED)
                    (SERVICE_NAME = hyzf)
                )
        )';

hyzf 库SCN
------------------------------------
[oracle@red12 scripts]$ export ORACLE_SID=hyzf1
[oracle@red12 scripts]$ sqlplus / as sysdba

SQL>
SQL> @SCNCHECK.txt;
--------------------------------------------------------------
ScnHealthCheck
--------------------------------------------------------------
Current Date: 2016/10/28 03:53:44
Current SCN:  5118400
SCN Headroom: 10722.16
Version:      11.2.0.4.0
--------------------------------------------------------------
Result: A - SCN Headroom is good
Apply the latest recommended patches
based on your maintenance schedule
For further information review MOS document id 1393363.1
--------------------------------------------------------------
SQL>


新建库SCN
---------------------------------
[oracle@red12 dbs]$ export ORACLE_SID=orcl11g
SQL> @SCNCHECK.txt;
--------------------------------------------------------------
ScnHealthCheck
--------------------------------------------------------------
Current Date: 2016/10/28 03:53:00
Current SCN:  972801
SCN Headroom: 10722.16
Version:      11.2.0.4.0
--------------------------------------------------------------
Result: A - SCN Headroom is good
Apply the latest recommended patches
based on your maintenance schedule
For further information review MOS document id 1393363.1
--------------------------------------------------------------

等待一段时间再次查看,没有什么变化
SQL> /
--------------------------------------------------------------
ScnHealthCheck
--------------------------------------------------------------
Current Date: 2016/10/28 03:55:15
Current SCN:  973120
SCN Headroom: 10722.16
Version:      11.2.0.4.0
--------------------------------------------------------------
Result: A - SCN Headroom is good
Apply the latest recommended patches
based on your maintenance schedule
For further information review MOS document id 1393363.1
--------------------------------------------------------------


调用db_link后立即查看
-----------------------------------------------

SQL> select * from emp@red12;

[oracle@red12 scripts]$ sqlplus / as sysdba

SQL> @SCNCHECK.txt;
--------------------------------------------------------------
ScnHealthCheck
--------------------------------------------------------------
Current Date: 2016/10/28 03:55:53
Current SCN:  5118552
SCN Headroom: 10722.16
Version:      11.2.0.4.0
--------------------------------------------------------------
Result: A - SCN Headroom is good
Apply the latest recommended patches
based on your maintenance schedule
For further information review MOS document id 1393363.1
--------------------------------------------------------------

总结:11.2.0.4 升 11.2.0.4.8之后,db_link对SCN同步的影响并没有消除;只创建db_link而不使用,则库之间的SCN不会同步;SCN从db_link调用时开始同步。

posted @ 2016-10-28 10:51  方诚  阅读(341)  评论(0编辑  收藏  举报