SELECT dob.object_name table_name,
lo.session_id,
vss.serial#,
vss.action action,
vss.osuser osuser,
vss.process ap_pid,
vps.spid db_pid,
vss.status,
'ALTER SYSTEM KILL SESSION ''' || vss.sid || ',' || vss.serial# || ''';',
'kill -9 ' || vps.spid, --注意:殺進程不要亂用,風險很大(UNIX、LINUX下使用)
'orakill ORCL ' || vps.spid --注意:殺進程不要亂用,風險很大(WINDOWS下使用)
FROM v$locked_object lo,
dba_objects dob,
v$session vss,
v$process vps
WHERE lo.object_id = dob.object_id
AND lo.session_id = vss.sid
AND vss.paddr = vps.addr
ORDER BY 2,3,dob.object_name;
配合使用
declare
cursor c_r is
select cp.USER_CONCURRENT_PROGRAM_NAME,
r.request_id,
r.requested_by user_id,
r.responsibility_id,
r.responsibility_application_id
from fnd_concurrent_requests r, fnd_concurrent_programs_vl cp
where r.concurrent_program_id = cp.CONCURRENT_PROGRAM_ID
and r.phase_code in ('P', 'R')--待定,運行中
--and cp.CONCURRENT_PROGRAM_NAME = 'XLAREPSEQ';
;
l_bool boolean;
l_msg varchar2(2000);
begin
for rec in c_r loop
fnd_global.APPS_INITIALIZE(user_id => rec.user_id, --請求提交用戶ID
resp_id => rec.responsibility_id, --請求提交職責ID
resp_appl_id => rec.responsibility_application_id); --職責應用
l_bool := fnd_concurrent.cancel_request(request_id => rec.request_id,
message => l_msg);
commit;
dbms_output.put_line(rec.USER_CONCURRENT_PROGRAM_NAME || '=>請求ID:' ||
rec.request_id || ',message:' || l_msg);
end loop;
end;