With the new feature that introduced with Oracle 18c, it is now possible to stop the running query in a session without terminating session. You can stop the query as follows.
SYNTAX
1 | ALTER SYSTEM CANCEL SQL 'SID, SERIAL, @INST_ID, SQL_ID'; |
EXAMPLE
For the query in the corresponding session in the instance you are connected to:
1 | ALTER SYSTEM CANCEL SQL '123, 34789'; |
For a specific query in the corresponding session in the instance you are connected to:
1 | ALTER SYSTEM CANCEL SQL '123, 34789, 5swu4fpw7x3pd'; |
For the query in the corresponding session in the instance 1:
1 | ALTER SYSTEM CANCEL SQL '123, 34789, @1'; |
For a specific query in the corresponding session in the instance 1:
1 | ALTER SYSTEM CANCEL SQL '123, 34789, @1, 5swu4fpw7x3pd'; |