ORA-01940 无法删除当前已连接用户

oracle数据库需要重构,因此需要删除用户,删除表空间,但是在删除用户过程中,一直提示ORA-01940错误信息,但是经排查没有用户登录,而且在v$session中也没有相关session,记录操作方法。

[oracle@enmoedu1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 17 21:25:40 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

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


SQL>

查看该用户对应的session

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

no rows return

SQL>

如若有相关的session信息,需要将对应session信息删除

SQL> alter system kill session'对应sid,对应serial#';

System altered.

SQL>

删除后再执行删除用户操作drop user wxc cascade。

依然报该错误信息,解决方案如下:

停止数据库服务

SQL > shutdown immediate;

停止监听

lsnrctl stop

然后登陆数据库,再执行删除操作

[oracle@enmoedu1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 17 21:25:40 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> drop user wxc cascade;

成功删除,然后再将监控启动即可lsnrctl start.




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wenxuechaozhe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值