primary key
1、user test下
create table B
(
a VARCHAR2(2) not null,
b NUMBER
);
(
a VARCHAR2(2) not null,
b NUMBER
);
alter table B
add constraint PK_B primary key (A);
add constraint PK_B primary key (A);
grant select on B to TEST2;
create materialized view log on b with primary key;
grant select on mlog$_b to test2;
2、user test2下
create table BB
(
a VARCHAR2(2) not null,
b NUMBER,
c DATE default sysdate
);
(
a VARCHAR2(2) not null,
b NUMBER,
c DATE default sysdate
);
alter table BB
add constraint B_PK primary key (A);
add constraint B_PK primary key (A);
create materialized view bb
on prebuilt table
refresh fast with primary key
start with sysdate next sysdate+1/14400 as
--on commit as
select b.a,b.b from test.b;
on prebuilt table
refresh fast with primary key
start with sysdate next sysdate+1/14400 as
--on commit as
select b.a,b.b from test.b;
3、user test1下
insert into b values('03','3');
update b set b.b=22 where b.a='02'
4、user test2下
exec dbms_mview.refresh('BB','C');
exec dbms_mview.refresh('BB','C');
rowid
create materialized view log on b with rowid;
create materialized view log on b with rowid;
grant select on mlog$_b to test2
rowid 方式不可以预建表
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7836777/viewspace-722402/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7836777/viewspace-722402/