Oracle: ORA-00942: “table or view does not exist” in SQL Developer

oracleoracle-sql-developerpermissions

in SQL Developer when i get session information he return me this error message: (ORA-00942: "table or view does not exist"). Can i resolve this with add grant to privilege of my user? Wich command use for wich table or view system?
Best Regards to all.
Fabio.

Best Answer

enter image description here

SQL Developer runs the below query (which you can check by clicking the Run Report in SQL Worksheet button) for its session browser:

with vs as (select rownum rnum,
                            inst_id,
                            sid,
                            serial#,
                            status,
                            username,
                            last_call_et,
                            command,
                            machine,
                            osuser,
                            module,
                            action,
                            resource_consumer_group,
                            client_info,
                            client_identifier,
                            type,
                            terminal,
                            sql_id,
                            sql_child_number
                       from gv$session) 
           select vs.inst_id, vs.sid ,serial# serial, vs.sql_id, vs.sql_child_number,
                  vs.username "Username",
                  case when vs.status = 'ACTIVE' 
                            then last_call_et 
                       else null end "Seconds in Wait",
                  (select command_name from v$sqlcommand where command_type = vs.command ) "Command",
                  vs.machine "Machine",
                  vs.osuser "OS User", 
                  lower(vs.status) "Status",
                  vs.module "Module",
                  vs.action "Action",
                  vs.resource_consumer_group,
                  vs.client_info,
                  vs.client_identifier
             from vs 
            where vs.USERNAME is not null
              and nvl(vs.osuser,'x') <> 'SYSTEM'
              and vs.type <> 'BACKGROUND'
              order by 1,2,3

Based on that, grants needed:

grant select on sys.gv_$session to your_user;
grant select on sys.v_$sqlcommand to your_user;

You may need additional privileges for other options.