Oracle7 Server Distributed Systems Volume II: Replicated Data

Contents Index Home Previous Next

How Jobs Execute

SNP background processes execute jobs. To execute a job, the process creates a session to run the job.

When an SNP process runs a job, the job is run

When you force a job to run using the procedure DBMS_JOB.RUN, the job is run by your user process. When your user process runs a job, it is run with your directly granted privileges only. Privileges granted to you through roles are unavailable.

Job Queue Locks

Oracle uses job queue locks to ensure that a job is executed by only one session at a time. When a job is being run, its session acquires a job queue (JQ) lock for that job.

For more information about locking, see .

Interpreting Information about JQ Locks

The following query lists the session identifier, lock type, and lock identifiers for all sessions holding JQ locks:

SVRMGR> SELECT sid, type, id1, id2
     2>     FROM v$lock
     3>     WHERE type = 'JQ';
SID        TY ID1        ID2
---------- -- ---------- ----------
        12 JQ          0      14144
1 row selected.

In the query above, the identifier for the session holding the lock is 12. The ID1 lock identifier is always 0 for JQ locks. The ID2 lock identifier is the job number of the job the session is running.

For more information about the locking views, see the Oracle7 Server Reference.

Database Links and Jobs

If the job that you submit uses a database link, the link must include a username and password. Anonymous database links will not succeed.


Contents Index Home Previous Next