Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Killing Oracle sessions

See here for recent notes on alter system kill session.

Methods of Murder by Mike Ault

Other than the aforementioned abort option for the SHUTDOWN command, which after all is rather rude, what are the methods of killing these recalcitrant sessions? Essentially, you can issue an ALTER SYSTEM KILL SESSION or you can issue a manual process kill command such as the UNIX: kill -9 pid from the operating system side. You should do one or the other of these types of kill operations, but not both. If you kill both the Oracle process and the operating system process, it can result in database hang situations, which will force you to perform a shutdown abort. 

Killing from the Oracle Side

The DBA can either issue a series of ALTER SYSTEM commands manually or develop a dynamic SQL script to perform the operation. Source 2.3 shows a PL/SQL procedure to perform a kill of a process using the dynamic SQL package of procedures: DBMS_SQL. In Oracle8i, a new option is available for the ALTER SYSTEM that allows disconnection of the user process after a transaction completes. The commented-out section in Source 2.3 shows this alternative to a straight kill.      

Using the procedure from Source 2.3 the DBA can then create a quick SQL procedure to remove the nonrequired Oracle sessions from the Oracle side. An example of this procedure is shown in Source 2.4. An example of the output from ora_kill.sql (kill_all.sql) is shown in Listing 2.4.

See Code Depot

 

Important Oracle 11g changes to alter session kill session

Oracle author Mladen Gogala notes that an @ sign is now required to kill a session when using the inst_id column:

SQL> select inst_id,sid,serial# from gv$session where username='SCOTT';

   INST_ID        SID    SERIAL#
---------- ---------- ----------
         1        130        620

SQL>  alter system kill session '130,620,1';
 alter system kill session '130,620,1'
*
ERROR at line 1:
ORA-00026: missing or invalid session ID

Now, it works:

SQL>  alter system kill session '130,620,@1';

System altered.

 


www.dba-oracle.com/oracle_scripts.htm

   
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational