当JOB里面有dblink,很可能会造成hang住。
create or replace procedure p_test is
begin
dbms_lock.sleep(1000);
end;
declare test_job number;
begin
dbms_job.submit(test_job,'p_test;',sysdate,'sysdate+100/1440');
commit;
end;
EXEC DBMS_JOB.BROKEN(4,TRUE);--很可能停不下来
select * from dba_jobs_running;
selectb.INST_ID,b.SID,b.SERIAL#,c.SPID
from dba_jobs_running a,gv$sessionb,gv$process c
where a.sid = b.sid and b.PADDR =c.ADDR
and b.INST_ID = c.INST_ID;
alter system kill session '68,197';--很可能停不下来
select b.INST_ID,
b.sid,
b.SERIAL#,
a.OBJECT,
'alter system kill session ' || ''''|| b.sid || ',' || b.SERIAL# ||
''';' kill_command
from gv$ACCESS a,gv$session b
where a.type = 'PROCEDURE'
and a.OBJECT in ('P_TEST')
and a.sid = b.sid
and a.INST_ID = b.INST_ID;
alter system kill session '9,81';
select spid
from gv$process p,gv$session s
where p.INST_ID = s.INST_ID
and p.INST_ID = 1
and s.SID = 9
and s.SERIAL# = 81
and p.ADDR = s.PADDR;
orakill ora11 9284 --windows 最后的方法
kill -9 5116 --linux