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

SQL>drop user MY_USER cascade;
drop user username cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected

SQL>select s.sid, s.serial#, s.status, p.spid from v$session s, v$process p where s.username = ‘MY_USER’ and p.addr (+) = s.paddr;
SID           SERIAL#       STATUS           SPID
———   ———-    ——–       ————
579               27        INACTIVE        17849
279                9        INACTIVE        89543

SQL> alter system kill session ‘579,29’;
System alterred.

SQL> alter system kill session ‘279,9’;
System alterred.

Now try to drop USER:

SQL>drop user MY_USER cascade;
User dropped.

Thank You !!

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: