The ORA-01940 cannot delete the user that is currently connected
When importing data in the test environment today, you need to remember the drop user operation. When you execute the drop user, the prompt is: ORA-01940: cannot drop a user that is currently connected
SQL> drop user ecity;
Drop user ecity
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
Obviously, a user is connected and cannot drop the user.
Select username, sid, serial #, paddr from v $ session where username = 'ecity ';
Username sid serial # PADDR
-----------------------------------------------------------------------------------------
ECITY 634 7 running c028d198
SQL> select PROGRAM from v $ process where addr = '201710000c028d198 ';
PROGRAM
Bytes ----------------------------------------------------------------------------------------------------------
Oracle @ oradb01 (DW00)
SQL>
SQL> alter system kill session '2017, 7 ';
System altered.
SQL>
SQL> select saddr, sid, serial #, paddr, username, status from v $ session where username is not null;
SQL> drop user ecity CASCADE;
User dropped.
SQL>
Solve the problem. Before killing the process, check the process, which machine is connected, and whether the process can be killed. The test environment is good and production is no small matter.
Https://www.bkjia.com/topicnews.aspx? Tid = 12
This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151511.htm