Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL: How do I remove a user? 1

Status
Not open for further replies.

spook007

Programmer
Joined
May 22, 2002
Messages
259
Location
US
What is the SQL statement that I need to run in order to completely remove a user from my database? Can I use the following?

DELETE FROM DBA_USERS
WHERE USERNAME="USERNAME";
 
No. Directly updating the Oracle is almost never necessary or desirable. The right command to drop a user is

drop user user_id;

If the user owns tables or other database objects, this drop will fail. If you know for sure that you can drop all the objects owned by the user, you can fix this with a cascading drop. The syntax is

drop user user_id cascade;
 
My comment should have been "Directly updating the Oracle catalog is almost never necessary or desirable."
 
I'd be even more explicit, "Directly updating the Oracle catalog is a likely path to disaster and Oracle support will not even help you recover from it"

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top