Skip to Content

How to identify a blocked row using Record ID in SAP HANA

Dec 09, 2016 at 09:06 AM


avatar image

Hi everyone!

I need to analyze record locks in SAP HANA via ST04 or view M_RECORD_LOCKS.

In the view output I can see Record ID entries like this:

If I understand the output correctly – it shows which records in which table are locked at the moment. And ‘Record ID’ field is a kind of a pointer to the particular blocked row in the table.

My question is, how can I interpret combination of SID, OFFSET and sometimes PARTID to address the exact row in the table?

Can I use special SQL command with this parameters (maybe somewhat converted ) to return the row number or row itself?

Many thanks in advance!

Best regards,

Pavel Simonovich

lock-list.jpg (187.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Lars Breddemann
Dec 11, 2016 at 01:48 AM

The structure of the RECORD_ID information presented in the M_RECORD_LOCKS view depends on the internal object type the lock is used for. It's a representation of the locking information from the lockmanager/transactionmanager components in the HANA kernel.

This structure is not officially documented externally and can/has/will change with new revisions of HANA.

Compared to other DBMS (e.g. Oracle) where such information could relatively reliably linked to a specific table record, this mapping is a lot more volatile in HANA as the memory structures used to keep table information are often reorganised. Things like an "offset" of a certain piece of information from e.g. a starting point of a specific memory structure change often and really only make sense in this low-level context of memory structures.

Long story short, there is no SQL statement where you could put in the RECORD_ID information and retrieve a SQL level record that is protected by the lock.

10 |10000 characters needed characters left characters exceeded
Rithika Kameshhwaren Dec 09, 2016 at 10:41 AM

Hi Pavel,

Please try this table M_OBJECT_LOCK_STATISTICS. This table has all the details about the lock.



10 |10000 characters needed characters left characters exceeded
sridhar C Dec 13, 2016 at 10:54 AM

Hi Pavel,

Please try with M_OBJECT_LOCK_STATISTICS where you will able to see Lock on the table , object lock, lock wait time.



10 |10000 characters needed characters left characters exceeded