Skip to Content

Killing a long running Process

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

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    Posted on 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.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on 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.

    Add comment
    10|10000 characters needed characters exceeded