Login   Search
Skip Navigation Links
Home
Application Security Tips
Oracle , PL/SQL
IT Product Reviews
Project Management
Forum
Contact Us
Links & References
Avoid SQL Injection attack
Threats and Countermeasures: S.T.R.I.D.E
Input Validation
Session Management
Authentication Mechanism
Cross Site Scripting Vulnerabilities
Configuration Management
Scroll up
Scroll down
Oracle 9i - Programming basics PL/SQL
PL/SQL - Conditional Statements – IF
PL/SQL -Nested Block
LOOPS in PL/SQL
PL/SQL Records
Cursors in PL/SQL
PL/SQL Tables
PL/SQL Exceptions
PL/SQL Procedures
PL/SQL Functions
Oracle supplied packages
Packages
PL/SQL Ref Cursors
Types in Oracle PL/SQL
Varrays
Nested Table
Bfile and LOBs
Bulk Binding
Know Depandencies
PL/SQL Wrapper
Triggers
Scroll up
Scroll down
DBMS_SQL package
DBMS_DDL Package
DBMS_JOB Package
UTL_FILE Package
DBMS_METADATA Package
DBMS_PIPE Package
DBMS_SESSION Package
Scroll up
Scroll down

 

Blog

  • Imperativeness of agile methodology in software development
  • Get list of installed softwares on machines in your network
  • VMWare - Error - the vmware authorization service is not running
  • Add chart / graphs in ASP.net application / website
  • Microsoft Ramp Up

Blog

  • Review: uCertify.com: PrepKit for: 70-529 (C#)
  • Bird eye Review: uCertify.com: PrepKit for: 70-529 (C#)
Skip Navigation Links>Oracle , PL/SQL>Oracle supplied packages>DBMS_JOB Package

Oracle supplied packages -DBMS_JOB Package

Enables the scheduling and execution of PL/SQL programs.

Submit is the procedure of DBMS_JOB package.
The parameters of Submit procedure are ---

JOB – Unique identifier of the job (Out parameter)
WHAT – PL/SQL code to execute as a job
NEXT_DATE – Next execution date of the job
INTERVAL – Date function to compute the next execution date of a job.

Example –
Every next day a new record should get added in the table djt1.

Create table djt1(a number);
Create sequence jobseq;
Create or replace procedure p1
 Is
    Begin
              Insert into djt1
              Values(jobseq.nextval);
     End;
/

Variable jobno number

begin
 dbms_job.submit
 (
  job => :jobno,
  what => 'P1;',
  next_date => trunc(sysdate),
  interval => 'trunc(sysdate 1)'
 );
 commit;
end;
 
In the init.ora file    JOB_QUEUE_PROCESSES = n  has to be setted
n can be between 1 and 36.
 Change the system date to the next date. The t1 table gets the next value of the sequence.
Again repeat the process.
 
Imp setting –          job_queue_processes  = n (n between 1 and 36) in the init.ora file

Select job,what from user_jobs;

Exec dbms_job.Broken(1,true) – 1 is job no
Exec dbms_job.Remove(1)

Dbms_job.change(jobno, what, next_date, interval)

Jobno cannot be changed.

If there is no change for what, next_date, interval then specify NULL
For having interval of 60 seconds it will be ‘Sysdate (59/ (24*60*60))’

Discussion about this article

AuthorBody
admin
8/24/2009 3:21 PM
Please provide feedback about this article here.
To participate in this discussion Sign up for free membership of 24x7code.
To Signup click on Login , Use create user link & the follow the instructions.
Thank you



Designed & Developed by Rahul Bagal