合 为何SYSTEM用户可以将V$SESSION的查询权限赋权给其他用户而SYS用户却不可以?
Tags: Oracle
有学员提出了一个问题,
现象如下,难道SYSTEM比SYS用户的权限更大吗?
SYS@ora11g > grant select on v$session to lhr;
grant select on v$session to lhr
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
SYS@ora11g > conn system/lhr
Connected.
SYSTEM@ora11g > grant select on v$session to lhr;
Grant succeeded.
如果SYSTEM不能对V$SESSION赋权,那么请执行以下命令:
GRANT SELECT ON SYS.V_$SESSION TO SYSTEM WITH GRANT OPTION;
这样SYSTEM就可以对V$SESSION赋权了。
对于该问题可以从以下视图中获得答案:
SYS@ora11g > col OWNER format a10
SYS@ora11g > col object_name format a15
SYS@ora11g > SELECT d.owner,d.object_name,d.object_type FROM Dba_Objects d WHERE d.objectname IN ( 'V$SESSION','V$SESSION');
OWNER OBJECT_NAME OBJECT_TYPE
SYS V_$SESSION VIEW
PUBLIC V$SESSION SYNONYM