Check DB2 Locked Tables: SQL Query Guide

To check if a table is locked in the DB2 database, you can run the following SQL query:

SELECT TABSCHEMA, TABNAME, LOCKNAME, LOCKS, LOCKING_MODE
FROM SYSIBMADM.LOCKS
WHERE LOCKNAME IS NOT NULL;

This SQL statement will retrieve information about all locked tables, including their schema, name, lock name, lock count, and lock mode. If there are records in the returned result, it indicates that there are locked tables in the database.

bannerAds