杀死 Oracle 的工作。 10克具体
我们使用在 DBMS_JOB 之上运行的作业调度系统。它使用主作业来创建一次性作业。我们向所有客户端部署相同的作业集,但可以指定哪些作业仅应在某些客户端上运行。
我们偶尔会遇到因作业挂起而运行的进程的问题。造成这种情况的主要原因是 UTL_TCP 在收到预期响应时没有超时。我希望能够终止这些工作,以便它们能够再次运行。
我正在考虑创建一项新作业,以杀死所有运行时间超过一定时间的一次性作业。
我们已经使用 Oracle 10g 有一段时间了,所以我的能力仅限于它的功能。
有一篇文章似乎涵盖了大部分内容,位于
http://it.toolbox.com/blogs/database-solutions/killing-the-oracle -dbms_job-6498
我有一种感觉,这并不能涵盖所有可能发生的情况,包括:
- 我们以多个不同的用户身份运行作业,并且用户只能中断/删除他们创建的作业。我相信我可以使用 DBMS_IJOB 来解决这个问题,但我需要让 DBA 让我执行它。
- 我们有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:
- 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.
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以从作业表中获取 PID,并通过正常的操作系统命令杀死卡住的进程。
您可以终止任何实例上的作业。在 10g 上,您需要知道卡住的作业正在哪个实例上运行,并连接到该实例:
要获取您的实例和 pid:
连接到特定实例:
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:
Connect to a specific instance:
有更多方法可以终止 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.