Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to terminate Oracle procedures which is running

I created an oracle procedure. When i execute it from sqldevoloper in some case i think it is going into an infinite loop. It keeps on generating the log files. How can i terminate this running procedure? I stopped the oracle service through services.msc . When i start it again , log files are getting generated. I think still that procedure is running. How can i terminate those procedures.

like image 502
Andromeda Avatar asked Sep 14 '12 09:09

Andromeda


People also ask

How do you stop a running procedure in SQL Developer?

To kill a session: In SQL Developer, click Tools, then Monitor Sessions. In the Select Connection dialog box, select a connection to SYSTEM (or another account with full DBA privileges) Right-click in the row for the session to be terminated, and select Kill Session.

How do you exit a procedure in Oracle PL SQL?

When the EXIT statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop.

How do you stop a running job in PL SQL?

Stopping running jobsBEGIN DBMS_SCHEDULER. stop_job (JOB_NAME => 'RMAN_INC'); END; STOP_JOB will attempt to gracefully stop a job.


1 Answers

Identify your session (hung) from v$session using

select sid, serial#, status from v$session where USERNAME='NAME';

And then kill it using

ALTER SYSTEM KILL SESSION 'SID,#SERIAL';
like image 117
vikiiii Avatar answered Sep 21 '22 06:09

vikiiii