ORA-01940: 无法删除当前连接的用户(解决办法)

来源:互联网 发布:一建考试分享 知乎 编辑:程序博客网 时间:2024/05/19 18:42
SQL> drop user lisi;drop user lisiORA-01940: 无法删除当前连接的用户SQL> select username,sid,serial# from v$session where username is not null;USERNAME                              SID    SERIAL#------------------------------ ---------- ----------AAA                                    12         28AAA                                    13        186AAA                                    21        204AAA                                    24         45AAA                                   143        206LISI                                  145        4876 rows selectedSQL> select username,sid,serial# from v$session where username='LISI';USERNAME                              SID    SERIAL#------------------------------ ---------- ----------LISI                                  145        487SQL> alter system kill session '145,487';System alteredSQL> drop user lisi cascade;SQL> User droppedSQL> select username,sid,serial# from v$session where username='LISI';USERNAME                              SID    SERIAL#------------------------------ ---------- ----------LISI                                  145        487SQL> select username,sid,serial# from v$session where username is not null;USERNAME                              SID    SERIAL#------------------------------ ---------- ----------AAA                                    12         28AAA                                    21        204AAA                                    24         45AAA                                   143        206LISI                                  145        487SQL> alter system kill session'145,487';System alteredSQL> drop user lisi cascade;drop user lisi cascadeORA-01918: 用户 'LISI' 不存在SQL> select username,sid,serial# from v$session where username is not null;USERNAME                              SID    SERIAL#------------------------------ ---------- ----------AAA                                    12         28AAA                                    21        204AAA                                    24         45AAA                                   143        206LISI                                  145        487SQL> select username,sid,serial# from v$session where username is not null;USERNAME                              SID    SERIAL#------------------------------ ---------- ----------AAA                                    12         28AAA                                    21        204AAA                                    24         45AAA                                   143        206LISI                                  145        487
0 1
原创粉丝点击