cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor

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.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Pavel,

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

BR,

Sridhar


former_member224444
Participant
0 Kudos

Hi Pavel,

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

Thanks.

Rithika