Joke Collection Website - Public benefit messages - Why can’t the Audi a6 be deleted after deleting the main user?

Why can’t the Audi a6 be deleted after deleting the main user?

It is a common phenomenon that the main user cannot be deleted.

Two solutions for deleting users who cannot delete currently connected users are as follows: 1. First lock the user, then query the process number, and finally delete the corresponding process and then delete the corresponding user. SQLgt;alteruserXXXaccountlock,SQLgt;SELECT*FROMV$SESSIONWHEREUSERNAME='LGDB',SQLgt;altersystemkillsession'xx,xx'SQLgt;dropuserxxcascade. 2. Shut down the database, restart it, query the process number specifically, and finally delete the corresponding process. The steps are as follows: 1) Check the user's connection status. The results of selectusername, sid, serial#fromv$session are as follows: usernamesidserial#, NETBNEW51322974, NETBNEW51418183, NETBNEW51621573, NETBNEW5319, ts5324562 (2) Find the sid and serial of the user to be deleted, and delete them. For example: if you want to delete user 'ts', you can do this: altersystemkillsession '532, 4562' (3) Delete user dropusertscascade (**) If you still prompt ORA-01940 after drop: The currently linked user cannot be deleted, please explain If there is a connected session, you can check whether the session has been killed by checking the status of the session. Use the following statement to check: selectsaddr, sid, serial#, paddr, username, statusfromv$sessionwhereusernameisnotnull. The results are as follows (take my library as an example) :saddrsidserial#paddrusernamestatus,564A1E2851322974569638F4NETBNEWACTIVE,564A30DC51418183569688CCNETBNEWINACTIVE,564A56445162157356963340NETBNEWINACTIVE,564B6ED0531956962D 8CNETBNEWINACTIVE, 564B8184532456256A1075CWUZHQKILLED, status is the session status of the user to be deleted. If it is still inactive, it means it has not been killed. If the status is killed, it means it has been killed. It can be seen that the session of user ts has been killed. It is now safe to delete the user.