Run as SYS
when the job runs from a different node than where the service connection is running on a RAC node. It may give cluster waits and increase the time the job takes to finish. To reduce the time the job takes to finish you can set the job to run from where the service is running on the cluster, it reduces cluster waits which means sending data across the different nodes in RAC.
So for performance tuning of cluster waits event or to reduce the time the job takes this is an ideal way.
Below three steps is how you set a dbms scheduler job from a node where the RAC service is running from. 1.This will create a job class other than default class:
exec dbms_scheduler.CREATE_JOB_CLASS('SCOTT_JOBS',service=>'service_name',COMMENTS=>'Class for jobs using service service_name');
2.This will grant scott to be able to execute the job class:
grant execute on sys.SCOTT_JOBS to SCOTT;
3.This will force the job class to be able to run from where the service is running:
exec DBMS_SCHEDULER.SET_ATTRIBUTE( NAME => 'SCOTT.SCOTT_MAIN_JOB', ATTRIBUTE => 'job_class', VALUE => 'SCOTT_JOBS');
Next time the SCOTT job named as SCOTT_MAIN_JOB will run from the node where the service_name was running at.
This will reduce the time the job takes to finish since the cluster waits will be minimal.
So for performance tuning of cluster waits event or to reduce the time the job takes this is an ideal way.
No comments:
Post a Comment