SQL Teradata 锁 - 如何知道表是否已锁定?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1089191/
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 02:41:55  来源:igfitidea点击:

Teradata locks - How to know if a table is locked?

sqllockingteradata

提问by AFHood

Is there a way to know if a table is locked and what kind of lock is currently on a table? I was hoping for something through the DBC tables in teradata, but I can't find any reference to anything like this. I have normal user access and the DBA is no help. Thanks.

有没有办法知道一个表是否被锁定以及当前表上的锁是什么类型的?我希望通过 teradata 中的 DBC 表找到一些东西,但我找不到任何对此类内容的引用。我有普通用户访问权限,而 DBA 没有帮助。谢谢。

采纳答案by mechanical_meat

AFAIK only DBA utilities are available to determine the type of lock on a table.

AFAIK 只有 DBA 实用程序可用于确定表上的锁类型。

With only user-level rights you can do something like the following (from here):

仅使用用户级权限,您就可以执行以下操作(来自此处):

Lock Table dbName.myTable for Access nowait
Select * from dbName.myTable;

And according to the master himself (Geoffrey Rommel):

根据大师本人(杰弗里·隆美尔)的说法:

If the table is locked, you will get error 7423, "Object already locked and NOWAIT. Transaction Aborted."

如果表被锁定,您将收到错误 7423,“对象已被锁定,NOWAIT。事务中止。”