Monday, 4 October 2010

User has no SELECT privilege on V$SESSION v_$sql_plan v_$sql

if you are getting this error from scott



SQL> select * from table(dbms_xplan.display_cursor(null, null, 'OUTLINE'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
User has no SELECT privilege on V$SESSION

SQL> select * from table(dbms_xplan.display_cursor(null, null, 'OUTLINE'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
User has no SELECT privilege on V$SQL_PLAN


then grant following permission to scott



SQL> GRANT SELECT ON v_$session TO scott;

Grant succeeded.

SQL> grant select on v_$sql_plan_statistics_all to scott;

Grant succeeded.

SQL> grant select on v_$sql_plan to scott;

Grant succeeded.

SQL> grant select on v_$sql to scott;

Grant succeeded.

1 comment:

  1. this doesn't work for me.
    take a look:
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'OUTLINE'));

    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    User has no SELECT privilege on V$SESSION

    SQL> GRANT SELECT ON v$SESSION TO pippo
    2 ;
    GRANT SELECT ON v$SESSION TO pippo
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    ReplyDelete