oracle删除正在连接的用户(oracle 11.2.0.2之前)

1.
select 'ALTER SYSTEM KILL SESSION '||chr(39)|| sid||','||serial#||chr(39)||';'
from v$session
where username='TESTUSER';

 

2.
ALTER SYSTEM KILL SESSION '7,32';
ALTER SYSTEM KILL SESSION '21,80';
ALTER SYSTEM KILL SESSION '122,59';
ALTER SYSTEM KILL SESSION '129,4';
ALTER SYSTEM KILL SESSION '133,10';
ALTER SYSTEM KILL SESSION '136,94';
ALTER SYSTEM KILL SESSION '258,58';
ALTER SYSTEM KILL SESSION '365,7';
ALTER SYSTEM KILL SESSION '366,6';
ALTER SYSTEM KILL SESSION '367,4';
drop user testuser cascade; --务必和上面一起执行

 

--Oracle 11.2.0.2之后,可以使用alter user a rename to b identified by c

具体参考oracle官方文档或http://www.cnblogs.com/wbzhao/archive/2012/04/06/2434820.html

RAC版参考http://ylw6006.blog.51cto.com/470441/799261

 

你可能感兴趣的:(oracle删除正在连接的用户(oracle 11.2.0.2之前))