Oracle   Home  

 

Oracle Database 9i, 10g, 11g

Oracle Data Warehouse & BI

Oracle Applications EBS 11i, R12

 Oracle Middleware

SQL & PL/SQL

UNIX/ Linux

   Home  >  Oracle Database Administration (DBA)  >  Maintenance  >  Killing an Oracle job at the OS level

 

Oracle Database 10g Administration (DBA): Maintenance

Killing an Oracle job at the OS level 

 

Note: The article ( named Killing an Oracle job at the OS level ) was taken from www.in-oracle.com.

 

1.  Find the job we what to kill and the session associated with the job

 

             select j.sid,

                       s.spid,

                       s.serial#,

                       j.log_user,

                       j.job,

                       j.broken,

                       j.failures,

                       j.last_date||':'||j.last_sec last_date,

                       j.this_date||':'||j.this_sec this_date,

                       j.next_date||':'||j.next_sec next_date,

                       j.next_date - j.last_date interval,

                       j.what

              from ( select djr.SID, dj.LOG_USER, dj.JOB, dj.BROKEN, dj.FAILURES,

                                   dj.LAST_DATE, dj.LAST_SEC, dj.THIS_DATE, dj.THIS_SEC,

                                   dj.NEXT_DATE, dj.NEXT_SEC, dj.INTERVAL, dj.WHAT

                             from dba_jobs dj, dba_jobs_running djr

                             where dj.job = djr.job ) j,

                      (select p.spid, s.sid, s.serial#

                             from v$process p, v$session s

                             where p.addr = s.paddr ) s

             where j.sid = s.sid;

 

 

2.  Mark the job as Broken

 

                  begin

                     DBMS_JOB.BROKEN(job#,TRUE);

                     commit;

                  end;

 

             NOTE: After executing this command the job is still running.

 

 

3.  Kill the Oracle Session

 

ALTER SYSTEM KILL SESSION 'sid, serial#';

 

NOTE: In many situations the session is marked 'KILLED' but is not killed.  

 

 

4.  Kill the O/S Process

 

For UNIX:
kill -9 spid

For Windows at the DOS Prompt: 
orakill sid spid

 

 

Note: The article ( named Killing an Oracle job at the OS level ) was taken from www.in-oracle.com.

 

 

 

Oracle Database 9i, 10g, 11g

Oracle Data Warehouse & BI Oracle Applications EBS 11i, R12  Oracle Middleware

SQL & PL/SQL

UNIX/ Linux

   Home  >  Oracle Database Administration (DBA)  >  Maintenance  >  Killing an Oracle job at the OS level

 

 

Different Romanian Links/ Linkuri romanesti diferite

  1. Exercitii de gramatica limbii engleze (English Grammar Exercises )

  Doresti un proiect de arhitectura ieftin (pentru zonele Buzau, Bucuresti sau Prahova) ?

Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk. Copyright (c) 2009-2011 Paul Catalin Tomoiu. All rights reserved.