ORA-01940: cannotdropauserthatiscurrentlyconnecte

Source: Internet
Author: User
ORA-01940: cannotdropauserthatiscurrentlyconnecte

ORA-01940: cannot drop a user that is currently connecte

When we delete a user, if the user to be deleted is currently connected to the Oracle database, an error is returned:

SQL> conn/as sysdba
Connected.

SQL> drop user fc cascade;
Drop user fc cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected.

Check the current session information of the user to be deleted in the v $ session view, and kill the session connection of the User:

SQL> select sid, serial # from v $ session where username = 'fc ';
Sid serial #

--------------------

150 9019
SQL> alter system kill session '1234569 ';
System altered.

Then, execute the drop user operation:

SQL> drop user fc cascade;
User dropped.

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.