杀死 Oracle 的工作。 10克具体

发布于 2024-08-06 14:42:40 字数 808 浏览 4 评论 0原文

我们使用在 DBMS_JOB 之上运行的作业调度系统。它使用主作业来创建一次性作业。我们向所有客户端部署相同的作业集,但可以指定哪些作业仅应在某些客户端上运行。

我们偶尔会遇到因作业挂起而运行的进程的问题。造成这种情况的主要原因是 UTL_TCP 在收到预期响应时没有超时。我希望能够终止这些工作,以便它们能够再次运行。

我正在考虑创建一项新作业,以杀死所有运行时间超过一定时间的一次性作业。

我们已经使用 Oracle 10g 有一段时间了,所以我的能力仅限于它的功能。

有一篇文章似乎涵盖了大部分内容,位于

http://it.toolbox.com/blogs/database-solutions/killing-the-oracle -dbms_job-6498

我有一种感觉,这并不能涵盖所有可能发生的情况,包括:

  1. 我们以多个不同的用户身份运行作业,并且用户只能中断/删除他们创建的作业。我相信我可以使用 DBMS_IJOB 来解决这个问题,但我需要让 DBA 让我执行它。
  2. 我们有Oracle RAC系统。我了解 10g 限制 ALTER SYSTEM KILL SESSION 来终止当前实例上的会话。我可以安排所有作业在同一个实例上运行,但我还没有尝试过。

我还应该考虑什么吗? Stack Overflow 需要对此给出明确的答案。

We're using a job scheduling system that runs on top of DBMS_JOB. It uses a master job to create one-time jobs. We deploy the same set of jobs to all our clients, but can specify which jobs should only run at certain clients.

We get occasional problems with a process run by a job hanging. The main cause of this is UTL_TCP not timing out when it does get an expected response. I want to be able to kill those jobs so that they can run again.

I'm looking at creating a new job that kill any of these one-time jobs that have been running for longer than a certain time.

We're stuck with Oracle 10g for a while yet, so I'm limited to what that can do.

There's an article that seems to cover most of this at

http://it.toolbox.com/blogs/database-solutions/killing-the-oracle-dbms_job-6498

I have a feeling that this is not going to cover all eventualities, including:

  1. We run can jobs as several different users and a user can only break/remove jobs they created. I believe that I may be able to use DBMS_IJOB to get around that, but I need to get the DBA to let me execute it.
  2. We have Oracle RAC systems. I understand 10g limits ALTER SYSTEM KILL SESSION to killing sessions on the current instance. I could arrange for all jobs to run on the same instance, but I've not tried that yet.

Anything else I should consider? Stack Overflow needs a definitive answer on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彡翼 2024-08-13 14:42:40
  • 您可以从作业表中获取 PID,并通过正常的操作系统命令杀死卡住的进程。

  • 您可以终止任何实例上的作业。在 10g 上,您需要知道卡住的作业正在哪个实例上运行,并连接到该实例:

要获取您的实例和 pid:

select inst_id, process from gv$session where ...

连接到特定实例:

sqplus admin@node3 as sysdba
alter system kill session ...
  • You can get the PID from the job tables and kill the stuck process via the normal OS commands.

  • You can kill jobs on any instance. On 10g, you need to know on which instance the stuck job is running, and connect to that instance:

To get your instance and pid:

select inst_id, process from gv$session where ...

Connect to a specific instance:

sqplus admin@node3 as sysdba
alter system kill session ...
吖咩 2024-08-13 14:42:40

有更多方法可以终止 Oracle 上的会话。取决于您的平台。在 UNIX 会话上运行(后台作业也是如此)由进程表示。杀死进程,就杀死会话。在 Windows 上,会话由线程表示。使用 orakill 终止线程,终止会话。进程(或线程)id 存储在 gv$process 中。

There are more ways to kill a session on oracle. Depends on your plattform. Running on unix sessions (background jobs too) are represented by processes. Killing the process, kills the session. On windows sessions are represented by a thread. Killing the thread using orakill, kills the session. The process (or thread) id is stored in gv$process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文