a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 87|回复: 0

[综合] Oracle辅导:oraclegrant是否赋予权限(4)

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
grant create session to public; //表示把创建表的权限赋予所有人   select * from user_sys_privs; //返回当前用户的所有系统权限! S, c/ g, [4 x' x
  对象权限
( ?' W: _3 J  N7 u- X6 c3 e  grant select on mytab to test;; p( n- n/ M% e3 ^# H/ r7 e5 t
  grant all on mytab to test;- [- s/ C2 c  t8 P
  revoke select on mytab from test;5 v( [4 A7 g$ l' F1 G) L! D  B
  revoke all on mytab from test;
# o$ J* j" U; l) l  select * from user_tab_privs; //返回当前用户所有的对象权限
# g; @7 y; i3 k9 n1 ^$ Q( u) U' s/ m4 {  对象权限可以控制到列) S5 n6 Y& Y( P/ y7 p& x$ ~
  grant update(name) on mytab to test;
' T! U" u$ z" d: W7 @; r, I/ I  grant insert(id) on mytab to test;; s' Y! P8 U3 O/ `/ g7 g
  select * from user_col_privs;
! [4 D5 \. M$ t0 C6 c' W  注意、:查询和删除不能控制到列
4 U- ]  h* [3 m1 e# C  需要有commit的 insert update insert
# B) \4 @; B3 Q8 T. V. c  权限的传递. i7 G: a% K( U  q
  系统权限的传递:
8 m6 O: m6 B4 b2 V% v) @9 L$ t  grant alter table to A with admin option;
% A+ Q  m/ L' u( e* p  那么A可以通过把该权限传递给B,如果想B也可以传递下去那么可以也带上with admin option2 q; T' Y; c* i3 _
  grant alter table to B;
8 d& @# X: J3 u9 Q7 m" u% C  对象权限的传递:
3 x1 r! R6 N( I* l- V$ W$ v2 h# T5 Y  grant select on mytab to A with grant option;
$ Y9 U$ q; }9 B4 z* c! Y  那么A可以把在表mytab的select权限赋予给B,如果B想也能传递该select权限也可以带上with grant option! U- f6 ?& X$ y% k( ]& ~$ _
  grant select on mytab to B;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-16 03:12 , Processed in 0.236425 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表