Thursday, December 08, 2011

ORA-01940

If you try to drop a user who is currently connected to the database, you get an ORA-01940 message. You can see what I mean in the example below: 

First, Andrew connects to the database:

SQL> conn andrew/reid
Connected.
SQL>
 
Then simultaneously, in another session, SYSTEM tries to drop user Andrew and Oracle returns an error message:
 
SQL> conn system/manager
Connected.
SQL> drop user andrew;
drop user andrew
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
 
SQL>

No comments: