Cancel Oracle procedure from SQL Server procedure when cancelled -
i'm executing stored procedure on sql server side. in part of procedure, remote oracle procedure called using
execute (' begin oraprocname(procparams); end;') @ remotedb.
today, needed stop executing procedure have used cancel query on sql server side.
the problem sql server not able stop procedure until remote procedure stopped (i needed kill remotedb side).
is there way somehow "inform" oracle side procedure needs cancelled stored procedure on sql server side?
your problem once you've sent command oracle, not return until end of command.
so unless execute () @ remotedb
has specific parameters wrap call in sub-process can stopped caller (unlikely, why not?), must create own oracle function kill long-running session.
so solution create oracle function or procedure kill long-running session, , call separate process.
get running sessions:
select sid , serial# v$session username='<your user>' , status = 'active'
then use above info kill it, using execute immediate alter system
:
begin execute immediate 'alter system kill session ''<sid>,<serial#>'' '; end; /
Comments
Post a Comment