cancel
Showing results for 
Search instead for 
Did you mean: 

Killing a long running Process

0 Kudos

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)??

lbreddemann
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member108271
Discoverer

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.

0 Kudos

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.

0 Kudos

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

Answers (1)

Answers (1)

BenedictV
Active Contributor
0 Kudos

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.

0 Kudos

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