添加了JOB运行的实例ID,RAC环境无需登陆多个节点查询 select v.inst_id,v.SID, v.id2 JOB, j.FAILURES, LAST_DATE, substr(to_char(last_date,'HH24:MI:SS'),1,8) LAST_SEC, THIS_DATE, substr(to_char(this_date,'HH24:MI:SS'),1,8) THIS_SEC, j.field1 INSTANCE from sys.job$ j, gv$lock v where v.type = 'JQ' and j.job (+)= v.id2; 添加了SESSION,SERIAL#信息,kill session更加快速 select v.inst_id,v.SID,s.serial#,v.id2 JOB, j.FAILURES, LAST_DATE, substr(to_char(last_date,'HH24:MI:SS'),1,8) LAST_SEC, THIS_DATE, substr(to_char(this_date,'HH24:MI:SS'),1,8) THIS_SEC, j.field1 INSTANCE from sys.job$ j, gv$lock v,gv$session s where v.type = 'JQ' and j.job (+)= v.id2 and v.inst_id=s.inst_id and v.sid=s.sid;--建议测试后谨慎操作 select 'alter system kill session '''||v.SID||','||s.serial#||',@'||v.inst_id||''' immediate; ' from sys.job$ j, gv$lock v,gv$session s where v.type = 'JQ' and j.job (+)= v.id2 and v.inst_id=s.inst_id and v.sid=s.sid and v.id2=&job_id; 添加了JOB运行的实例ID,RAC环境无需登陆多个节点查询 select v.SID, v.id2 JOB, j.FAILURES, LAST_DATE, substr(to_char(last_date, 'HH24:MI:SS'), 1, 8) LAST_SEC, THIS_DATE, substr(to_char(this_date, 'HH24:MI:SS'), 1, 8) THIS_SEC, v.INST_ID instance from sys.job$ j, gv$lock v where v.type = 'JQ' and j.job(+) = v.id2; create or replace view dba_jobs_running_rac as select v.SID, v.id2 JOB, j.FAILURES, LAST_DATE, substr(to_char(last_date, 'HH24:MI:SS'), 1, 8) LAST_SEC, THIS_DATE, substr(to_char(this_date, 'HH24:MI:SS'), 1, 8) THIS_SEC, v.INST_ID instance from sys.job$ j, gv$lock v where v.type = 'JQ' and j.job(+) = v.id2; select * from dba_jobs_running_rac;
标签:RAC,id2,JOB,查询,char,substr,job,DATE,id From: https://www.cnblogs.com/ataoxz/p/18629189