Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Lock entries standard table

Former Member
0 Kudos
1,567

Hi Experts,

Please help in finding which SAP Standard table can we find the lock entries(SM12 transaction).

Thanks!

2 REPLIES 2

Former Member
0 Kudos
366

try debugging tcode SM12 or running a SQL trace on it - you will find the answer.

Former Member
0 Kudos
366

Prerequisites

You have generated the demo data for the SQL Tutorial.

Log on to the database instance DEMODB as user MONA.

Examples

You can use the system table LOCKS to determine the following database information, among other things:

● All locks that are currently held on table ROOM

SELECT lockmode, lockstate, rowidlength, rowidhex, rowid

FROM DOMAIN.LOCKS

WHERE tablename = 'ROOM'

● All locks that the current user holds in that database session on table ROOM

SELECT lockmode, lockstate, rowidlength, rowidhex, rowid

FROM DOMAIN.LOCKS, SYSINFO.SESSIONS

WHERE tablename = 'ROOM'

AND locks.session = sessions.sessionid

● All locks that are currently held on the table with the hexadecimal internal identification 000000000000035D

SELECT lockmode, lockstate, rowidlength, rowidhex, rowid

FROM DOMAIN.LOCKS

WHERE tableid = X'000000000000035D'

If the current user is the database administrator (DBA user) or the database system administrator (SYSDBA user), then all currently held locks are shown.

Users that belong to other user classes only see the locks held by that one user.

Definition

The system table LOCKS describes the current lock entries and entries for lock requests.

Structure

LOCKS

SESSION

FIXED(10)

ID of the database session

TRANSCOUNT

CHAR(20)

Transaction identification in the database session

PROCESS

FIXED(10)

Process identification in the database instance

USERNAME

CHAR(32)

Name of the user

DATE

DATE(10)

Creation date of the lock

TIME

TIME(8)

Creation time of the lock

TERMID

CHAR(18)

User terminal identification

LASTWRITE

CHAR(10)

Elapsed time since the last SQL statement for data manipulation

LOCKMODE

CHAR(14)

Type of lock (NULL value | SHARE | EXCLUSIVE)

LOCKSTATE

CHAR(10)

Status of lock

APPLPROCESS

FIXED(10)

Process identification on the client hardware

APPLNODE

CHAR(64)

Client hardware identification

SCHEMANAME

CHAR(32)

Name of the schema of the table

OWNER

CHAR(32)

Name of the owner of the table

TABLENAME

CHAR(32)

Name of the table

TABLEID

CHAR(8) BYTE

ID of the table

ROWIDLENGTH

FIXED(4)

Length of the key of the locked row

ROWIDHEX

CHAR(64) BYTE

Start of the key of the locked row in hexadecimal notation

ROWID

CHAR(128)

Start of the key of the locked row

http://dev.mysql.com/doc/maxdb/en/c4/812640632cec01e10000000a155106/content.htm