[20180823]IMU与db link.txt
Posted lfree
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[20180823]IMU与db link.txt相关的知识,希望对你有一定的参考价值。
[20180823]IMU与db link.txt
--//当使用db link查看远程表时,实际上会产生小小的日志.
--//当时如果与IMU结合在一起,可以导致IMU的失效.
1.环境:
[email protected]> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
CREATE PUBLIC DATABASE LINK LOOPBACK CONNECT TO SCOTT IDENTIFIED BY book USING ‘localhost:1521/book:DEDICATED‘;
create table deptx as select * from dept;
2.测试:
[email protected]> @ &r/viewsess "IMU commits"
NAME STATISTIC# VALUE SID
----------- ---------- ---------- ----------
IMU commits 374 0 1
[email protected]> update deptx set dname=lower(dname) where deptno=10;
1 row updated.
[email protected]> commit;
Commit complete.
[email protected]> @ &r/viewsess "IMU commits"
NAME STATISTIC# VALUE SID
----------- ---------- ---------- ----------
IMU commits 374 1 1
--//可以发现当前数据库IMU起作用的.
[email protected]> @ &r/viewsess "IMU commits"
NAME STATISTIC# VALUE SID
----------- ---------- ---------- ----------
IMU commits 374 0 1
[email protected]> update deptx set dname=lower(dname) where deptno=10;
1 row updated.
[email protected]> select sysdate from [email protected];
SYSDATE
-------------------
2018-08-22 09:04:00
[email protected]> commit ;
Commit complete.
[email protected]> @ &r/viewsess "IMU commits"
NAME STATISTIC# VALUE SID
----------- ---------- ---------- ----------
IMU commits 374 0 1
--//当是当执行dml时有dblink的语句,IMU失效,回到原来的模式.
--//viewsess.sql脚本:
set verify off
column name format a70
SELECT b.NAME, a.statistic#, a.VALUE,a.sid
FROM v$mystat a, v$statname b
WHERE lower(b.NAME) like lower(‘%&1%‘) AND a.statistic# = b.statistic# ;
--and a.value>0;
以上是关于[20180823]IMU与db link.txt的主要内容,如果未能解决你的问题,请参考以下文章