working sqls & long operations

select s.sid, s.serial#, p.spid, p.pid, p.username, s.username "Oracle User",decode(s.terminal, NULL, p.terminal, s.terminal) Terminal,
p.latchwait, s.lockwait, substr (to_char(logon_time,'yymmdd hh24:mi'), 1, 14) logtime, sql_text Sql, disk_reads Reads, buffer_gets Gets,
sorts Sorts from audit_actions a, v$process p, v$session s, v$sqlarea area
where s.paddr = p.addr
and a.action(+) = s.command
and s.sql_address = area.address
and s.sql_hash_value = area.hash_value
and status = 'ACTIVE'
and type != 'BACKGROUND';

SELECT
a.sid,
a.serial#,
--substr(a.opname,1,10) opname,
substr(message,1,40) message,
TO_CHAR(a.start_time ,'HH24:MI:SS') start_time,
trunc (time_remaining/60) remaining,
to_char(round((a.sofar/a.totalwork)*100,2))||'%' percentage,
substr(b.username,1,10) username,
substr(b.osuser,1,10) osuser,
substr(b.machine,1,10) machine
--,substr(a.target,1,35) target
FROM v$session_longops a, v$session b
where a.sid=b.sid and
a.serial#=b.serial# and
time_remaining > 0
order by username

Hiç yorum yok: