Published by : Obay Salah , November 19, 2024

This entity is used to associate one or more Jobs with a specific Resource Manager Consumer Group. We can create a Job Class using the CREATE_JOB_CLASS procedure found in the DBMS_SCHEDULER package.

Where JOB_CLASS_NAME is the name of the Class, and Resource_Consumer_Group is used to specify the Consumer Group that will use its resources to execute the Job.

As for the Service, it is used only in a RAC database to control the execution of the Job on a specific Instance.

begin

dbms_scheduler.create_job_class(

job_class_name=>'class_account',

resource_consumer_group=>'sys_group');

end;


Note that all procedures that create a Job (CREATE_JOB) include a variable called JOB_CLASS, which is used to specify the Class that will determine the allocation of the Consumer Group.

You can inquire about the Job Classes in the database using the DBA_SCHEDULER_JOB_CLASSES query.

We can also delete the Job Class from the database using the DROP_JOB_CLASS procedure.

begin

dbms_scheduler.drop_job_class(

job_class_name=>'class_account',

force=>true);

end; 


Sometimes, we create the Job first before the Job Class, and we want to associate this Job to work with that Job Class.

In such cases, we use the SET_ATTRIBUTE procedure.

begin

dbms_scheduler.set_attribute(

name=>'new_job',

attribute=>'job_class',

value=>'class_account');

end; 


Tags : Database

You May Also Like

Comments

no comment yet!