飞思扬

Never put off until tomorrow what you can do today!

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

问题提出:

SQL〉DROP USER USER1 CASCADE

ERROR:ORA-01940: cannot drop a user that is currently connected

由于当前用户正连接到数据库,所以无法删除

解决办法:

1、查询此用户的会话进程,

SQL〉SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME='USER1';

       SID    SERIAL#
---------- ----------
        24      25341

2、结束此用户的所有会话

SQL>ALTER SYSTEM KILL SESSION '24,25341';

System altered.

3、删除用户

SQL〉DROP USER USER1 CASCADE;

 

阅读更多
个人分类: 【数据库】
上一篇PL/SQL Developer实用技巧
下一篇oracle在unix环境下重启
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭