Skip to Content

Killing a long running Process

Mar 06, 2017 at 08:06 AM


avatar image

Hi Team,

I have tried to terminate a session via below statement

Alter System Disconnect Session ' xxxx';

But The Session is still running with the status "Running(Cancellation Requested)".

Approximately how much time its gonna take to terminate it (via timeout)??

10 |10000 characters needed characters left characters exceeded

This has been discussed many times here on SCN. Please do search for the explanation why cancelling might not work.

* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Rory Assandey
Mar 08, 2017 at 03:52 AM

Hi Mave,

A cancellation may not take effect immediately as the current transaction checks for incoming cancellation requests first... You can try to achieve the same end from HANA studio: "Administration" -> "Performance" -> "Sessions" -> right-click on session -> "Cancel session".

If the ALTER command option shared by Benedict did not work, it's unlikely that the manual steps in studio give better results. Do you know what the session was doing / if there are any active transactions? If so, you can kill those either in studio or hdbcons:

1. hdbcons 'transaction c <transaction_id>
2. (SP8+) Activate the "Emergency Information" tab via "Administration" -> "Open Diagnosis Mode". Right-click on the transaction and choose 'Cancel transaction <transaction_id>...' for canceling a single transaction. Choose 'Cancel All Transactions' to cancel all active transactions

Now as a last resort, a system restart will certainly kick the session out as well as any long-running transactions - but hopefully, it hasn't come to that.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Rory,

Apparently We are using HEC and we dont have full admin rights.We had to raise ticket with SAP support to kill it. But again, when they killed the session, there was some issue and restart was required.


I am accepting it as an answer and closing the thread. Thanks

Benedict Venmani Felix Mar 06, 2017 at 11:51 PM

Hi Mave,

Try ALTER SYSTEM CANCEL SESSION <session>. It might work. It worked for me one time :)

I had the same problem with the cancel request running for a long time, but we did a system restart for some other reason, so I am not sure if the thread was actually cancelled.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Yes tried this but It got stuck at "Cancellation Requested". Anyway issue is resolved now after restart