Check items running in the Database

WITH vs AS (
SELECT LOGON_TIME, ROWNUM rnum, inst_id, sid, serial#, status,SADDR,
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 LOGON_TIME, vs.inst_id, vs.sid, serial# serial, vs.sql_id, vs.username “Username”,
CASE WHEN vs.status = ‘ACTIVE’ THEN last_call_et ELSE NULL END “Sec in Wait”,
( SELECT x.command_name FROM v$sqlcommand x WHERE x.command_type = vs.command) “Command”,
vs.machine “Machine”, vs.osuser “OS User”, lower(vs.status) “Status”, vs.module “Module”, sqlt.SQL_TEXT,sw.EVENT, sw.state, sqlt.PIECE
FROM vs inner join GV$SQLtext_with_newlines sqlt on vs.sql_id = sqlt.SQL_ID
inner join Gv$session_wait sw on sw.sid = vs.sid
inner join v$sqlcommand cmd on cmd.COMMAND_TYPE = vs.command
WHERE
vs.username IS NOT NULL
AND nvl(vs.osuser,’x’) <> ‘SYSTEM’ AND vs.type <> ‘BACKGROUND’ and lower(vs.status) = ‘active’
and lower(vs.Module) like ‘%developer%’ — left this one a like statement in case this is used for something else
and vs.username = ( select user from dual) — depends on what you are looking for
and cmd.COMMAND_NAME = ‘CREATE TABLE’
ORDER BY vs.SQL_ID, sqlt.PIECE;