1.锁定要删除的用户(以KAVINS用户为例)
alter user KAVINS account lock;
2.查看当前用户占用资源
SELECT SID, SERIAL#, USERNAME, STATUS
FROM V$SESSION
WHERE USERNAME = ‘KAVINS‘;
3,执行以下语句,删除2中查询结果status为INACTIVE 的记录
alter system kill session ‘sid,serial#‘;
例:alter system kill session ‘235,18’;
4,执行删除用户语句;
drop user KAVINS cascade;