Oracle: Bagaimana ngeKill Session

Rabu, 25 November 2009


Setiap kali malakukan koneksi database dari client, server Oracle akan membuatkan satu session, terkadang kita perlu memutus/kill proses seperti query dari client yang memberatkan server. untuk menghentikan proses yang sedang running  gunakan perintah "alter system kill session 'SID,SERIAL#' immediate"



Contoh MengKill session di Oracle
[ramson@pc ~]$ sqlplus

SQL*Plus: Release 8.1.7.0.0 - Production on Wed Nov 25 09:45:07 2009

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

Enter user-name: rahmatul@mydb
Enter password:
Error accessing PRODUCT_USER_PROFILE
Warning:  Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM

Connected to:
Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production

SQL> select sid,serial#,username from gv$session;

       SID    SERIAL# USERNAME
---------- ---------- ------------------------------
         1          1
         2          1
         3          1
         4          1
         5          1
         6          1
         7      59185 USERWEB
         9      59214 USERWEB
        10      27852 RAHMMATUL
        13       4561 RAHMMATUL

10 rows selected.

SQL>
SQL>  alter system kill session '7,59185' immediate;

System altered.

SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
[ramson@pc ~]$
Bookmark and Share

Baca Juga



 
 
 
 
Copyright © ramSon
Using RAM Theme