1 表权限:
登录scott/tiger,然后查询select 'grant select on '||tname||' to robbie;' from tab
tab表存储当前登录用户的所有表,tname是表名,查询结果:
grant select on DEPT to robbie;
grant select on EMP to robbie;
grant select on BONUS to robbie;
grant select on SALGRADE to robbie;
grant select on STOCK_RECEIVED to robbie;
然后执行这个查询结果集,就可以了,需要主意的是,scott用户必须有grant权限。
注意:grant select any table to robbie; //该语句意思是将所有表的访问权限赋予给robbie.
2 包权限
A、如果只想授予一个用户对一个包的执行权限,但不能查看包体:
grant execute on package_name to user_name;
B、如果想授予一个用户所有包的执行权限,并且能查看包体,但不能修改编译:
grant create any procedure,select any table,execute any procedure to user_name;