遇到ORA-01940: cannot drop a user that is currently后

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

遇到这个问题,需要先kill掉所有使用该用户连接数据库的进程:

这里有个简单的方法:

SQL> SELECT 'ALTER SYSTEM KILL SESSION '||''''||SID||''''||','||''''||SERIAL#||''''||';' as KILLER FROM V$SESSION WHERE USERNAME='JC_CC_XC';

KILLER
--------------------------------------------------------------------------------
ALTER SYSTEM KILL SESSION '760','1893';
ALTER SYSTEM KILL SESSION '769','17537';
ALTER SYSTEM KILL SESSION '771','549';
ALTER SYSTEM KILL SESSION '801','8750';
ALTER SYSTEM KILL SESSION '802','3077';
ALTER SYSTEM KILL SESSION '840','6827';
ALTER SYSTEM KILL SESSION '843','6655';
ALTER SYSTEM KILL SESSION '855','3303';
ALTER SYSTEM KILL SESSION '858','1554';

9 rows selected.





你可能感兴趣的:(遇到ORA-01940: cannot drop a user that is currently后)