✍ Kashif M ™
☎ +91 9994883085
✉ kashif7222@gmail.com


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


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. 

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

Comment for "Kill session in Oracle"


Post a Comment

Blog Archive