Skip to content
March 30, 2018 / doganay

HOW TO SEND CTRL^C TO ANY SESSION

In 11g we set 10237 event:

exec dbms_system.set_ev( &sid, &serial, 10237, 1, '');

But do not forget to clear that event immediately:

exec dbms_system.set_ev( &sid, &serial, 10237, 0, '');

If you do not clear, session continues to get error:

*
ERROR at line 1:
ORA-01013: user requested cancel of current operation

In 18c it’s much more easier:

-- Current SQL in session on this instance.
ALTER SYSTEM CANCEL SQL '&sid, &serial';

There are also some other alternatives:

-- Current SQL in session on instance with INST_ID = 1.
ALTER SYSTEM CANCEL SQL '&sid, &serial, @1';

-- Specified SQL in session on this instance.
ALTER SYSTEM CANCEL SQL '&sid, &serial, 84djy3bnatbvq';

-- Specified SQL in session on instance with INST_ID = 1.
ALTER SYSTEM CANCEL SQL '&sid, &serial, @1, 75fqr2nadeydf';
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: