1 结论
1. 结论:'权限大小不同': dba_* > all_* > user_*
(1) dba_* : 可以访问 '数据库' 中所有的对象(前提:该用户是 dba 用户)
(2) all_* :某一用户 '拥有' 的或 '可以访问' 的所有的对象
(3) user_*:某一用户 '拥有' 的所有对象
2. 查询是否是 dba 用户
select * from dba_role_privs t where t.granted_role = 'DBA';
dba 用户查询结果:
grantee granted_role
SYS DBA
SYSTEM DBA
2 示例
-- 如:查询表定义信息
select * from dba_tab_comments;
select * from all_tab_comments;
select * from user_tab_comments;
若现在有两个普通用户 scott 和 hr,其中 hr 中存在表 jobs
以 'scott' 为例 -- 登录用户
1. user_tab_comments 和 all_tab_comments '均无法查询' 到表 jobs
2. 当 hr 将表 jobs 的 select 权限授予 scott 时
(1) user_tab_comments 依旧查询不到表 jobs('表 jobs 不是 scott 拥有的对象')
(2) all_tab_comments 中能够查询到表 jobs('授权,虽不拥有,但可以访问')
3. system 是 'dba' 用户,可以访问任何对象(不需要授权, '我是老板,我很牛皮!')
图示:(虚线:无法访问,实线:能否访问)