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

Cause:

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

SQL> select sid, serial# from v$session where username = ‘DATA’;
       SID    SERIAL#
———- ———-
       150   873
SQL> alter system kill session ‘150,873’;
System altered.
SQL> drop user data;
drop user data
*
ERROR at line 1:
ORA-01922: CASCADE must be specified to drop ‘DATA’
SQL> drop user data cascade;   
User dropped.
SQL> 
  • October 2, 2018 | 19 views
  • Comments