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

Try to drop a user in a RAC environment with below errors :

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

There is no sessions, and objects for this user.

SQL> select count(*) from gv$session where username='TESTUSER';

COUNT(*)
----------
0
SQL> select count(*) from dba_objects where owner='TESTUSER';

COUNT(*)
----------
0

It seems there is internal issues in database for this user.

we can either wait for a while , or bounce the database. After this, it is OK to drop the user.

SQL> drop user TESTUSER cascade;

User dropped.
Advertisement

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: