Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to Cancel an Oracle Query Completely using SQL?

Re: How to Cancel an Oracle Query Completely using SQL?

From: Phil Singer <psinger1_at_chartermi.net>
Date: Thu, 18 Dec 2003 19:50:24 -0500
Message-ID: <3FE24B50.77B10A55@chartermi.net>


RK wrote:
>
> Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1070573081.166590_at_yasure>...
> > 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#>;
> >
>
> I guess only DBA can do that?
>

And a DBA can write a stored procedure to do that, which you can call.

> > Unix: kill -1 and if that doesn't work kill -9
> > Windows: orakill
>
> Are these two going to hurt Oracle or Oracle data anyway?

No, it will not. You get somethings when you plunk down your money for Oracle. Freedom from data corruption is one of them.  

> Thanks.

No problem. But first, open up the Oracle Concepts manual, and turn to the section on 'PMON'.  

> RK

-- 
Phil Singer                |    psinger1ATchartermiDOTnet
Oracle DBA
Remove the Obvious to reply
Received on Thu Dec 18 2003 - 18:50:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US