Scheduler jobs, slave pid and sleep
I have 2 scheduler jobs, that run different scheduler programs. Each of scheduler program run the same procedure but with different arguments.
There is a dbms_lock.sleep(N);
in a procedure.
I've noticed that when 1 scheduler jobs is going to sleep - another one sleeps too. Until first one wakes up.
In the scheduler logs I've found, that both scheduler jons have different session id
, but the same Slave PID
.
Can this be an issue? If so - how to run the jobs with different slave pids?
UPD:
Updated MAX_JOB_SLAVE_PROCESSES
to 20
. Now slave pids are diff开发者_如何学编程erent, but dehaviour have not changed.
If you are on a *nix platform, the PID points towards the shadow *nix process that is executing the code in question. Generally with dedicated servers, each session will have its own shadow process. In shared server you'd have a pool of *nix processes and the sessions pick an available one from the pool. If none are available, and the maximum number of shared server processes have already been started, then the session waits.
A similar situation applies for DBMS_JOB, with the maximum set by JOB_QUEUE_PROCESSES, and DBMS_SCHEDULER (MAX_JOB_SLAVE_PROCESSES). It may choose to start less.
Note: While it is executing DBMS_LOCK.SLEEP, it is still in a code path and still 'running'. Just not doing anything useful.
PS. Not sure how PID works on Windows, which operates as threads within a single process rather than as multiple distinct processes.
精彩评论