oracle 创建用户只有查看另一个用户的视图的权限

1、创建用户yyy

-- Create the user 

create user YYY
  identified by password
  default tablespace SYSTEM
  temporary tablespace TEMP
  profile DEFAULT;
-- Grant/Revoke role privileges 
grant connect to YYY;
grant dba to YYY;

grant resource to YYY;

2、创建表UIMAGE_DICITEM和表UIMAGE_DICINDEX


-- Create table
create table UIMAGE_DICITEM
(
  DICID   VARCHAR2(10) not null,
  ITEMID  VARCHAR2(10) not null,
  ITEMVAL VARCHAR2(100) not null,
  ITEMDES VARCHAR2(100)
)


-- Create table
create table UIMAGE_DICINDEX
(
  DICID   VARCHAR2(10) not null,
  DICNAME VARCHAR2(20) not null,
  DICDES  VARCHAR2(100)
)


3、创建视图view_person_permission 

create or replace view view_person_permission as
  select p.dicid,p.dicname,c.itemid,c.itemval from uimage_dicindex p,uimage_dicitem c where p.dicid=c.dicid

4、创建用户yyyy

-- Create the user 
create user YYYY
  identified by ""
  default tablespace SYSTEM
  temporary tablespace TEMP
  profile DEFAULT;
-- Grant/Revoke object privileges 
grant select on VIEW_PERSON_PERMISSION to YYYY;
-- Grant/Revoke role privileges 
grant connect to YYYY;
-- Grant/Revoke system privileges 
grant create synonym to YYYY;

5、yyyy用户登录创建同义词

CREATE SYNONYM  PERSON_PERMISSION FOR  yyy.VIEW_PERSON_PERMISSION ;

6、设置yyyy的session访问数

conn / as sysdba

alter system set resource_limite=true scope=both sid='*';

create profile third_user limit SESSIONS_PER_USER 1 FAILED_LOGIN_ATTEMPTS unlimited;

alter user ryd_interface profile third_user;

将会话数调整到30

alter profile third_user limit SESSIONS_PER_USER 30;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值