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 are Roles and Responsibilities of L1 Support Engineer with real industry examples?

In this series we are starting with Roles and responsibilities of L1 support engineer .…

1 hour ago

The Essential Guide to Cryptocurrency Exchange Platform Development for Beginners and Beyond

Introduction Cryptocurrencies took the world by storm, setting up a new financial system and breaking…

12 months ago

Top 20 System Administrator Interview Questions and answers

In my previous article I have given Top 20 technical support interview questions with its…

1 year ago

Desktop Support Scenario Based Interview Questions

In my previous articles I have given 15 most asked desktop support interview questions with…

1 year ago

How Do Business Analysts Use SQL for Their Needs?

A business analyst is someone who is versed in processes of data analysis used for…

1 year ago

Top 15 Control-M Interview Questions with Answers

In my previous article I have already given top questions and answers for Desktop support…

1 year ago