ogg中的MV问题

来源:互联网 发布:网络视频直播设备 编辑:程序博客网 时间:2024/05/16 10:01
最近在搭建生产环境的ogg时,遇到了MVIEW的问题
If your source system has materialized views, please pay attention to the following:

Limitations of support for materialized views (MVs)
● Materialized views created WITH ROWID are not supported.
● The materialized view log can be created WITH ROWID.
● The source table must have a primary key.
● Truncates of materialized views are not supported. You can use a DELETE FROM statement.
● Some Oracle GoldenGate initial-load methods do not support LOBs in a materialized view.
● For Replicat, the materialized view must be updateable.
● Full refreshes are supported for Oracle 10g and later.

A solution is to change the materialized views “FOR UPDATE” before replicating this table.

If you don’t do this REPLICAT will abend with this message:

2011-10-15 21:14:44  WARNING OGG-00869  OCI Error ORA-01732: data manipulation operation not legal on this view (status = 1732), SQL <INSERT INTO "SCHEMA_TAR"."MV_TABEL" ("ID","STR","DATUM") VALUES (:a0,:a1,:a2)>.
You can also enable DDL support and exclude the SNAPSHOTS (if they are in your mapping):

DDL INCLUDE all, EXCLUDE OBJTYPE 'SNAPSHOT'

http://mverzijl.wordpress.com/2011/10/15/materialized-views-with-goldengate/

我测试了rowid的MV,replicat会abend,我就把MV和MV_log都mapexclude了,然后在target端重新生成日志和MV(基础表是数据一致的),未见异常。
经过测试发现,加上for update也是可以的,但是要看业务需要了。

如果有要这样做的,还希望做下实验哦
SQL> select * from ttt;
        T1         T2
---------- ----------
        10          2
         4          2
SQL> alter table ttt modify (t1 number primary key);
SQL> create materialized view log on ttt with primary key;
SQL> create materialized view mv_ttt
build immediate
refresh fast on demand
with primary key
start with to_date('2014-12-24 23:28:50','YYYY-MM-DD HH24:MI:SS') NEXT SYSDATE + 10/1440
as 
select * from ttt;
可以,没有问题

尝试rowid的for update
SQL> create table forr as select * from ttt;
SQL> create materialized view log on forr with rowid;
SQL> create materialized view mv_forr
build immediate
refresh fast on demand
with rowid
start with to_date('2014-12-24 23:28:50','YYYY-MM-DD HH24:MI:SS') NEXT SYSDATE + 10/1440
for update
as 
select * from forr;
可以,没有问题
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 贴膜里面有灰尘怎么办 贴膜边缘不粘怎么办 贴膜时候的气泡怎么办 贴手机膜起泡了怎么办 手机膜起泡泡了怎么办 手机膜鼓起来了怎么办 贴膜中间有气泡怎么办 新车贴膜有气泡怎么办 贴手机膜进灰尘怎么办 贴手机膜有灰尘怎么办 华为mate10后机壳碎了怎么办 手机屏和壳分开了怎么办 oppoa33手机开不了机怎么办 7p背面刮花了怎么办 oppo手机左右两键失灵怎么办 苹果5s屏幕翘起怎么办 0pp0手机有点卡怎么办 手机用久有点卡怎么办 手机有点卡怎么办魅蓝 苹果6排线接反了怎么办 oppo手机解锁密码忘了怎么办 魅蓝5音量小怎么办 魅蓝5密码忘记了怎么办 魅蓝note3锁定了怎么办 魅族mx5系统铃声没有了怎么办 魅族主板坏了怎么办 魅族mx5螺丝滑丝怎么办 魅族魅蓝e手机被锁了怎么办 魅蓝e被锁机了怎么办 魅蓝3s卡顿怎么办 魅族note5玩王者荣耀卡怎么办 魅族手机内存不够怎么办 魅族手机音量小怎么办 魅族mx5指纹解锁失灵怎么办 魅族手机费电快怎么办 魅族mx4pro玩王者荣耀卡怎么办 魅蓝5s玩游戏卡怎么办 魅蓝s6玩游戏卡怎么办 OPPO王者荣耀对局闪退怎么办 魅族手机太慢怎么办 魅蓝5信号不好怎么办