cancel
Showing results for 
Search instead for 
Did you mean: 

How to cancel a session with connection_id=-1

Former Member
0 Kudos

I want to use

  • ALTER SYSTEM DISCONNECT SESSION '<connection_id>'

to cancel a session with connection_id=-1.  However, there are many sessions with connection_id=-1.

There are other fields in M_TRANSACTIONS, can I use as follows:

  • ALTER SYSTEM DISCONNECT SESSION '<connection_id>' where transaction_id = '...'

I try on  a sandbox but see no effect.

What is the best way?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

For ALTER SYSTEM you cannot use a WHERE clause  - it's just not part of the syntax.

Connections with connection_id = -1 are internal connections and cannot be disconnected.

Instead you need to find the external session that spawned this internal thread and cancel that one.

- Lars

Former Member
0 Kudos

Instead you need to find the external session that spawned this internal thread and cancel that one.


Could you please provide an SQL to identify the parent session? 

Thanks!

lbreddemann
Active Contributor
0 Kudos

Check the PARENT_CONNECTION_ID in M_CONNECTIONS.

Answers (0)