?
Solved

How do I stop a Oracle schedule job already running

Posted on 2011-04-23
8
Medium Priority
?
936 Views
Last Modified: 2012-05-11
I do not have DBA privilege. But with my schema login I am running a job. From the IDE I see that the job has been running from hours.
If I right-click on the job name and delete (shows error that it is running) or Right-click on the running job and delete. It does not delete the job (no error is shown).
Is there any other way to delete the runnign job?

Also do you know what the "CPU Used" time mean there in the running job screen?
I assume out of the elapsed time, the job got CPU for only this much time.. job screen
0
Comment
Question by:toooki
  • 5
  • 3
8 Comments
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35454927
hi tooki,
- does this question related to your early question on http://www.experts-exchange.com/Database/Oracle/Q_26926306.html ?

- you need to have the SCHEDULER_ADMIN role to administer the scheduler. without the right privileged, you won't be able to drop  job.

0
 

Author Comment

by:toooki
ID: 35454931
Thanks.

No that question was different and that worked. That was related to stopping email notification job.

With the current schema user I scheduled the job so I should have the SCHEDULER_ADMIN role. I can delete a scheduled job too. But I cannot delete or stop an already running job (I am the owner of the job).

So was wondering if there is any known way to delete a running job..
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35454932
- you need to ask your DBA to grant the SCHEDULER_ADMIN role to you:

GRANT SCHEDULER_ADMIN TO username;
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 23

Accepted Solution

by:
OP_Zaharin earned 1900 total points
ID: 35454942
- sorry about the posting above, i didnt refresh earlier.
- i always stop the job queue first by ALTER SYSTEM SET job_queue_processes = 0;
- but always remember to set it to the previous queue_processes value or your future job won't run (which means check the value before you set it to 0)

- try the stop job step by step in this link:
http://it.toolbox.com/blogs/database-solutions/killing-the-oracle-dbms_job-6498

 
0
 

Author Comment

by:toooki
ID: 35454952
OK. thank you. I am going through the link that you sent to me.
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35454982
"No that question was different and that worked. That was related to stopping email notification job. "

- toooki,  if it works, then close that question and award the points to the solution that work to that issue.
0
 

Author Comment

by:toooki
ID: 35455119
Thank you for your help on the other question.

For this, well it worked with the command:
DBMS_SCHEDULER.DROP_JOB(job_name => 'MyPAckage.MyPROC', force => TRUE);

Strange that the IDE GUI did not let me delete the job but the above command did. So I am all ok with what I wanted .

Thanks.
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35455198
- great it helps you toooki and thank you for the points :)

- the command line use force=true option which oracle will try to stop the job first and then proceed with the deletion. the GUI delete the job using the default option which is force=false which deletion is done after the is job execution finished.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question