日期:2014-05-16  浏览次数:20811 次

小弟初学oracle 遇到一个问题 求大侠指教
在dba_role_privs视图中有 四个字段
Name Type Nullable Default Comments  
------------ ------------ -------- ------- ------------------------------------------------- 
GRANTEE VARCHAR2(30) Y Grantee Name, User or Role receiving the grant 
GRANTED_ROLE VARCHAR2(30) Granted role name  
ADMIN_OPTION VARCHAR2(3) Y Grant was with the ADMIN option 
DEFAULT_ROLE VARCHAR2(3) Y Role is designated as a DEFAULT ROLE for the user 

为什么查询时其中的GRANTED_ROLE 字段不能作为条件查询
 SQL> select grantee from dba_sys_privs dsp where dsp.granted_role='DBA';
 
select grantee from dba_sys_privs dsp where dsp.granted_role='DBA'
 
ORA-00904: "DSP"."GRANTED_ROLE": invalid identifier  
为什么提示无效的字段啊 我晕死

------解决方案--------------------
select dsp.grantee from dba_sys_privs dsp where dsp.granted_role='DBA';
------解决方案--------------------
你登陆的用户是什么 如果不是dba 就会出现不存在表的错误