REM reports which tables are in use by which users (on OPS)

set lines 120;
set pages 500;
set verify off;
set feed off;

column db_user format A20;
column program format A35;
column accessed_objects format A40;

break on db_user on program;

PROMPT ================================================================================================================
PROMPT Objects currently being accessed:
PROMPT ================================================================================================================

select
a.osuser||’@’||a.machine db_user,
a.program,
b.owner||’.’||b.object accessed_objects
from gv$session a, gv$access b
where
a.inst_id = b.inst_id and
a.sid = b.sid and
a.type = ‘USER’ and
b.owner != ‘PUBLIC’ and
b.type not in (‘SYNONYM’,’PACKAGE’)
order by a.osuser,a.machine,b.owner,b.object;

PROMPT ================================================================================================================

set feed on;