DB2LOCKS SAP (Locked DB2-Resources and their Holders and Waiters) Structure details

Dictionary Type: Structure
Description: Locked DB2-Resources and their Holders and Waiters




ABAP Code to SELECT data from DB2LOCKS
Related tables to DB2LOCKS
Access table DB2LOCKS




Structure field list including key, data, relationships and ABAP select examples

DB2LOCKS is a standard SAP Structure so does not store data like a database table does. It can be used to define the fields of other actual tables or to process "Locked DB2-Resources and their Holders and Waiters" Information within sap ABAP programs.

This is done by declaring abap internal tables, work areas or database tables based on this Structure. These can then be used to store and process the required data appropriately.

i.e. DATA: wa_DB2LOCKS TYPE DB2LOCKS.

The DB2LOCKS table consists of various fields, each holding specific information or linking keys about Locked DB2-Resources and their Holders and Waiters data available in SAP. These include LOCKID (Small integer (2 bytes)), LOCKMOD_DB (The mode of the lock held on the resource), RESTYPE (The type of resource held by a lock), DBOWNER (The name of the DB2 database).. See below for full list along with technical details, documentation, text table, check tables, foreign key relationships, conversion routines, relevant tcodes and example ABAP select code etc. .

Delivery Class:
Display/Maintenance via tcode SM30: Display/Maintenance Allowed but with Restrictions
SAP enhancement categories: Can Be Enhanced (Deep)


SAP DB2LOCKS structure fields - Full list of fields found in SAP data dictionary

Field Description Data Element Data Type length (Dec) Check table Conversion Routine Domain Name MemoryID SHLP
USERIDDB2/OS390: Unique counter DB2SUCNTINT25INT2
LOCKIDSmall integer (2 bytes) DB2SINTINT25DB2INT2V
LOCKMOD_DBThe mode of the lock held on the resource DB2LOCKMODCHAR6DB2CHAR06
RESTYPEThe type of resource held by a lock DB2RESTYPECHAR20CHAR20
DBOWNERThe name of the DB2 database DB2DBOWNERCHAR16DB2CHAR16
PAGESETObject name DB2PAGESETCHAR22DB2CHAR22
DURATIONLock duration of the thread holding the resource DB2LOCKDURCHAR12CHAR12
LOCKTYPEState of lock DB2LOCKTYPCHAR10CHAR10
LOCKATRILock attribute (logical lock or physical lock) DB2LOCKATTCHAR6CHAR6
HOLD_WAITDetectionflag for Holders(H) or Waiters(W) for DB2Resources DB2_HOLD_WAITCHAR1CHAR1
HDSUBSYSIDDB2 subsystem ID DB2SWPSSIDCHAR4DB2CHAR04
HDATDATDate when sampling is taken DB2SWPATDTDATS8DB2DATE
HDATTIMTime when sampling is taken DB2SWPATTMTIMS6DB2TIME
HDLRESTIMETime of last reset DB2SWPLRTMTIMS6DB2TIME
ACEField type raw, length 8, 4 bytes DB2RAW04INT410DB2INT4
JOBNAMEThe job name of the thread. DB2THDJOBCHAR8DB2CHAR8
DBPLANDB2 plan name DB2WHCPLANCHAR128CHAR128
AUTHIDThe authorization ID under which the transaction is running DB2WHCAIDCHAR128CHAR128
CORRIDThe correlation ID of the thread (IP address) DB2WHCCVCHAR16DB2CHAR16
CONNIDThe connection ID of the thread DB2WHCCNCHAR8DB2CHAR08
THDSTATThe status of the thread DB2W0148AICHAR16DB2CHAR16
FILLERField type char, length 8 DB2CHAR08CHAR8DB2CHAR08
SQLCNTThe total number of executed SQL statements DB2THDSQLINT410DB2INT4
DBCOMMITThe number of successful phase 2 or single-phase commits DB2WACCOMMINT410DB2INT4
ABORTTotal number of rollback requests DB2WACABRTINT410DB2INT4
GETPAGENumber of Getpage Requests DB2BACGETINT410DB2INT4U
UPDPAGEThe number of times a buffer update occurs for the agent DB2BACSWSINT410DB2INT4U
LOCKSThe total number of currently hold locks. DB2THDLOCKINT410DB2INT4
CPUTIMEThe accumulated home CPU time a thread spent in DB2 DB2WACAJSTINT410DB2INT4
ELTIMETime elapsed since DB2 thread was started DB2THDELTINT410DB2INT4
LOCKMODThe mode of the lock held on the resource DB2LOCKMODCHAR6DB2CHAR06
ACTTIMEActivity time (Class 1 elapsed time) DB2THDTACTCHAR16DB2CHAR16
TIMEINDB2Percentage of time spent in DB2 DB2INDB2CHAR8DB2TIMEP
PROCINDB2Percentage of time spent processing in DB2 DB2PROCDB2CHAR8DB2TIMEP
WPTYPEprocess type DB2PROCTYPCHAR11
WPNUMBERprocess ID DB2PROCIDNUMC19
WPIDWork process ID DB2WPIDNUMC10DB2NUMC10
ASHOSTApplication server host name DB2ASHOSTCHAR32DB2CHAR32
THDREQNumber of Requests Sent to DB2 DB2W0148RCINT410DB2INT4
ADTHRSTAStatus of the thread DB2DTHRSTACHAR22DB2CHAR22
PRCINDB2Thread activity: % processing in DB2 DB2PRCINCHAR10DB2CHAR10
SSPINDB2Prozent der Zeit für die DB2-Verarbeitung (CPU-Zeit) DB2SSPINCHAR10DB2CHAR10
DS_MEMBER Data sharing member to which the thread belongs to0
THDMLOCKS Maximum locks held0
CONNNAME Database connection name0
QMDAPLAT Client platform from DB2's perspective0
QWHDRQNM Client IP address from DB2's perspective0
SAPSID SAP system ID (SAPSID)0
SAPSYS SAP system number (SAPSYSTEM)0
ABAPREPABAP Program: Current Main Program SYREPIDCHAR40Assigned to domainPROGRAMM
TXCODEtransaction / thread name DB2TXNAMECHAR80
ENDUSER SAP end-user ID0
J2EESERV J2EE service type0
QWACPARR Accounting records represents accounting rollup bucket0
QW0148CI DB2 collection ID0
QW0148STIndicates the status of the conversation or socket DB2W0148STCHAR2
NQW1503HNatural Number INT4INT410INT4
NQW1503WNatural Number INT4INT410INT4

Key field Non-key field



How do I retrieve data from SAP structure DB2LOCKS using ABAP code?

As DB2LOCKS is a database structure and not a table it does not store any data in the SAP data dictionary. The ABAP SELECT statement is therefore not appropriate and can not be performed on DB2LOCKS as there is no data to select.

How to access SAP table DB2LOCKS

Within an ECC or HANA version of SAP you can also view further information about DB2LOCKS and the data within it using relevant transactions such as

SE11 (ABAP Dictionary Maintenance)
SM30 (Maintain Table Data)
SE80 (Object Navigator)
SE16 (Data Browser).


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!