Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

IBM i Services Directory : QSYS2.Object_Lock_Info ビュー

Last updated at Posted at 2025-11-28

SYSBAS 内の区画上にあるすべてのオブジェクトおよび現行スレッドの ASP グループ内にあるすべてのオブジェクトで保留されている各ロックについて 1 行を返します。

概要

■ビュー名:QSYS2.OBJECT_LOCK_INFO
■カテゴリ:実行管理サービス
■サポート:IBM i 7.3 Base
■参照URL(IBM i 7.6):https://www.ibm.com/docs/ja/i/7.6.0?topic=services-object-lock-info-view

使用例

ライブラリー(スキーマ)GOMALIBの物理ファイル(テーブル)TOKMSPをロックしているジョブのリストを返す

SELECT * FROM QSYS2.OBJECT_LOCK_INFO
   WHERE SYSTEM_OBJECT_SCHEMA = 'GOMALIB' AND
         OBJECT_NAME = 'TOKMSP'  AND OBJECT_TYPE='*FILE';

※上記ではOBJECT_TYPE を指定していますが、省略してもOKです。

今回はDFUのオプション5から該当ファイルを更新モードでロックした状態で実行しました。
image.png

実行結果例は、、
image.png
image.png
image.png

上記のように ロックの状態(*SHRRD , *SHRUPD、など)、ロックしているジョブのジョブ名、ロックカウント数、ロックしているプログラム名とそのモジュール名など明細が表示されます。詳細な分析には役立つと思います。

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?