Have you granted permission explictly to your user?
Code:
SQL> declare
2 cnt number;
3 begin
4 select count(*) into cnt from v$session;
5 end;
6 /
select count(*) into cnt from v$session;
*
ERROR at line 4:
ORA-06550: line 4, column 31:
PLS-00201: identifier 'SYS.V_$SESSION' must be declared
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
SQL> connect sys
Enter password: **********
Connected.
SQL> grant select on v_$session to jeffh;
Grant succeeded.
SQL> connect jeffh/jeffh
Connected.
SQL> declare
2 cnt number;
3 begin
4 select count(*) into cnt from v$session;
5 end;
6 /
PL/SQL procedure successfully completed.
Bookmarks