ORA-01940: 无法删除当前已连接的用户的错误,该如何解决呢?
SQL> drop user t_pis_user cascade;
drop user t_pis_user cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
1、查看用户的连接状况
SQL> select saddr,sid,serial#,paddr,username,status from v$session where username is not null ;
SADDR SID SERIAL# PADDR USERNAME STATUS
---------------- ---------- ---------- ---------------- ------------------------------ --------
000000011FA9D990 9 13 000000011F8DB590 T_PIS_USER KILLED
000000011FC6B120 166 4 000000011F7B70A0 B_PIS_USER INACTIVE
000000011FC682B0 167 5 000000011F7B0F20 B_PIS_USER INACTIVE
000000011FE49F50 317 5 000000011F7AEEA0 SYS ACTIVE
000000011FE2CEF0 327 9 000000011F7B80E0 T_PIS_USER INACTIVE
2、找到要删除用户的sid和serial,并删除
SQL> alter system kill session '327,9';
System altered.
3、删除用户
SQL> drop user t_pis_user cascade;
User dropped.
阅读(4211) | 评论(0) | 转发(0) |