0

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.

asked Sep 1, 2020 at 9:27
1

1 Answer 1

1

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.

answered Sep 1, 2020 at 9:35
1
  • 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...). Commented Sep 1, 2020 at 11:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.