Академический Документы
Профессиональный Документы
Культура Документы
A high resource consumption or allocating of critical resources of long running SAP HANA
sessions can result in global problems.
This SAP Note provides an overview of settings and commands that can be used to terminate
critical long running sessions.
A session in this context is the combination of connection (i.e. link to client process), thread (i.e.
actual execution on SAP HANA side), SQL statement and transaction.
SAP HANA processing is based on threads rather than processes, so there is no guaranteed
way to be able to terminate a running session.
Only if SAP HANA actively checks for termination requests the termination will succeed. The
most critical code paths already check for termination requests.
Automatic:
uncommitted_write_transaction_lifetime
Manually
You can disconnect (and implicitly cancel) the related session / connection using the following
command:
Before the disconnection succeeds, the current transaction needs to be cancelled and rolled
back. A cancellation may not succeed immediately, because it requires that the current
transaction checks for incoming cancellation requests.
Attention: If a critical session can't be cancelled with CANCEL SESSION a forced disconnection
of the session can make the situation worse, because the client process might reconnect to SAP
HANA and start the critical activity another time. In this case you will face two critical sessions
rather than only one. So you should execute a DISCONNECT SESSION with care in cases
where a CANCEL SESSION didn't succeed.
Hdbcons:
You can cancel an individual active transaction with ID <transaction_id> using the following
command:
hdbcons 'transaction c <transaction_id>'
All active transactions can be cancelled in the following way:
hdbcons 'transaction c -a'
emergencyInfo.py:
As of SAP HANA SPS 08 you can activate the "Emergency Information" tab via "Administration" -
> "Open Diagnosis Mode". There you can switch to the 'Transaction' tab and proceed as follows
to cancel one or all transactions:
● Right-click on transaction and choose 'Cancel transaction <transaction_id>...' for
cancelling a single transaction.
● Choose 'Cancel All Transactions' to cancel all active transactions.
If a thread hangs executing an X2 plan, it can be stopped using the x2StopPlan.py command as
explained in SAP Note 2037509.
If a critical session exists and can't be terminated with the approaches described above, you
should proceed as follows:
If an active thread exists for the connection in question, you can generate its callstack, e.g. using
SQL: "HANA_Threads_Callstacks" (CONN_ID = <connection_id>) available via SAP Note
1969700. The following scenarios may be responsible:
In order preserve all relevant details of the situation it is recommended to create a SAP HANA
runtime dump (SAP Note 1813020