我想删除/终止对数据库的特定架构的连接。请你采取谨慎的方式来做到这一点吗?
干杯
答案 0 :(得分:3)
为了防止用户连接,您可以锁定帐户:
ALTER USER usr ACCOUNT LOCK;
如果要断开用户的所有会话,可以使用method described in another SO:
BEGIN
FOR x IN (SELECT Sid, Serial# FROM v$session WHERE username = 'USR') LOOP
EXECUTE IMMEDIATE 'Alter System Kill Session ''' || x.Sid || ','
|| x.Serial# || ''' IMMEDIATE';
END LOOP;
END;