利用v$session的触发器,编译报ora-00942错用sys用户进去grant select on v$session to 
 报ora-02030的错触发器语法肯定没有错误。

解决方案 »

  1.   

    这样试试
    alter system set o7_dictionary_accessibility=true scope=spfile;
    --重启数据库
    grant select on v$session to o7_dictionary_accessibility参数:
    这个参数是控制select any table权限使用的。
    若该参数为 true,则有 select any table 权限的帐号则可查看
    DBA_ V$等之类的数据字典,否(false),则只能看自己权限内的sys@YPCOST> show parameter o7;NAME                                 TYPE        VALUE
    ------------------------------------ ----------- -------------
    O7_DICTIONARY_ACCESSIBILITY          boolean     FALSE
      

  2.   

    grant select on v_$session to scott
    --我试了这个能成功
    v_$session   这个VIEW   ,这个   v$session是建立在V_$SESSION   PUBLIC   SYNONYM。
      

  3.   

    就是这个原因.
    如果没有其他要求的话可以直接将数据字典的select权限下放.
    grant select any dictionary to username
      

  4.   

    ---干脆授权所有的数据字典视图的权限
    grant select any dictionary to user