?
Solved

DBMS_JOB

Posted on 2001-09-09
4
Medium Priority
?
1,458 Views
Last Modified: 2012-05-04
WHAT IS DBMS_JOB. How can I use it? Please explain in detail as far as practicable. Help highly appreciated.
0
Comment
Question by:BIKASHMISHRA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Accepted Solution

by:
AlbertYou earned 120 total points
ID: 6470199

Hi,


1. What is DBMS_JOB ?
    There are up to 36 Oracle background processes(SNPn processes) you can configure and use them to run user  stored procedures periodically and automatically on the server side. User jobs are submitted and managed by the Oracle supplied package called DBMS_JOBS.

2. Configure Oracle to startup SNPn processes.
   (1) SHUTDOWN DATABASE
   (2) Edit your initDIS.ora, add/modify the following parameters.
       job_queue_processes = 4 # Upper limit=36
       job_queue_interval = 10 # No. of seconds to awake SNP processes ,Range = 1-3600
       processes = 123 # Enlarge it for high value of job_queue_processes
   (3) Restart Oracle

3. Submit your job to the database.
   (1) Connect to Oracle as an valid user who is granted with the execute privilege of the DBMS_JOB PACKAGE.
   (2) Assume you have a stored procedure test_proc and want to run it automatically in Oracle once an hour.
======================================
DECLARE
   job_no  BINARY_INTEGER;
begin
   job_no := 1000; -- Assign you job No. whatever you want
   DBMS_JOB.ISUBMIT(job_no, -- Job No.
          'test_proc;',     -- procedure name to run
          TO_CHAR(SYSDATE), -- job start time
          'SYSDATE+1/24' ); -- time interval in unit of DAY to restart
end;
/

You may save the parameters required by the stored procedure in a table or just hard code in the
DBMS_JOB.ISUBMIT line like the following

dbms_job.isubmit(job_no,'proc_test(''arg1'');',
          sysdate,'sysdate+1/24');

=======================================
4. Remove your job from the database.
begin
   dbms_job.remove(1000);
end;
/

5. View your jobs submitted
       select * from USER_JOBS;

Hope this helps
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7045839
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7058306
Recommended disposition:

    Accept AlbertYou's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7059237
Thanks for your help, Dan. :)
Item finalized today by Moondancer - EE Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

777 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