SQL 如何在 DB2 中终止进程/查询

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9681668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 14:49:30  来源:igfitidea点击:

How to kill a process/query in DB2

sqldb2kill-process

提问by Kayser

I try to optimize a query. After every change, I must wait long time that the query is finished. It is really time consuming.

Is there any way to see the executed queries and kill/stop them??

我尝试优化查询。每次更改后,我必须等待很长时间才能完成查询。这真的很费时间。

有没有办法查看执行的查询并杀死/停止它们?

采纳答案by bhamby

In the DB2 instance command line, you can type

在 DB2 实例命令行中,您可以键入

db2 list applications show detail

In this list, you should find your process, note the application id. You can use this command to kill it:

在此列表中,您应该找到您的进程,记下应用程序 ID。您可以使用此命令将其杀死:

db2 force application (xx)

Where xxis the ID (or a comma-delimited list of IDs).

xxID(或以逗号分隔的 ID 列表)在哪里。

Hereis the DB2 for Linux/Unix/Windows v9.7 Information Center article on FORCE APPLICATION, and hereis the one for LIST APPLICATIONS. For both of these commands, you have to have the proper privileges on the database instance (most commonly SYSADMor SYSCTRL).

这里是 DB2 for Linux/Unix/Windows v9.7 Information Center 文章FORCE APPLICATION这里LIST APPLICATIONS. 对于这两个命令,您必须对数据库实例具有适当的权限(最常见的是SYSADMSYSCTRL)。