✍ Kashif M
Trends

Thursday, 12 September 2013


Kill session in Oracle


By on September 12, 2013



SQL Error: ORA-01940: cannot drop a user that is currently connected

01940. 00000 -  "cannot drop a user that is currently connected"
*Cause:    Attempt was made to drop a user that is currently logged in.
*Action:   Make sure user is logged off, then repeat command.


When you planned to drop user in oracle.  sometime you will get error like this



Kill session in Oracle




Solution:

Login with sys user of your database, and enter this query.

select sid,serial# from v$session where username ='BAW'


It will display you the list of sid and serial#, which your user is using.

Then use this query

Alter system kill session '143','500';

were 143 is sid and 500 is serial#

once you kill all the session related to this schema, drop this user now.

Now you have successfully dropped your schema. 

Kashif
mkashu: Kill session in Oracle
Review : Kashif | Kashif
Update: September 12, 2013 | Rating: 4.5

Comment for "Kill session in Oracle"

0 comments

Post a Comment

Blog Archive