Solved

DBMS_JOB

Posted on 2001-09-09
4
1,451 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 30 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

705 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