ORA-01940: cannot drop a user that is currently connected ..
SYS@mactlm1> drop user anuj cascade ;
drop user anuj cascade ;
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
find and kill session ...
set linesize 200 pagesize 200
col kill for a70
select username ,'alter system kill Session ' || ''''||s.sid ||','|| s.serial#||',@'||s.inst_id ||''''||' immediate;' kill from gv$session s
where username = '&USERNAME' ;
Now drop the user
drop user anuj
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteset linesize 200 pagesize 200
ReplyDeletecol kill for a70
select 'alter system kill Session ' || ''''||s.sid ||','|| s.serial#||',@'||s.inst_id ||''''||' immediate; ' kill from gv$session s
where username = '&USERNAME' ;