ORA-01940: cannot drop a user that is currently connected ORACLE 报错 故障修复 远程处理

文档解释

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

Cause: Attempt was made to drop a user that is currently logged in.

Action: Make sure user is logged off, then repeat command.

ORA-01940: cannot drop a user that is currently connected这条错误信息指示,数据库正在尝试删除一个正在连接的用户。这是不允许的,因此ORACLE拒绝这么做。

官方解释

常见案例

案例1:某数据库用户在尝试删除另一个用户时收到以下错误消息:ORA-01940:“无法删除当前连接的用户”。

正常处理方法及步骤

SELECT * FROM V$SESSION WHERE USERNAME=’USER_TO_BE_DROPPED’;

2.若存在任何返回记录,立即终止这些会话:

ALTER SYSTEM KILL SESSION ‘sid,serial#’;

3.一旦所有会话与目标用户断开连接,即可尝试再次删除这些用户:

DROP USER USER_TO_BE_DROPPED;


数据运维技术 » ORA-01940: cannot drop a user that is currently connected ORACLE 报错 故障修复 远程处理