Issue with drop user in Oracle
While Dropping a user if the drop user command is throwing error like:
ORA-01940: cannot drop a user that is currently connected
Follow the below steps:
select 'alter system kill session '''||sid||','||serial#||''' immediate;' "SQL Statement" from v$session where username=UPPER('&username');
SQL Statement
--------------------------------------------------------
alter system kill session '101,265842' immediate;
Execute the alter statement to kill the active session.
alter system kill session '101,265842' immediate;
System altered.
Now the drop user will work:
drop user <username> cascade;
Note: cascade option drops all the dependent objects under the schema.
No comments:
Post a Comment
If you have any queries/ any suggestion please do comment and let me know.