cancel under win NT and within a script
Brigitte, January 09, 2003 - 9:34 am UTC
Hallo Tom,
how can I cancel a select as a Win NT Client?
Can I cancel a script from inside the script?
Thanks
January 09, 2003 - 9:38 am UTC
ctl-c always worked for me. assuming sqlplus of course. it is up to the tool in question to do this.
CTRL c doesn't work
Brigitte, January 10, 2003 - 8:54 am UTC
Hallo Tom,
thanks for your quick reply. Please excuse my unclear explanation.
Ctrl c cancels a script.
1. But whenn I have a select statement that's too long for me ctrl c doesn't work. I must kill sqlplus. I tested many key combinations without success. How can I cancel the statement?
2. I have scripts which must run under system. I can test within the script whether the user is system or not (select user from dual). How can I program a cancel in the script if the user is not system.
I hope you can understand me.
thanks
January 10, 2003 - 9:20 am UTC
1) contact support -- I don't do windows -- it always worked for me (ctl-c) when I did have windows a while back.
2) like this:
ops$tkyte@ORA920> whenever sqlerror exit
ops$tkyte@ORA920> variable uname varchar2(30)
ops$tkyte@ORA920> begin select user into :uname from dual where user = 'SYSTEM'; end;
2 /
begin select user into :uname from dual where user = 'SYSTEM'; end;
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 1
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.2.0 - Production
[tkyte@tkyte-pc tkyte]$
unless I'm logged in as SYSTEM, script bombs.
Brigitte, January 14, 2003 - 7:19 am UTC
Thanks, my script is now "bombproof".
How do I cancel statement programmatically?
Mikito Harakiri, June 14, 2004 - 8:22 pm UTC
I want to cancel statement gratiously, so that (partial) rowsource statistics would be in v$sql_plan_statistics. (If I just kill the session, the cursor stats would be flushed from SGA, right?).
SQL plus client can do it (with ctrl c), and another clients (like TOAD) also seem able to do it, so I wonder how do they do that.
Moreover, is there a way to cancel the statement through JDBC interface?
June 15, 2004 - 3:16 pm UTC
"gratiously", interersting :)
the stats stay in the v$ tables, even upon death of the client.
look up Statement.cancel() for jdbc.
cancel
George Joseph, May 17, 2012 - 10:41 pm UTC
Hi Tom
If there is a long running stored procedure that is submitted through sql*plus
begin
long_proc;
end;
and after some time ctl-c is fired, does oracle perform rollback on the transaction. If the proc has got a update to a large table only. does the statement rollback and locks are released?
May 18, 2012 - 2:43 am UTC
assuming the ctl-c was "caught" (it can be disabled) - assuming the ctl-c worked - yes, it would roll back the statement.
which could take longer to do then the statement had already been running (that is, if the procedure has been running an hour - it might take 2 or 3 or more hours to rollback.... rolling back is really expensive - we are optimized to commit)
How disabled CRT+C in sql*plus??
Felipe, August 27, 2012 - 1:27 pm UTC
How disable CTRL+C in sql*plus??
Regards
My terminal is the sqlplus
Felipe, August 30, 2012 - 8:49 am UTC
Hi, the call of sqlplus is made for a batch file. I´m using win7. But in sqlplus don´t explain how command i´d use for disable ctrl+C...
Do you have any idea?? This problem is taking my sleep hours..
Regards
September 10, 2012 - 6:13 pm UTC
you would have to ask Microsoft how to disable the ctl-c interrupt in windows - this is an OS question, not a sqlplus question at all... sorry, I don't do windows.