暂无图片
分享
luz
2019-05-22
请教下 rac 中的job 运行分配机制

请教下 rac 中的job 没指定 instance,这个job 的runing 是什么机制?就是这个job 会在哪个实例上runing?根据负载均衡来的还是根据什么算法分配到哪个实例运行。谢谢

收藏
分享
2条回答
默认
最新
章芋文

有两个参数可以控制INSTANCE_ID和INSTANCE_STICKINESS,对应的默认值分别为空和TRUE,也就是如果不设置遵循负载均衡的算法分配到负载轻的实例上。

可以通过如下命令设置JOB在哪个节点运行:

exec dbms_scheduler.set_attribute(name => 'USER.JOB_1' ,attribute=>'INSTANCE_ID', value=>'1');
exec dbms_scheduler.set_attribute(name => 'USER.JOB_1' ,attribute=>'INSTANCE_STICKINESS', value=>FALSE);

select OWNER,JOB_NAME,INSTANCE_STICKINESS,INSTANCE_ID from dba_scheduler_jobs where JOB_NAME like '%JOB%';

参考

INSTANCE_ID:

Valid only in an Oracle Real Application Clusters environment. Indicates the instance on which the job is to be run.

INSTANCE_STICKINESS:

This attribute should only be used for a database running in an Oracle Real Application Clusters (RAC) environment. By default, it is set to TRUE. If you set instance_stickiness to TRUE, jobs start running on the instance with the lightest load and the Scheduler thereafter attempts to run on the instance that it last ran on. If that instance is either down or so overloaded that it will not start new jobs for a significant period of time, another instance will run the job. If the interval between runs is large, instance_stickiness will be ignored an the job will be handled as if it were a non-sticky job.

If instance_stickiness is set to FALSE, each instance of the job runs on the first instance available.

For non-RAC environments, this attribute is not useful because there is only one instance.

暂无图片 评论
暂无图片 有用 0
luz
问题已关闭: 问题已经得到解决,谢谢
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏