1. query the user's connection status
Select username, sid, serial # from v $ session where username = 'maximo ';
Username sid serial #
--------------------------------------------------
MAXOMO 22 1
MAXIMO 142 1
2. delete one by one
Alter system kill session '22, 1 ';
3. delete a user
Drop user xy1027 cascade;
4. Check the status
If you still prompt ORA-01940 after drop: Unable to delete the user already linked, it means there is a connected session, you can check the session status to determine whether the session is killed,
Use the following statement to View Details:
-------------------------------------
Select saddr, sid, serial #, paddr, username, status from v $ session where username is not null
The result is as follows (taking my database as an example ):
Saddr sid serial # paddr username status
Bytes --------------------------------------------------------------------------------------------------------
564A1E28 513 22974 569638F4 NETBNEW ACTIVE
564A30DC 514 18183 running 688cc NETBNEW INACTIVE
564A5644 516 21573 56963340 NETBNEW INACTIVE
564B6ED0 531 9 49262d8c NETBNEW INACTIVE
564B8184 532 4562 56A1075C WUZHQ KILLED
Status indicates the session status of the user to be deleted. If the session status is inactive, the user is not killed. If the session status is killed, the user is killed.
It can be seen that the session of the user WUZHQ has been killed. Users can be safely deleted.
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12