Tuesday, January 7, 2014

Oracle DB: which SQL is being run by a given OS user?

assuming the os user is nnvernetpi:
select * from v$sql where sql_id in (select sql_ID from gv$session where lower(OSUSER) = 'nnvernetpi');

on RAC, v$session refers only to the current node. gv$session is the whole RAC
(thanks Alain for the explanation)

No comments: