ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 物化视图

物化视图

Linux操作系统 作者:oraclewangfu 时间:2015-08-22 14:34:27 0 删除 编辑
primary key
1、user  test下
 
create table B
(
  a VARCHAR2(2) not null,
  b NUMBER
);
alter table B
  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
);
alter table BB
  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;
 
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;

grant select on mlog$_b  to test2
 
rowid 方式不可以预建表

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30423260/viewspace-1779502/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-08-20

  • 博文量
    15
  • 访问量
    9801