Thursday, September 1, 2016

How to check SAP HANA table lock

Home


Objective : We want to check SAP HANA table locks using HANA studio.

Prerequisite: You need HANA admin authorization - System Privilege (CATALOG READ)  to execute system views.

Steps :How to check table locks in SAP HANA using HANA Studio.

1. Login to HANA Studio with user having system privilege(CATALOG READ).
2. Select the HANA system and Open the Administration Console
3. Go to "System Information " and execute report "Table Locks" to see the locks.



This information can also be viewed by executing "Data Preview" for "SYS.M_TABLE_LOCKS" view.

HANA Table locks



PFB detail of lock mode.

LOCK MODE: EXCLUSIVE
• Can be acquired by LOCK TABLE command explicitly or DDL command implicitly
• The transaction that holds the lock can read and write the table.
• Only the transaction that holds the lock can access the table.
• Lock requests for the table by other transactions are blocked while the EXCLUSIVE lock is held.
• The database releases acquired locks at the end of the transaction.

LOCK MODE: INTENTIONAL EXCLUSIVE
• Acquired by DML implicitly.
• Multiple transactions can acquired a INTENTIONAL EXCLUSIVE lock.
• EXCLUSIVE lock requests for the table by other transactions are blocked while the INTENTIONAL EXCLUSIVE lock is held.

• The database releases acquired locks at the end of the transaction.

1 comment: