oracel 建立视图给某个用户

 

 

-----建立表ide

create table t_stu(  
  stuid      number(10)   primary key,  
  stuname    varchar2(20) not null,  
  stusex     varchar2(4)  default '男' check(stusex in('男','女'))
);ui

select * from t_stutable

insert into t_stu(stuid,stuname,stusex) values(1,'李四','男');
insert into t_stu(stuid,stuname,stusex) values(2,'李四','男');
insert into t_stu(stuid,stuname,stusex) values(3,'李四','男');
insert into t_stu(stuid,stuname,stusex) values(4,'李四','男');select

------建立视图
CREATE OR REPLACE VIEW view_sty
 AS
SELECT * from t_stu;权限

-----建立访问视图的用户im

create user user01
identified by "user01";查询

-------受权查询权限给用户tab

grant select on view_sty to user01; view

-----受权连接权限给用户vi

grant connect to user01;

------新用户登录后查询

select * from lbj.view_sty01;

相关文章
相关标签/搜索