ORA-01940: cannot drop a user that is currently

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-01940: cannot drop a user that is currently相关的知识,希望对你有一定的参考价值。

Oracle删除某个用户,报错:
12:17:05 [email protected](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 [email protected](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 [email protected](BAPRCDB)> select default_tablespace from dba_users where username=‘GSDPAY‘;

DEFAULT_TABLESPACE

GSDPAY_DATA

12:25:05 [email protected]BD1(BAPRCDB)> drop tablespace GSDPAY_DATA including contents and datafiles;

Tablespace dropped.

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

以上是关于ORA-01940: cannot drop a user that is currently的主要内容,如果未能解决你的问题,请参考以下文章

ORA-01940: cannot drop a user that is currently connected 问题解析

删除oracle用户报ORA-01940: cannot drop a user that is current

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

(转)oracle中用户删除不了,ORA-01940提示 “无法删除当前已连接用户”

Cannot drop a database link after changing the global_name ORA-02024 (文档 ID 382994.1)

day10_小计