Kill a session
Hi Friends,
Can any one tell me, as to how to kill a process which is appearing in SM66.
Regards,
Mark K
Go to Edit-process-cancel-withcore.
And this will cancel your process.
reward points if usefull.
Thanks and regards,
Veerendrnath Maddula.
Similar Messages
-
PL/SQL procedure to kill inactive session
Hi all ,
Please i am trying to write a procedure to kill inactive sessions of the shema 'TESTSCHEMA' .This is my first procedure , am not use to pl/sql but i went through many turtorial but have some errors at compliation .when i try to compile the procedure the errors are as below :
15:50:28 Start Find Objects [TESTSCHEMA@TESTDB_UNIX(2)] ...
15:50:28 End Find Objects [TESTSCHEMA@ TESTDB_UNIX(2)]
15:50:32 Start Compiling 1 object(s) ...
15:50:32 Executing ALTER PROCEDURE fib_dead_cnx_cleanup COMPILE ...
15:50:32 [13:2] PL/SQL: ORA-00933: SQL command not properly ended
15:50:32 [9:3] PL/SQL: SQL Statement ignored
15:50:32 [18:12] PLS-00103: Encountered the symbol "(" when expecting one of the following:
15:50:32 constant exception <an identifier>
15:50:32 <a double-quoted delimited-identifier> table LONG_ double ref
15:50:32 char time timestamp interval date binary national character
15:50:32 nchar
15:50:32 The symbol "<an identifier>" was substituted for "(" to continue.
15:50:32 [18:21] PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
15:50:32 := ; not null default character
15:50:32 The symbol "; was inserted before "LOOP" to continue.
15:50:32 [27:8] PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
15:50:32 begin case declare exit for goto if loop mod null pragma
15:50:32 raise return select update while with <an identifier>
15:50:32 <a double-quoted delimited-identifier> <a bind variable> <<
15:50:32 close current delete fetch lock insert open rollback
15:50:32 savepoint set sql execute commit forall merge pipe
15:50:32 Compilation complete - 5 error(s) found
15:50:32 End Compiling 1 object(s)
below is the procedure code :
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid,serial#,sid||','||serial# as sid_serial
FROM v$session
WHERE username='EBBFCAT' and schemaname='TESTSCHEMA'
and status='INACTIVE'
BEGIN
BEGIN
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1) LOOP
BEGIN
FETCH session_cur INTO l_sid ,l_serial,l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN
alter system kill session 'l_sid_serial' ;
END;
END;
END;
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;
ThanksHi,
Never write, let alone post, unformatted code.
When posting any formatted text on this site, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Among the benefits of formatting: you can indent to show the extent of blocks, such as BEGIN-END.
Different types of blocks need modifiers after the end, such as "END *IF* " and " END *LOOP* ". If each opening statement (BEGIN, IF, LOOP) is directly above its corresponding END, then it's easy to check if you got the right modifier.
Here's what you code looks like with some formatting, and a couple of corrections added. Look for -- comments.
CREATE OR REPLACE
PROCEDURE fib_dead_cnx_cleanup
AS
l_serial CHAR(100);
l_sid CHAR (100);
l_sid_serial CHAR(100);
l_count NUMBER(10,0);
CURSOR session_cur IS
SELECT sid
, serial#
, sid || ','
|| serial# as sid_serial
FROM v$session
WHERE username = 'EBBFCAT'
and schemaname = 'TESTSCHEMA'
and status = 'INACTIVE'; -- need semicolon here
BEGIN
BEGIN -- Why?
l_count := 0;
OPEN session_cur;
WHILE ( 1 = 1)
LOOP
BEGIN -- Why?
FETCH session_cur
INTO l_sid
, l_serial
, l_sid_serial ;
EXIT WHEN session_cur%NOTFOUND ;
BEGIN -- Why?
alter system kill session 'l_sid_serial' ; -- Not a PL/SQL command
END;
END;
END LOOP; -- LOOP ends with END LOOP
CLOSE session_cur;
END;
END FIB_DEAD_CNX_CLEANUP;Take baby steps.
I've been wrtiing PL/SQL for 20 years, and I would never write that much code at once. If you're a beginner, all the more reason to start small. Write as little as possible, test, debug and test again (if necessary). When you have someting working, add 2 or 3 more lines and test again.
It looks like you have three BEGIN statements that don't serve any purpose. You should get rid of them (and their corresponding END statements, of course).
One error I did not fix: ALTER SYSTEM is not a PL/SQL statement. It's a SQL statement. You can run a SQL statement inside PL/SQL by using dynamic SQL, where you construct a string containing the SQL statement, and then use dbms_sql or EXECUTE IMMEDIATE to run it.
Edited by: Frank Kulash on Aug 18, 2009 12:37 PM -
Cannot kill a session that is running a query on a linked server in SQL Server 2008 R2
Hi,
Cannot kill a session that is running a query on a linked server in SQL Server 2008 R2.
When I try to kill, it status shown as "KILLED/ROLLBACK"
I have facing the issue from long back. I searched many and none of them worked for me
Any help is greatly appreciated
Thanks
Jaison
CarverI guess its stuck, can you see some blocking or any other process blocking the rollback.
can you check rollback status using below command. Or you can use sp_who2 and check status column
select percent_complete,estimated_completion_time from sys.dm_exec_requests
where spid=xxx
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles -
Call function RFC in a loop and kill old session
Hi,
we have a problem with a program.
here's a part of the code:
DO.
CALL FUNCTION 'YC_REFRESH_GPT_START_CM25' STARTING NEW TASK 'TEST'
EXPORTING
i_profile = p_prfl
i_werks = p_werks
i_arbpl_low = s_arbpl-low
i_arbpl_high = s_arbpl-high
TABLES
t_arbpl = it_arbpl.
PERFORM wait_for_refresh.
PERFORM terminate_session.
ENDDO.
So the program does a call function, waits a while, then terminates the session and recalls the function.
Apparently, like this the data should be updated.
But in the terminate session, the session is terminated using:
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_delete_mode
ID 'MODE' FIELD l_mode.
And it works the first time, but the second time there is a dump.
So, is there another way to achieve what this program is trying to do?
Or is there another way to kill the session?
Thanks!!Hi,
the DLL will stay in memory as long as there is a program running which has not closed (unloaded) the DLL.
Doing repetitive calls to the DLL is irrelevant in this context. LV opens the DLL as soon as needed and will only unload it when there is no VI in memory which has a CLN to that DLL...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Killing all sessions at once who are locking the objects
Hello all,
i am working in 9i Oracle RDBMS on AIX IBM OS
most of the time we face locking issue and there comes more then different 50 sessions which locking different tables.
here is my script to find out what sessions are locking what tables.
set lines 200
set pages 50000
col SID for 99999
col SERIAL# for 999999
col username format a12
col sql format a55
col event format a50
col program format a40
col MINS for 9999
col ID1 for 999999
col object_name for a35
col locktype for a8;
select /*+ ORDERED */ s.sid,s.serial#,s.status,round(s.last_call_et/60) MINS,s.program,l.ID1,d.object_name,d.object_type,l.type as locktype
from v$lock l,v$session s, dba_objects d
where l.sid = s.sid
and l.ID1 = d.object_id
and s.username = 'MULDMS'
and last_call_et > 120 and l.type <> 'TX' order by s.status,MINS,l.ID1,l.type; and the out put it gives something like
SID SERIAL# STATUS MINS PROGRAM ID1 OBJECT_NAME OBJECT_TYPE LOCKTY
8981 1069 ACTIVE 2 frmweb@Appsdms31 (TNS V1-V3) 30407 VH_BTN TABLE TM
1642 512 ACTIVE 15 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
690 1057 ACTIVE 17 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
699 1787 ACTIVE 17 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
690 1057 ACTIVE 17 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
690 1057 ACTIVE 17 [email protected] (TNS V1-V3) 30643 VT_CHECK_INOUT TABLE TM
10877 895 ACTIVE 18 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
6654 1085 ACTIVE 18 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
1912 1655 ACTIVE 18 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
10877 895 ACTIVE 18 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
6654 1085 ACTIVE 18 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
1912 1655 ACTIVE 18 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
1754 1582 ACTIVE 18 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
10877 895 ACTIVE 18 [email protected] (TNS V1-V3) 30643 VT_CHECK_INOUT TABLE TM
6654 1085 ACTIVE 18 [email protected] (TNS V1-V3) 30643 VT_CHECK_INOUT TABLE TM
10708 982 ACTIVE 19 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
5428 855 ACTIVE 19 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
10708 982 ACTIVE 19 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
5428 855 ACTIVE 19 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
10278 897 ACTIVE 20 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
6261 1056 ACTIVE 20 frmweb@appsdms12 (TNS V1-V3) 28846 AM_DOCS TABLE TM
6598 1413 ACTIVE 20 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
1312 1000 ACTIVE 20 [email protected] (TNS V1-V3) 28846 AM_DOCS TABLE TM
10278 897 ACTIVE 20 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
6261 1056 ACTIVE 20 frmweb@appsdms12 (TNS V1-V3) 30407 VH_BTN TABLE TM
1312 1000 ACTIVE 20 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
3521 717 ACTIVE 20 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
6598 1413 ACTIVE 20 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
6598 1413 ACTIVE 20 [email protected] (TNS V1-V3) 30643 VT_CHECK_INOUT TABLE TM
1312 1000 ACTIVE 20 [email protected] (TNS V1-V3) 30643 VT_CHECK_INOUT TABLE TM
9131 1002 INACTIVE 2 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
4887 1040 INACTIVE 2 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
151 1982 INACTIVE 2 [email protected] (TNS V1-V3) 80224 RD_ENQEXD TABLE TM
846 988 INACTIVE 3 [email protected] (TNS V1-V3) 29228 GM_VIN TABLE TM
5364 1149 INACTIVE 3 [email protected] (TNS V1-V3) 30407 VH_BTN TABLE TM
9934 789 INACTIVE 3 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
7511 1092 INACTIVE 3 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
3595 1104 INACTIVE 3 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
846 988 INACTIVE 3 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TM
945 670 INACTIVE 3 [email protected] (TNS V1-V3) 30455 VH_PSF TABLE TMand then i have to kill the session one by one . thaat is a tedious task to do.
i want to modify this script which will give me all the kill statement and i just have to run it
can someone help me in this regard as i am weak in sql/plsql
thanks and many thanks>
i want to modify this script which will give me all the kill statement and i just have to run it
>
Karthick's script will 'kill' the sessions but before you use that script you may want to read the docs about the KILL and DISCONNECT clauses.
See the DISCONNECT SESSION and KILL SESSION clauses in the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm#sthref4724
>
DISCONNECT SESSION Clause
Use the DISCONNECT SESSION clause to disconnect the current session by destroying the dedicated server process (or virtual circuit if the connection was made by way of a Shared Sever).
The IMMEDIATE setting disconnects the session and recovers the entire session state immediately, without waiting for ongoing transactions to complete.
KILL SESSION Clause
The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources.
IMMEDIATE Specify IMMEDIATE to instruct Oracle Database to roll back ongoing transactions, release all session locks, recover the entire session state, and return control to you immediately.
>
For DISCONNECT the IMMEDIATE clause will recover the session state 'immediately'.
Using KILL, even with the IMMEDIATE clause, you are telliing Oracle to roll back any ongoing transactions and that can take a lot of time.
Make sure you are really doing the operation you want to do. If you want to get the locks released immediately you need to use 'DISCONNECT IMMEDIATE'. -
How to kill a session in stored procedure or trigger.
Can anyone let me know, how to kill a particular session in stored procedure or trigger.
Regards
KVSSalso you cannot attempt to kill ur own current session.
But on what circumstances you want to kill the session.
When anyone trys to access a table and lets suppose the trigger onthat table activates
and you want to kill that very session which activated the trigger ???
i dont think its possible. To kill a session definitely you should be in a different session and
then only you can achieve that.
pls check it out
prakash
[email protected] -
ALLOW A USER TO KILL A SESSION WITHOUT ALTER SYSTEM PRIVILEGE.
Hi
I need a user to have permission to kill a session without having the ALTER SYSTEM privilege. I created a procedure on sys schema and granted the EXECUTE privilege to the user but it doesn't work, how can I do, help please.
CREATE OR REPLACE PROCEDURE SYS.PRC_SESSION_KILLER (P_SID IN NUMBER, P_SERIAL IN NUMBER)
AS
BEGIN
EXECUTE IMMEDIATE 'GRANT ALTER SYSTEM TO SYSADMIN';
EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || P_SID || ',' || P_SERIAL || ''' IMMEDIATE';
EXECUTE IMMEDIATE 'REVOKE ALTER SYSTEM FROM SYSADMIN';
END;
Thank you very much.Hi,
I second everything John said.
Are you sure the arguments are correct?
Below is the procedure I use. You may want to run it, just to see what the error is.
PROCEDURE kill_internal
s_id IN NUMBER,
serial_num IN NUMBER,
stat_out OUT VARCHAR2
IS
alter_handle INTEGER;
ex_val INTEGER; -- Returned by dbms_sql.execute
BEGIN
alter_handle := dbms_sql.open_cursor;
dbms_sql.parse
alter_handle,
'ALTER SYSTEM KILL SESSION ''' ||
TO_CHAR (s_id, '999990') ||
', ' ||
TO_CHAR (serial_num, '999990') ||
dbms_sql.native
ex_val := dbms_sql.execute (alter_handle);
dbms_sql.close_cursor (alter_handle);
stat_out := 'Success: ' ||
TO_CHAR (s_id, '999990') ||
', ' ||
TO_CHAR (serial_num, '999990');
EXCEPTION
WHEN OTHERS
THEN
stat_out := 'Failure:' ||
SQLERRM;
-- dbms_output.put_line (stat_out);
dbms_sql.close_cursor (alter_handle);
END kill_internal
; -
Unable to kill a session in SM50 or SM66
One of our developer was working on a program and there was a network failure. When we got the network back the system shows the process is till running since 3 days. Tried to kill it from SM50 and SM66.
While logging in it is giving 3 options and even after selecting "Continue with this logon and end any other logons in system" its not ending that session.
After we logon the program is running good.
How to kill this session??
Details of the session is given below
No Ty. PID Status Reasn Start Err Sem CPU Time Cl. User
3 DIA 6584 Running No 296:36 168191 130 BYARLAGADDA
Report / Spool action
CL_ABAP_TABLEDESCR============CP
Main Program
SAPLCV110
Action Table
Waiting f. since
Database Number Time (usec) Recs.
Direct Read 14,681 519,103 524
Sequential Read 18,146 595171 83
Insert 0 0 0
Update 0 0 0
Delete 0 0 0Why does no-one understand SAP Architecture well enough anymore, I blame bad trainers.
Its like seeing a car driving badly all over the road and blowing up the car rather than shooting the driver.
The WP is not the problem, it is the task in the WP that is.
Killing a user in SM04 or a job in SM37 often works. Then I would try cancelling the program in SM50, not the work process.
If that fails then normally it is waiting on something - often RFC. If RFC a simple removal of the connection in SMGW removes the task from the WP. In this case it looks like a rogue DB process, in this case the WP is just waiting for a response from the DB... killing the WP just gets rid of the visibility in SM50, it does not remove the problem... in fact it then would make my job of identifying why the system is running slow a lot worse. -
Kill DBA session feature in SQL Developer
Hi All,
Like in TOAD , we have a Kill/DBA session option is on toolbar and we can easily trace down the sessions running as well as SID and serial number ..... Do We have similar feature on SQL Developer ?
Currently my SQL Developer version is 1.0.0.14.67 and Build Main 14.67it's in sqldev 1.1 (in reports/database administration/sessions/sessions)
-
Clear the entry for killed/sniped session in v$session
Dear all,
In our production database(11.2.0.1.0) running on windows 2008 server many client session showing inactive from last 4-5 hour and I want to kill those session because all sessions are dedicated so for this I created a resource plan set its idle time after certain interval session status is showing killed but it is not removing entries from v$session but our client demand is it must be clear from v$session so for this i was using DOS command taskkill utility to kill particular os process so I want to know what is the smartest way to do this.This is known behavior, not an issue.
In a dedicated server environment when the session is killed and the rollback completes the process goes away so a join between v$session and v$process will fail. The v$session entry also usually goes away rather quickly, though I have seen cases where the v$session entry hung around till the instance was bounced. But normally Oracle will overlay the v$session entry with a new session using the same sid but a different serial# within seconds on a busy system.
Mark @ http://dbaspot.com/oracle-server/40419-killed-sessions.html
Metalink doc id 1023442.6 is also something confirming it.
See also below link and last reply by Mr. Braj Kishore Mahto.
http://dbaforums.org/oracle/index.php?showtopic=3039
Regards
Girish Sharma
Edited by: Girish Sharma on Nov 21, 2012 5:35 PM
So, what is best in this regard :
ALTER SYSTEM DISCONNECT SESSION
The ALTER SYSTEM DISCONNECT SESSION syntax is an alternative method for killing Oracle sessions. Unlike the KILL SESSION command which asks the session to kill itself, the DISCONNECT SESSION command kills the dedicated server process (or virtual circuit when using Shared Sever), which is equivalent to killing the server process from the operating system. The basic syntax is similar to the KILL SESSION command with the addition of the POST_TRANSACTION clause. The SID and SERIAL# values of the relevant session can be substituted into one of the following statements.
SQL> ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' POST_TRANSACTION;
SQL> ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' IMMEDIATE;
http://www.oracle-base.com/articles/misc/killing-oracle-sessions.php#disconnect_session -
Unable to kill a session request
i had started to run a calc script and then decided to cancel it manually on a BSO data base. In the sessions I can see that the request is in "Terminating stage" but has been like that forever( almost 5 hours)
i have tried scripts to kill it but failed
Alter System Kill request all;
ALter system logout session all;
Tried to manually kill it through EAS by even using force but it's still there.
Any ideas on how I can kill the session?
Thanks.Once in a while these things just won't go away and you need to kill the serprocess running it. If it is on Windows bring up task manager on the server and look for the Esssvr session that has cpu on it. End that task. To make my live easier, I go into EAS and right click on applications and say stop all applications. The one that does not disappear out of Task manager is the one to terminate. You could also look in the Essbase log and find the PID the application started on.
In Uxin it is easier as you gan do a ps -eaf and see the name of the application and kill -9 it's PID -
Killing User sessions and user calcs
Hi all,
We have a situation where users run their business rules during evening and at times in night.
We also have a maxl script which does aggregation and other calcs daily in night and it does not run as other calcs are launched by users.
Is it possible to kill the user session and calcs launched by users before running maxl calculation for consolidations?
I know I can do in in EAS, but want to try to do it in MAxL for automation.
Thanks in advanceYou would be better off locking people out. After you kick off the automated calc, killing sessions doesn't stop them from initiating calcs while your automated calc is running. In answer to your question, yes, you can do that in maxl.
alter system kill request all;
You have other options if you want to be more selective on what you kill.
kill request <session-id>
kill request by user
kill request on application
kill request on database
Check out the technical documentation for more info - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/launch.html.
Kyle Goodfriend
http://www.in2hyperion.com
Please make sure to assign helpful/answered to responses if applicable - it rewards those who help and benefits the user community. -
How to explicitly kill a session?
How do I explicitly kill a session in JSF?
The link is dead. jsffaq.com no longer exists. So how does one go about killing a session? If it helps, I'm specifically interested in doing so using MyFaces 1.1.
-
I do not have priviledge to kill the session, and i have checked the forums to create a procedure to kill the session,
so how can i use that procedure to kill the session.
ThanksIf you should be allowed to kill sessions, then your DBA will grant you the ALTER SYSTEM privilege. Or, you could request your DBA to create a stored procedure for it and then grant you execute permission on that procedure. Of course, if your DBA does not choose to do this, then this is a discussion you should be having with your management.
-
Kill the session Using Pl/sql Script
Hi,
I wrote a PL/SQL Script which kills the Specified Schema name..... the Script Run Successfully i got this output message "PL/SQL procedure successfully completed." But the Problem is in session status the status is in KILLED" state for more than 30 minutes.
Please Advice Why the Session in Killed State for more than 30 minutes and please tell me how to kill the session immediate;
I am Using Oracle DB 11g R1 and OS is Windows 2003 Server R2
My Pl/sql Script
SET SERVEROUTPUT ON;
DECLARE
KILLER1 V$SESSION.SID%TYPE;
KILLER2 V$SESSION.SERIAL#%TYPE;
CURSOR KILL_SESSION IS SELECT SID,SERIAL# FROM V$SESSION WHERE SCHEMANAME='NAME';
BEGIN
OPEN KILL_SESSION;
LOOP
FETCH KILL_SESSION INTO KILLER1,KILLER2;
EXIT WHEN KILL_SESSION%NOTFOUND;
DBMS_OUTPUT.put_line ('ALTER SYSTEM KILL SESSION '''||KILLER1||','||KILLER2||''' IMMEDAITE');
EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION'||chr(39)||KILLER1||','||KILLER2||chr(39);
END LOOP;
IF (KILLER1 > 0)
THEN
EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION'||chr(39)||KILLER1||','||KILLER2||chr(39);
END IF;
CLOSE KILL_SESSION;
END;
Thank You
ShanHello,
In fact you may use orakill it's an Oracle utility for Windows so as to Kill the thread corresponding
to the session.
It's equivalent to a kill -9 on Unix.
Please find here a link about the use of orakill:
http://articles.techrepublic.com.com/5100-10878_11-5224960.html
Hope this help.
Best regards,
Jean-Valentin
Edited by: Lubiez Jean-Valentin on Mar 27, 2010 5:17 PM -
AUTOMATICALLY KILL INACTIVE SESSIONS
Hi all. we are using oracle 8.1.6 on windows-2000 with 2gb ram. we facing
ora-12500 listner failed to start a dedicated server.
error and for this we made certain changes. we also added a parameter in sqlnet.ora at server side sqlnet.expire_time=10.. for automatically killing inactive sessions but it did not helped and many sessions remain in v$session. i wana know what should we do to kill inactive sessions. because i think when the sessions reach more than 300 then we face problem of listner failed. thanks for u'r valueable comments in advance as well.
best wishes
muhammad mohsin chatthaHi Nicolas, what you say is correct, but, unless the user try to do something (and receives an error),
those sessions will show up as SNIPED in V$SESSION, and never go away.
We can create a procedure to kill these sessions, something like this : 1 CREATE OR REPLACE PROCEDURE Kill_Sessions IS
2 Stmt VARCHAR2(200);
3 V_Sid VARCHAR2(30);
4 V_Serial VARCHAR2(30);
5 V_Username VARCHAR2(30);
6 CURSOR pri IS
7 SELECT Sid, Serial#, Username
8 FROM V$Session
9 WHERE Username Is Not Null
10 And Username not like 'SYS%'
11 And Status = 'SNIPED';
12 BEGIN
13 FOR usr in pri LOOP
14 V_Sid := usr.Sid;
15 V_Serial := Usr.Serial#;
16 Stmt := 'ALTER SYSTEM KILL SESSION ''' || V_Sid || ',' || V_Serial || '''';
17 Execute Immediate(Stmt);
18 END LOOP;
19* END;
20 / and execute it every minute (change 1440 to change the frequence) :SQL> Declare
2 Out_Var Int;
3 Begin
4 Dbms_Job.Submit(Out_Var,
5 'Kill_Sessions;',
6 Sysdate,
7 'Sysdate+1/1440' );
8* End;
SQL> /
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL>
Maybe you are looking for
-
Creating Logical hostname in sun cluster
Can someone tell me, what exactly logical hostname in sun cluster mean? For registering logical hostname resource in failoover group, what exactly i need to specify for example, i have two nodes in sun cluster , How to create or configure a logical h
-
How to change year once in progress of calender? or insert pages into new calender
so after a lot of hard work on a calender to give out for christmas i realized i had selected it for the 2011 year.... can i change the year of the calender now? and how? if not anyone know how to instert a finished page into a new calender?!?!? plea
-
Do I Need to Save Files when upgrading?
Hi everyone, I'm upgrading from Premiere Elements 2 to 9 and would like to know if I have to save my other files, videos & projects to another drive or will the upgrade keep them where they are at, on my E drive? Thanks Jeff
-
Mac Mail hacked FIVE times!
I've had the same e-mail address for over twelve years and I'd never been hacked (or whatever it's called when everyone in your address book receives spam from you) until six months ago, when I bought a Macbook Pro and started using Mac Mail. Since t
-
Incorrectly reported 5320XM CPU speed!
Hi all . I am enjoying my new 5320. One weird thing i notice is that almost all 3rd party system applications (xplore, activefile, nsysinfo........) report that the processor speed of the phone is 192MHz while the spec sheet says its 369MHz. Neverthe