1) view the user's connection status
Select username, Sid, serial # from V $ session
------------------------------------------
Result:
Username Sid Serial #
----------------------------------------
Netbnew 513 22974
Netbnew 514 18183
Netbnew 516 21573
Netbnew 531 9
Wuzhq 532 4562
(2) locate the SID, serial, and delete the user to be deleted.
-------------------------------------------
For example, if you want to delete the user 'wuzhq', you can do this:
Alter system kill session '2017 2'
(3) Delete a user
--------------------------------------------
Drop User Username Cascade
(**) If you still prompt ORA-01940 after drop: Unable to delete the user that is currently linked, there is a connected session, you can check the session status to check whether the session is killed. Use the following statement to check the status:
-------------------------------------
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 569688cc Netbnew
Inactive
564a5644 516 21573 56963340 Netbnew Inactive
564b6ed0 531 9 56962d8c Netbnew
Inactive
564b8184 532 4562 56a1075c