Q

Can't drop user connected to database

I have problem dropping a user from the database. I get the following error: "ORA-01940: cannot drop a user that is currently connected." But when I check the v$session table, I cannot see USERA connected.

I have problem dropping a user from the database.

drop user "USERA" cascade;

This gives me the following error:

ORA-01940: cannot drop a user that is currently connected

But when I check the v$session table, I cannot see USERA connected to the database.

It could be that USERA is connecting right after you query V$SESSION and then logging off before you query V$SESSION again. I would lock the account so the user can no longer log in. Use the following command:
ALTER USER usera ACCOUNT LOCK;

Come back in a day and the user will not be logged in, most likely. You should be able to drop the user. Or wait until you bounce the database and then drop the user shortly after startup.

I have to add that if USERA is connected to the database, then dropping that user will break someone's application. Make sure you really want to do this before proceeding.

This was first published in July 2006

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close