This error is often encountered when deleting a database user
ORA-01940: cannot drop a user that is currently connected
The reason is that there is a program connecting to the user that we need to delete, so we must disconnect the user before deleting it.
1. Find which connections are running under the account.
SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME=’USERNAME’;
Note: Capitalization is required here
SQL> SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME=’SSTEST’;
SID SERIAL#
———- ———-
137 41813
335 25993
464 58747
500 9153
531 50402
629 9264
631 11237
664 36180
8 rows selected.
2. Deleting user processes.
SQL>ALTER SYSTEM KILL SESSION ‘137,41813’;
System altered.
SQL>ALTER SYSTEM KILL SESSION ‘33525993;
System altered.
3, re-view the user connection and confirm that no connection is in use
SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME=’SSCRM’;
4、delete users
drop user sstest cascade ;
Similar Posts:
- ORA-01940: cannot drop a user that is currently connected
- ORA-00054:resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00980 synonym translation is no longer valid
- [Solved] Windows ADB devices port is occupied error: cannot connect to daemon
- The solution of JPS process information unavailable
- ORA-12518 TNSlistener could not hand off client connection [Solved]
- [Solved] Postgres Error: template1 is being accessed by other users
- Activemq Console Error: java.lang.SecurityException: User name [system] or password is invalid.
- Oracle: How to use errorstack to track the ora error of the client
- PING[ARC2]: Heartbeat failed to connect to standby ‘gqtzdb_dg’. Error is 16047