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.
1 Answer 1
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.
-
Hi Balazs Papp, into the SQL Developer i can't recover the sql statment, also following your indication (...which you can check by clicking the Run Report in SQL Worksheet button...).Fabio Z.– Fabio Z.2020年09月01日 11:01:47 +00:00Commented Sep 1, 2020 at 11:01
Explore related questions
See similar questions with these tags.
SYS as SYSDBA
when opening the connection? What do you mean when you write "...when I get session information..."? Hit the edit button an add as much details as possible to your question. This could be a possible duplicate of ORA-00942: table or view does not exist- Can it be solved by granting privileges to user?.