这个答案在很大程度上受到一个对话:
http://www.tek-tips.com/viewthread.cfm?qid=1395151&page=3
原文链接:https://www.f2er.com/oracle/206587.htmlALTER SYSTEM ENABLE RESTRICTED SESSION; begin for x in ( select Sid,Serial#,machine,program from v$session where machine <> 'MyDatabaseServerName' ) loop execute immediate 'Alter System Kill Session '''|| x.Sid || ',' || x.Serial# || ''' IMMEDIATE'; end loop; end;
我跳过杀死源于数据库服务器的会话,以避免终止Oracle与自身的连接。