ORA-01940: cannot drop a user that is currently connected 问题解析
来源:互联网 发布:卡通人物头像制作软件 编辑:程序博客网 时间:2024/06/01 07:18
删除数据库用户的时候经常会遇到这样的错误;
ORA-01940: cannot drop a user that is currently connected
原因是有程序在连接我们需要删除的用户,我们删除用户之前一定要先把连接断掉;
1、查找帐号下哪些连接在运行:
SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME='USERNAME';
注意:此处需要大写
SQL> SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME='SSTEST';
SID SERIAL#
---------- ----------
137 41813
335 25993
464 58747
500 9153
531 50402
629 9264
631 11237
664 36180
8 rows selected.
2、删除用户进程;
SQL>ALTER SYSTEM KILL SESSION '137,41813';
System altered.
SQL>ALTER SYSTEM KILL SESSION '33525993;
System altered.
3、重新查看用户连接,并确认无连接在使用
SELECT SID,SERIAL# FROM V$SESSION WHERE USERNAME='SSCRM';
4、删除用户
drop user sstest cascade ;
或者是
根据文档的描述,如果数据库处于RESTRICTED SESSION状态,则禁止用户采用NET服务方式登陆,而必须在服务器上直接登陆,但是测试发现,Oracle并没有这个限制。
SQL> conn / as sysdba已连接。
SQL> alter system disable restricted session;
系统已更改。
SQL> conn test/test@test11g已连接。
SQL> conn / as sysdba已连接。
SQL> alter system enable restricted session;
系统已更改。
- ORA-01940: cannot drop a user that is currently connected 问题解析
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940:cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940:cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected
- ora-019401 cannot drop a user that is currently connected
- ERROR:ORA-01940: cannot drop a user that is currently connected
- Linux中删除Oracle用户 提示 ORA-01940: cannot drop a user that is currently connected
- ORA-01940: cannot drop a user that is currently connected 的解决办法
- 遇到ORA-01940: cannot drop a user that is currently
- Cannot drop database "databasename" because it is currently in use.
- drop user a cascade:ORA-00604 ORA-00942 ORA-06512
- This device is not currently connected
- Codeforces Round #156
- DotNetSpeech 可以生成Wave音频文件
- android TraceView 使用方法搜集
- 分享一个自己写的选项空间。。。。暂时只支持二级联动。。wtl。最近在学wtl就写写了。。
- Groovy 简单入门
- ORA-01940: cannot drop a user that is currently connected 问题解析
- 偏产品型技术经理需要掌控的
- Windows访问Linux——之Samba
- 三菱PLC批量传送指令BMOV
- 任意方向滚动的ScrollView,附带弹性特效
- datagrid 处理二维数组
- Run first simple case on Jmeter
- Jquery CheckBox 相关操作
- 使用Command模式实现应用的撤销功能