Categories: PLSQL Tutorials

Oracle Kill Job Steps | How to kill Oracle job with Examples?

In my previous article I have given multiple examples of PL/SQL; In this article I would like to give the very useful concept – Oracle Kill Job with multiple real life examples. There are so many situations in real world where user require to kill the running jobs or processes. As a developer you should also know to to check the running jobs and how to kill the jobs which are time consuming or unused. There are so many times the scheduled jobs and its respective sessions keeps open and we require to kill those sessions and job.

What you will see on this article?

What is Scheduled Oracle job with Example?

How to kill Oracle Scheduled jobs with Examples?

What is Scheduled Oracle Job?

Before starting the steps to kill oracle job we require to check what is scheduled oracle jobs. The task which needs to be run on specified interval for successful processing of application is called as scheduled tasks. We require to write scheduled jobs to perform those tasks in specific intervals. Sometimes the jobs will run the tasks which are time consuming and it will slow down your application or specific functionality of application. So we require to kill those scheduled jobs.

Example :

If in Central Banking Application you are running the Oracle job to consolidate the data from multiple branches. If the branches data is very huge and it is impacting the performance of application then we require to kill that oracle job. In next section we can check Oracle Kill Job steps in detail.

How to kill Oracle Scheduled jobs or Sessions? | Oracle Kill Jobs with example

In this section we can see how to kill the oracle scheduled jobs or sessions in detail with the examples. We have already seen the information about oracle jobs. This is very simple three steps process where we can kill Oracle jobs. You must know about system tables in detail to kill sessions of oracle job.

Oracle Kill Job

Oracle Kill Job Steps :

Step 1 : Search the Job which you want to kill

You require to search the Job which you want to kill. We need to use the system table named ‘dba_scheduler_running_jobs’ of oracle to find that specific job.

Query :
select * from dba_scheduler_running_jobs;

Lets say if you want to find the job named J_Bank_Consolidation then you can write query.

select * from dba_scheduler_running_jobs where job_name like ‘ J_Bank_Cons%’;

Step 2 : Kill the Job

You can kill the job using stop_job procedure of DBMS_Scheduler package.

exec DBMS_SCHEDULER.STOP_JOB(job_name => ‘Complexsql.J_Bank_Consolidation’,force => TRUE);

There are few attributes of this procedure. We require to pass parameters as job name and force = true or false. We are forcefully stopping this job using above query.

Step 3 : Check status of the job

select * from dba_scheduler_running_jobs;

Theses are 3 most important steps to kill the jobs in oracle side.

I hope you got the correct steps to kill the oracle jobs. Sometimes user/dba needs to kill the sessions as well associated with the oracle jobs. If you like this article on Oracle Kill Job or if you have any issues with the same kindly comment in comments section.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Share
Published by
Amit S

Recent Posts

What is Root Cause Analysis (RCA) With real examples

In my previous article I have given details about application support engineer day to day…

2 months ago

Application Support Engineer Day to day responsibilities

In my previous articles I have given the roles and responsibilities of L1,L2 and L3…

2 months ago

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

2 months ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

2 months ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

2 months ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

2 months ago