Click to See Complete Forum and Search --> : How to stop a running dbms_job job


boris
10-13-2000, 04:03 AM
Hi!

when I start a job using dbms_job.submit and the job runs in a loop (e.g. waits for a event from advance queuing) - how do I stop this job?

There is no "dbms_job.stop" or something else. OK, I can kill the correspondending SNP process on my server, but I want to do it with Oracle only.

Please reply also to my emai address: boris.klug@ibs-ag.de

Thank you in advance!

akkerend
10-13-2000, 04:57 AM
In DBMS_JOBS_RUNNING you can find the sid of the session.
Use this sid to identify the session in v$session and kill the session with:
'alter system kill session 'sid,serial#';'

Don't forget to mark the job as broken or remove it from the job queue.