Oracle Articles, Oracle Tools, Oracle Tips, Database Articles and DBA Tips  

The Largest Online Resource for Oracle Articles, Oracle Tips, Oracle Scripts & Oracle Tools!!


Enter your Email:
 
Navigate at FreeMegaZone Home      Articles      Tools      Jobs      Games      Support      Submit Content      Advertise
Advertise at http://www.articles.freemegazone.com

Advertise at FreeMegaZone

Give tremendous boost to your business by advertising at FreeMegaZone. Contact webmaster@freemegazone.com

 

Rating: *****                                             Rate this article:    

Author: Asif Momen

Page: 1 2

Killing Oracle Sessions:

Now you will kill all Oracle sessions associated with the Long Running Queries. Use below query to kill such sessions.

select 'ALTER SYSTEM KILL SESSION ''' s.sid','s.serial#''';'
from dba_jobs dj, dba_jobs_running djr, v$process p , v$session s
where dj.job = djr.job
and p.addr = s.paddr
and djr.sid = s.sid;

Killing Operating System Sessions:

You speed up the process of cleaning the killed session undo data by speeding up PMON. PMON can be speeded up by killing the operating system sessions. This is an optional step.

select 'Kill -9 ' p.spid
from dba_jobs dj, dba_jobs_running djr, v$process p , v$session s
where dj.job = djr.job
and p.addr = s.paddr
and djr.sid = s.sid;

V$SESSION view:

Now you have to wait until all the sessions marked as ‘killed' have been really killed and disappear from the V$SESSION view.

Mark the jobs as Unbroken:

Once all sessions marked as ‘killed' are killed and disappear from V$SESSION view then you will mark all the jobs as unbroken using the below query.

select 'Kill -9 ' p.spid
from dba_jobs dj, dba_jobs_running djr, v$process p , v$session s
where dj.job = djr.job
and p.addr = s.paddr
and djr.sid = s.sid;

Running the Jobs:

Once all the Long Running Queries have disappeared then you need to put the jobs back in the job queue and run them.

select ‘Exec DBMS_JOB.BROKEN(‘j.job ‘,FALSE);'
from dba_jobs dj,
dba_jobs_running djr
where dj.job = djr.job;

ALL_JOBS views:

You can ensure that all the jobs are back in action by querying the ALL_JOBS view. Read Again!!

Page: 1 2

 More Oracle Articles, Database Articles and DBA Tips
   Database Security: Step by step guideline
   The power of Oracle Diagnostic Tools!
   DBA Tips for Troubleshooting Oracle Orphaned Sessions!!
   Tricky Oracle Recovery for missing Archive Log!!
   DBA Tips for Oracle 10g Lost SYSOPER Password!!


FreeMegaZone Jobs

 

 
HOME      ABOUT US      SUPPORT      SITE MAP      PRIVACY POLICY      TERMS OF USE      SUBMIT CONTENT      ADVERTISE
Copyright © 2007 - 2010 Oriole Intellect Inc. All rights reserved.

The name Oracle is a trademark of Oracle Corporation. Any other names used on this website may be trademarks of their respective owners