Oracle: Scheduler Jobs in Oracle Database

Oracle: Scheduler  jobs  in Oracle Database.

In this article we will learn how to create jobs and schedule the jobs.

You create one or more jobs using the DBMS_SCHEDULER.CREATE_JOB.

You must have the CREATE JOB privilege to create a job in your own schema, and the CREATE ANY JOB privilege to create a job in any schema except SYS.

Create schema and build tables

In emp table we have 14 records.

Now we will create a job using dbms_scheduler.create_job package.

The above package will create a job  and main intention of job is to gather stats of KTUSER schema for every one hour.

To Know more examples about creation of jobs please check below link :

Oracle: Scheduler Jobs in Oracle Database-2

To know all the  jobs in database  using dba _scheduler_jobs view.

To check job running details use  dba_scheduler_jobs

To check whether job has been successfully running or not using dba_scheduler_job_run_details 

Finally check by running job , Schema stats gathered or not .

How to Enable and disable a job ?

Disable  a job 

Execute below package to disable  job

Check job status now.

Enable  a job 

Check job status now

How to Drop a job 

 

 

Thank You ….

 

 

 

 

 

 

 

 

Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading...

Add Comment