4 Replies Latest reply: Aug 3, 2012 1:37 AM by Mustafa KALAYCI RSS

    How to enforce JOB_CLASS while DBMS_SCHEDULER.CREATE_JOB ?

    J-Oracle
      All,

      Env: 11gR2 on Linux

      All my users/(schemas) can schedule jobs using DBMS_SCHEDULER.

      I have a resource_cosumer_group called SCHEDULER_GROUP (->SCHEDULER_CLASS)

      How do i "enforce" them to use a particular JOB_CLASS in the dbms_scheduler.create_job ?

      ie: SCHEDULER_CLASS

      If left blank, the default is DEFAULT_JOB_CLASS and i do not want to set limits on this as this is being used by SYS jobs too.


      TIA,
      JJ
        • 1. Re: How to enforce JOB_CLASS while DBMS_SCHEDULER.CREATE_JOB ?
          Mustafa KALAYCI
          as I know, you can not, you must declare your job class in DBMS_SCHEDULER.CREATE_JOB procedures job_class parameter. it's definition:
          PROCEDURE create_job(
            job_name                IN VARCHAR2,
            job_type                 IN VARCHAR2,
            job_action              IN VARCHAR2,
            number_of_arguments     IN PLS_INTEGER              DEFAULT 0,
            start_date              IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
            repeat_interval         IN VARCHAR2                 DEFAULT NULL,
            end_date                IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
            job_class               IN VARCHAR2              DEFAULT 'DEFAULT_JOB_CLASS', -- HERE IT IS
          if user does not provide a job_class oracle will use DEFAULT_JOB_CLASS. all of overloaded version of create_job has same thing.

          Edited by: Mustafa KALAYCI on Aug 2, 2012 10:40 PM
          • 2. Re: How to enforce JOB_CLASS while DBMS_SCHEDULER.CREATE_JOB ?
            Karan
            BEGIN
            DBMS_SCHEDULER.CREATE_JOB (
            job_name => 'update_sales',
            job_type => 'STORED_PROCEDURE',
            job_action => 'OPS.SALES_PKG.UPDATE_SALES_SUMMARY',
            start_date => '28-APR-08 07.00.00 PM Australia/Sydney',
            repeat_interval => 'FREQ=DAILY;INTERVAL=2', /* every other day */
            end_date => '20-NOV-08 07.00.00 PM Australia/Sydney',
            job_class => 'batch_update_jobs',
            comments => 'My new job');
            END;
            /

            if you want to alter it see http://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse002.htm#i1015297
            Regards
            Karan
            • 3. Re: How to enforce JOB_CLASS while DBMS_SCHEDULER.CREATE_JOB ?
              J-Oracle
              All,

              So, it is not possible to change the DEFAULT job_class ehh ?

              TIA,
              JJ
              • 4. Re: How to enforce JOB_CLASS while DBMS_SCHEDULER.CREATE_JOB ?
                Mustafa KALAYCI
                no it is not, you can edit "default_job_class" if you want