Home > Database > Mysql Tutorial > 【翻译自mos文章】怎么样kill一个被挂起的自动物化视图刷新job?

【翻译自mos文章】怎么样kill一个被挂起的自动物化视图刷新job?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:58:27
Original
1212 people have browsed it

怎么样kill 一个被挂起的自动物化视图刷新job? 参考原文:How to kill a hung automated materialized view refresh job (文档 ID 341842.1) 适用于: Oracle Server - Enterprise Edition - Version 8.1.5.0 to 10.2.0.5 [Release 8.1.5 to 10.2] Informati

怎么样kill 一个被挂起的自动物化视图刷新job?

参考原文:How to kill a hung automated materialized view refresh job (文档 ID 341842.1)

适用于:

Oracle Server - Enterprise Edition - Version 8.1.5.0 to 10.2.0.5 [Release 8.1.5 to 10.2]
Information in this document applies to any platform.

目标:

本文提供一个kill 被挂起的自动物化视图刷新job 的方法。
本文也可以用于被database job scheduler 发起的任何一个被挂起的job。

解决方案:

1. 查询dba_jobs_running视图,得到 被挂起的job对应的sid和job number ,
SQL> - set optimizer mode to RULE to workaround Bug: 3402490 (not necessary for 10.2)
SQL> alter session set optimizer_mode=RULE; --->本命令在db版本 SQL> select * from dba_jobs_running;

--->注意 Bug: 3402490的描述是:QUERY TO DBA_JOBS_RUNNING TAKES LONG TIME
我遇到的一个案例,9201的环境中,查询DBA_JOBS_RUNNING需要40秒 或者需要1分钟,查询结果能出来,但是是0行。

2. break 掉job,以便另一个job queue slave process 不会尝试继续运行被挂起的job
SQL> exec dbms_job.broken (, TRUE);

3.确认被挂起job对应的os pid
SQL> select a.spid, b.sid, b.username
from v$process a, v$session b
where a.addr = b.paddr and sid = ;

4.确认上一步查询出的os pid 是 j process (9.0.1 and above) or snp process (8.1.7 and below):

For Unix and Linux:

$ ps -ef | grep

For Windows:

SQL> select vb.name NOME, vp.program PROCESSNAME,
vp.spid THREADID, vs.sid SID
from v$session vs, v$process vp, v$bgprocess vb
where vb.paddr '00' and
vb.paddr = vp.addr and
vp.addr = vs.paddr;

5. kill 第三步查询出来的os 进程(请小心操作,以防kill掉了其他的进程导致database crash)

For Unix and Linux:

$ kill -9

For Windows:
Use of the orakill utility will be necessary.
See Note: 316652.1 for an example of this.

6.解决job导致挂起的原因,必要时提交sr

7. 运行并 unbreak job

SQL> exec dbms_job.run(job);

该命令既run 该job,也unbreak 该job
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template