Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to Cancel an Oracle Query Completely using SQL?
RK wrote:
> Can someone help me?
>
> I am doing many SQL*Plus script queries within shell script batch jobs
> on a UNIX box.
>
> I need a good query termination mechanism -- in some cases, it is for
> testing, and I have to stop the queries because I know it is going
> wrong -- how can I do this without damaging Oracle database? Any SQL
> commands that I can use to terminate a running query?
>
> If more details, it is like the following:
>
> When it runs "sqlplus user/passwd @thescripts" from shell, shell
> invokes a process for the "sqlplus" command, and the "sqlplus" command
> process starts the Oracle query process. I know I can kill the first
> process, but to kill the second one may take risk to cause Oracle
> corrupt.
>
> How can I safely terminate the Oracle query process? Any SQL*Plus
> command or any other UNIX ways?
>
> Thanks.
>
> RK
Oracle: ALTER SYSTEM KILL SESSIN <sid, serial#>; Unix: kill -1 and if that doesn't work kill -9 Windows: orakill
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Thu Dec 04 2003 - 15:24:09 CST