SELECT SUBSTR (s1.username, 1, 12) "WAITING USER",
SUBSTR (s1.osuser, 1, 8) "OS User",
SUBSTR (TO_CHAR (w.session_id), 1, 5) "Sid", s1.serial# "SERIAL1",
p1.spid "PID", SUBSTR (s2.username, 1, 12) "HOLDING User",
SUBSTR (s2.osuser, 1, 8) "OS User",
SUBSTR (TO_CHAR (h.session_id), 1, 5) "Sid", s2.serial# "SERIAL2",
p2.spid "PID",
'alter system kill session '''
SUBSTR (TO_CHAR (h.session_id), 1, 5)
','
s2.serial#
''';' to_kill
FROM SYS.v_$process p1,
SYS.v_$process p2,
SYS.v_$session s1,
SYS.v_$session s2,
dba_locks w,
dba_locks h
WHERE h.mode_held != 'None'
AND h.mode_held != 'Null'
AND w.mode_requested != 'None'
AND w.lock_type(+) = h.lock_type
AND w.lock_id1(+) = h.lock_id1
AND w.lock_id2(+) = h.lock_id2
AND w.session_id = s1.SID(+)
AND h.session_id = s2.SID(+)
AND s1.paddr = p1.addr(+)
AND s2.paddr = p2.addr(+);
This space will not be more than a place to publish my notes and issues commands for certain management databases on ORACLE platform. I want to be a help to all stakeholders. And how could't it be otherwise, i intend to learn from you. For me to OCM still lack a lot of road walking. Thank you all. Greetings' «José Maia »
quarta-feira, 28 de abril de 2010
CPU - Utilization
SELECT cpu.val "Host CPU Utilization (%)" FROM (SELECT metric_name, ROUND (VALUE) AS val FROM SYS.gv_$sysmetric WHERE intsize_csec = (SELECT MAX (intsize_csec)
FROM SYS.gv_$sysmetric WHERE inst_id = 1) AND metric_name = 'Host CPU Utilization (%)'
AND inst_id = 1) cpu;
FROM SYS.gv_$sysmetric WHERE inst_id = 1) AND metric_name = 'Host CPU Utilization (%)'
AND inst_id = 1) cpu;
Subscrever:
Mensagens (Atom)