Make the "Sessions" window compatible with Real Application Clusters

Carlo Sirna

Member²
the "sessions" view, in a clustered server, displays only the sessions running on the same node on which the session view is connected.

Now, if you know how to do it, it is easy to customize the queries used by this session view in order to use the cluster-aware gv$instance, gv$lock, gv$sql etc system views instead of the corresponding instance-only corresponding v$instance v$lock v$sql views

For example the "All sessions" view becomes this:

select * from gv$session
where username is not null
order by logon_time, sid

and the "Cursors" detail becomes this:

select * from gv$open_cursor where sid = :sid and inst_id = :inst_id

So a first request is to make these the default queries (or at least add a easy way to replace the dinosaur user-compatible configuration with the new correct one, instead of having to force the user to figure out how to do it. Just add a "load RAC-ENABLED defaults" button to the preferences).

The second request is to finally fix the problem that all the "context menu" actions I can invoke by right-clicking a session are not cluster-aware: you get to kill a session only if you are lucky enough to be connected on the same node of the session you want to kill.

to fix the "kill session" issue you just need to issue this command:

alter system kill session ',,@'

but pl/sql doesn't add the @instance id parameter... and by the way THIS TOO works also if you are not connected to a cluster: simply instance id is always 1, in this case.

Now: since being able to add new session queries and new session details is GREAT, it would be great also to be able to add custom actions to the pop-up menus

Could you add these features in the next release?
1) make editable the pl/sql blocks used to implement the default actions (kill session, enable sql trace, etc)
2) allow users to define their own actions (by executing pl/sql blocks using bind variables and possibly to launch external executables passing values of bind variables on the command line)

Thank you

 
An editable command for Kill Session would be super-handy. I can't remember when I last worked on a site where developers had ALTER SYSTEM privilege (!) - instead, what is often provided is a custom kill_session procedure owned by a DBA account. I'd love to be able to call this from the session browser.

Some more control over executing code blocks from the session browser would be great for Oracle system reports such as SQL Monitor which open in a web browser.
 
Back
Top