微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ORA-01940: cannot drop a user that is currently

Oracle删除某个用户,报错:
12:17:05 SYS@RCBD1(BAPRCDB)> drop user GSDPAY cascade;
drop user GSDPAY cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected

使用删除当前用户会话后,链接一直在变,一直在涨。
12:21:13 SYS@RCBD1(BAPRCDB)> select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username = 'GSDPAY';

'ALTERSYstemKILLSESSION'''||SID||','||SERIAL#||''';'

alter system kill session '39,25167';
alter system kill session '144,15001';
alter system kill session '155,31897';
alter system kill session '297,27285';
alter system kill session '478,61659';
alter system kill session '1043,54247';
alter system kill session '1427,47505';
alter system kill session '1565,1707';
alter system kill session '1608,4123';
alter system kill session '1615,9605';
alter system kill session '1728,34805';
alter system kill session '1886,5755';
alter system kill session '2005,36393';
alter system kill session '2023,62813';
alter system kill session '2034,17133';
alter system kill session '2154,36941';
alter system kill session '2297,57457';
alter system kill session '2310,34881';
alter system kill session '2321,4779';
alter system kill session '2427,5759';
alter system kill session '2461,19827';
alter system kill session '2569,56201';
alter system kill session '2721,45675';
alter system kill session '2844,19895';
alter system kill session '2851,63481';
alter system kill session '2984,51063';
alter system kill session '2999,44415';
alter system kill session '3319,40307';
alter system kill session '3450,8641';
alter system kill session '3700,27449';
alter system kill session '3859,35379';
alter system kill session '3884,54613';
alter system kill session '4265,62259';
alter system kill session '4276,38659';
alter system kill session '4428,22593';
alter system kill session '4438,55087';

36 rows selected.

不是这个问题,尝试删除用户表空间
12:24:57 SYS@RCBD1(BAPRCDB)> select default_tablespace from dba_users where username='GSDPAY';

DEFAULT_TABLESPACE

GSDPAY_DATA

12:25:05 SYS@RCBD1(BAPRCDB)> drop tablespace GSDPAY_DATA including contents and datafiles;

Tablespace dropped.

12:29:08 SYS@RCBD1(BAPRCDB)> drop user GSDPAY cascade;
删除成功,好记性不如烂笔头,记录一下

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐