Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_JOB: Numerous jobs (DB 11.2.0.1.0, Windows server 2008 R2)
DBMS_JOB: Numerous jobs [message #614054] Thu, 15 May 2014 02:51 Go to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
Hi

We have a procedure that run for (up to) several hours, doing the same calculation for different items. Since the job runs in an isolated environment (i.e. not the production database), we think the job is an obvious candidate for parallelization, which we plan to use dbms_job for by submitting a job for each of the items calculations mentioned.

The described approch would mean submitting a peak of around 15-20.000 jobs in a run.

Should I by any means be worried about that number?

I consider for example to submit the jobs in batches of XX jobs (500?), and wait for these to finish before submitting the next batch and so on. Am I just worrying without reason?

/Ibergo
Re: DBMS_JOB: Numerous jobs [message #614055 is a reply to message #614054] Thu, 15 May 2014 02:56 Go to previous messageGo to next message
John Watson
Messages: 8928
Registered: January 2010
Location: Global Village
Senior Member
Probably you should not use DBMS_JOB for this. You should use Scheduler lightweight jobs, which are specifically intended to handle this sort of situation.

DBMS_JOB is very twentieth century.
Re: DBMS_JOB: Numerous jobs [message #614056 is a reply to message #614054] Thu, 15 May 2014 02:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

DBMS_JOB runs the jobs on the database server.

Re: DBMS_JOB: Numerous jobs [message #614060 is a reply to message #614056] Thu, 15 May 2014 04:37 Go to previous messageGo to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
Maybe I can use DBMS_SCHEDULE, but it that the answer to all prayers?

@Michel: That was also my intention Smile

/Ibergo
Re: DBMS_JOB: Numerous jobs [message #614061 is a reply to message #614060] Thu, 15 May 2014 05:55 Go to previous messageGo to next message
John Watson
Messages: 8928
Registered: January 2010
Location: Global Village
Senior Member
ibergo wrote on Thu, 15 May 2014 10:37
Maybe I can use DBMS_SCHEDULE, but it that the answer to all prayers?

@Michel: That was also my intention Smile

/Ibergo
I don't pray. I am a scientist.
Re: DBMS_JOB: Numerous jobs [message #614062 is a reply to message #614060] Thu, 15 May 2014 06:06 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Depending your treatment you may have a look at the DBMS_PARALLEL_EXECUTE package.

Re: DBMS_JOB: Numerous jobs [message #614063 is a reply to message #614062] Thu, 15 May 2014 06:20 Go to previous messageGo to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
Thank you a again both. I think the scientist's (Smile) advice to look at dbms_schedule is the most appropriate approach. I'm looking at the possibilities right now...

/Ibergo
Re: DBMS_JOB: Numerous jobs [message #616551 is a reply to message #614063] Wed, 18 June 2014 04:07 Go to previous messageGo to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
After some experimenting with up to 5000 parallel jobs, I must say I'm still in doubt about whether to use DBMS_JOB or DBMS_SCHEDULER.

The "problem" is that it seems that dbms_job perfors about twice the speed compared to dbms_scheduler. I wonder why the difference is so significant...

The control and monitor mechanisms of dbms_sheduler is by no doubt the better of the two, but the task my jobs are to solve are ad hoc calculations where the prime success criteria is speed.

I have to do more and larger scaled experiments before I'm confortable by sticking to the elder technology, but I'm still seeking the very good argument of why not to point at dbms_job...

That "DBMS_JOB is very twentieth century" is in my point of view not a valid point in it self. But your input would very much appreciated in any case Smile

/Ibergo
Re: DBMS_JOB: Numerous jobs [message #616556 is a reply to message #616551] Wed, 18 June 2014 04:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

My opinion is "use dbms_job".

Re: DBMS_JOB: Numerous jobs [message #616565 is a reply to message #614054] Wed, 18 June 2014 06:29 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
ibergo wrote on Thu, 15 May 2014 13:21
we plan to use dbms_job for by submitting a job for each of the items calculations mentioned.


IMO, use DBMS_SCHEDULER, and using CHAINS control the jobs flow.

Quote:

I consider for example to submit the jobs in batches of XX jobs (500?), and wait for these to finish before submitting the next batch and so on.


Use SET_SCHEDULER_ATTRIBUTE procedure to set the maximum value for max_job_slave_processes. In your case, set it to 500. Schedule them at same time. And using chain you can further control the flow.
Re: DBMS_JOB: Numerous jobs [message #616566 is a reply to message #616565] Wed, 18 June 2014 06:44 Go to previous messageGo to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
Lalit Kumar B wrote on Wed, 18 June 2014 06:29

IMO, use DBMS_SCHEDULER, and using CHAINS control the jobs flow.


The single jobs are independent calculations, hence I don't see any need for CHAINS

Quote:

Use SET_SCHEDULER_ATTRIBUTE procedure to set the maximum value for max_job_slave_processes. In your case, set it to 500. Schedule them at same time. And using chain you can further control the flow.


Ref this the use of MAX_JOB_SLAVE_PROCESSES is deprecated. In my case JOB_QUEUE_PROCESSES is set to 1000.

/Ibergo


Re: DBMS_JOB: Numerous jobs [message #616567 is a reply to message #616556] Wed, 18 June 2014 06:49 Go to previous messageGo to next message
ibergo
Messages: 18
Registered: February 2014
Junior Member
Michel Cadot wrote on Wed, 18 June 2014 04:57

My opinion is "use dbms_job".



Thanks Michel for your advice. I think I will go for that, and "switch" to dbms_scheduler only if dbms_job ends up not being robust enough in terms of handling errors and exceptions.

/Ibergo

[Updated on: Wed, 18 June 2014 07:01]

Report message to a moderator

Re: DBMS_JOB: Numerous jobs [message #616569 is a reply to message #616566] Wed, 18 June 2014 07:15 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
ibergo wrote on Wed, 18 June 2014 17:14

Ref this the use of MAX_JOB_SLAVE_PROCESSES is deprecated. In my case JOB_QUEUE_PROCESSES is set to 1000.


So from release 2 onwards you do ALTER SYSTEM set JOB_QUEUE_PROCESSES = value, doesn't stop you from using the feature. And although you mention 1000 doesn't guarentee that scheduler will start 1000 slaves. It will always be <1000 and might reach max 1000.
Re: DBMS_JOB: Numerous jobs [message #616570 is a reply to message #616567] Wed, 18 June 2014 07:22 Go to previous message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I still use dbms_job, dbms_scheduler is only good when you want to do things that can't be done with dbms_job like chaining, natively calling program or shell scripts, using windows... otherwise dbms_job is the best one.
You can read DBMS JOB complex scheduling, the methods explain there can be used for things other than scheduling.

Previous Topic: How to print vertical numbers
Next Topic: How to disable any command for user who has full rights
Goto Forum:
  


Current Time: Tue Apr 16 11:25:27 CDT 2024