1、create user userName identified by password
2、grant select any table to userName--授予查询任何表
3、grant select any dictionary to userName--授予 查询任何字典
执行上面三步就行了,那么这个用户就只有查询权限,其他的权限都没有!!
延展阅读:
oracle
甲骨文公司,全称甲骨文股份有限公司(甲骨文软件系统有限公司),是全球最大的企业级软件公司,总部位于美国加利福尼亚州的红木滩。1989年正式进入中国市场。2013年,甲骨文已超越 IBM ,成为继 Microsoft 后全球第二大软件公司。
给用户赋予单表查询权限即可。可用如下语句:
grant select on 表名 to 用户名如:将scott用户下的emp表的权限赋予system用户。
1、登录scott用户。
2、执行语句:
grant select on emp to system
beginfor x in (select 'grant select on '||owner||'.'||table_name||' to t1' sqls from dba_tables
where owner in ('U1','U2')) loop
execute immediate x.sqls
end loop
end
/
--如果这个不算直接的话,那再也没更直接的了,可以反复执行
begin
for x in (select 'revoke select on u3.'||table_name||' from t1' sqls from dba_tab_privs where owner='U3' and privilege='SELECT')
loop
execute immediate x.sqls
end loop
end
/
--从t1上收回赋予对U3表的查询权限
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)