rac中的job
来源:互联网 发布:全球云计算市场 编辑:程序博客网 时间:2024/04/27 17:53
time:2011/08/19
rac中的job
一个JOB在何级别运行是可以定制的。
对于集群数据库,如果把job定义在db级,job可以运行在任何活动的instance上,并遵循job的调度机制,
JOB的调度通过JOB协调进程来完成的,通过JQ队列锁来避免竞争和重复执行,每个JOB分配一个唯一的JQ锁;
如果把job定义在instance级别上,job将运行在指定的实例上,如因某种异常导致创建job的实例当机,那
job将运行在存活的实例上。
参考Oracle文档:
you can create a job at the cluster database level and the job will run on any active instance of the target Oracle RAC database. Or you can create a job at the instance level and the job will only run on the specific instance for which you created it. In the event of a failure, recurring jobs can run on a surviving instance.
Oracle文档说:
Each RAC instance has its own job coordinator. The database monitoring checks that determine whether or not to start the job coordinator do take the service affinity of jobs into account. For example, if there is only one job scheduled in the near future and the job class to which this job belongs has service affinity for only two out of the four RAC instances, only the job coordinators for those two instances will be started.
例子:
rac创建job(job默认是创建在‘0’实例上)
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
(
job => X
,what => 'declare
v_a nvarchar2(10);
begin
select '' a'' into v_a from dual;
end;'
,next_date => to_date('08/19/2011 11:26:43','mm/dd/yyyy hh24:mi:ss')
,interval => 'SYSDATE+30/1440 '
,no_parse => FALSE
);
:JobNumber := to_char(X);
END;
在指定实例上创建job
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
(
job => X
,what => 'declare
v_a nvarchar2(10);
begin
select '' a'' into v_a from dual;
end;'
,next_date => to_date('08/19/2011 11:26:43','mm/dd/yyyy hh24:mi:ss')
,interval => 'SYSDATE+30/1440 '
,no_parse => FALSE
,instance => 1
,force => TRUE
);
:JobNumber := to_char(X);
END;
现在查看下现有的job运行在哪个实例上
SQL> select job,instance,what from dba_jobs j where J.JOB in (41,42);
JOB INSTANCE WHAT
---------- ---------- --------------------------------------------------------------------------------
41 0 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
42 1 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
SQL>
SQL>
把job 41 更改到实例1上
SQL> exec dbms_job.instance(41,1);
PL/SQL procedure successfully completed
SQL> select job,instance,what from dba_jobs j where J.JOB in (41,42);
JOB INSTANCE WHAT
---------- ---------- --------------------------------------------------------------------------------
41 1 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
42 1 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
把job 42 更改到实例2上
SQL> exec dbms_job.instance(42,2);
PL/SQL procedure successfully completed
SQL> select job,instance,what from dba_jobs j where J.JOB in (41,42);
JOB INSTANCE WHAT
---------- ---------- --------------------------------------------------------------------------------
41 1 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
42 2 declare
v_a nvarchar2(10);
begin
select ' a' into v_a from dual;
end;
SQL>
--------------------end-----------------------
- rac中的job
- 关于RAC中的JOB运行在哪个实例的理解
- 关于Oracle RAC中的JOB运行在哪个实例的理解
- RAC中指定job运行实例
- Oracle中的Job简介
- 关于数据库中的Job
- Oracle中的job
- ORACLE 中的 JOB
- Bash中的job管理
- shell 中的job管理
- 关于Oracle中的job
- RAC中的等待事件
- RAC中的四种锁
- RAC中的过滤方法
- 让job在指定oracle rac 节点上执行
- 如何定时Oracle中的Job
- gearmand 中的job持久化
- Quartz中的Job和StatefulJob
- 一个比较不错的iOS开源库
- 哈佛学生是如何度过大学4年的
- GOOGLE搜索技巧
- iPhone OS 开发-了解并解决代码签名问题
- CTreeCtrl点击改变Check状态
- rac中的job
- 总结关于iPhone中UIWEBVIEW读取本地GBK编码格式html
- 关于使用Activex控件时,不能使用退格键的解决方法。
- RFC3920中文
- bbs上的资料(修改Oracle10g密码)
- jQuery-wDragSort 拖曳排序
- 系统参数配置的存储管理与应用的通用方法
- RFC3921中文
- 指针与指针变量的区别