Monday, 27 January 2014

Kill the oracle session from os(windows).


Here std is instance name in user case pls put ur instance name ...lie..orakill orcl or orakill ora...etc.....
1st i have get the user name from db with spid.....
13:56:06 SYS@std>>ed
Wrote file rajnish.txt

  1  select 'orakill std '|| b.spid,a.username
  2     from v$session a, v$process b
  3     where a.paddr = b.addr
  4*      and a.sid in  (select sid from v$session c where username is not null
and c.serial#=a.serial# )
13:56:37 SYS@std>>/

'ORAKILLSTD'||B.SPID                 USERNAME
==================================== ==============================
orakill std 2372                     SCOTT
orakill std 6744                     SYS

13:56:38 SYS@std>>

from other window i have logon on data with scort user....

no go on cmd execute below mentioned command....


C:\Users\Administrator>orakill std 2372

Kill of thread id 2372 in instance std successfully signalled.

C:\Users\Administrator>

and now when i execute desc emp it's diplaying not connect to oracle ....mince session has ben kill from os......:)

13:55:16 SCOTT@std>>conn scott/tiger_12
Connected.
13:56:14 SCOTT@std>>desc emp
ERROR:
ORA-03113: end-of-file on communication channel
Process ID: 2372
Session ID: 91 Serial number: 13


13:56:53 SCOTT@std>>




=========Enjoy with Oracle=======



No comments:

Post a Comment