Link to home
Start Free TrialLog in
Avatar of lium1
lium1

asked on

Delete username

I tried to delete username, but I got the following error:
-01752 can not delete from view without exactly one key-preserved table.
Redefine the view or delete from the underlying base tables.

Any suggestions in details.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Are you wanting to 'drop' an oracle user?

drop user user_name;

If they own objects like tables: drop user user_name cascade;
Avatar of lium1

ASKER

I don't want to drop him, just delete.
What do you mean by 'delete'?

If you mean remove them from the database, drop is what you want.
Avatar of lium1

ASKER

Drop is permanent and delete is not. What I meant is by deleting and not dropping cascade, I can save some user objects and I can reassign the user. Is there any syntax for deleting?
I'm still not understanding the terms you are using.

What are you wanting to do by 'reassign the user'?
Why is a 'delete' not permanent?

Anyway:  I don't think you can do what you are wanting to do.

You can export some objects using Oracle utilities.  Then you can import them into another schema.

You can create tables in another schema with a simple CTAS.
Avatar of lium1

ASKER

I meant delete just delete user name from the list, but not his other objects. Correct me if I am wrong. That's why I want to use delete.
From what 'list'?

You cannot remove a user from dba_users (or any of the views).  The user either exists or does not.

You cannot 'hide' them.
SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oracle does not offer a way to "delete" a user from the database, but keep any/all tables, procedures, views etc. that were owned by that user.  Also, Oracle does not offer a way to rename a user account (at least not a supported way).

Please clarify exacly which list you want to "delete" a user from.
I think, that you will not drop a user from database.
Do you need to delete a user from a table, that contains a field "User"?
In which system try you this operation?

Regards

Klaus
As johnsone:said, LOCK will be solution for your problem. but no one can access those objects owned by the locked user still we unlock the user.
That mean, you may give access privilege to someone else, but if we lock the owner account then the person who got access privilege can't access those objects
Avatar of lium1

ASKER

From OEM, I deleted user and it went successfully. But, later I saw that user was still there. Any explanation to this? Beside, markqeer said that Oracle does not offer a way to "delete" a user from the database, then what in OEM has capability to delete user, any explanation to this too!
What OEM screen were you on?
What version of OEM are you using?

A screenshot would help.

It is likely a bug in your version of OEM.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lium1

ASKER

I am on Oracle Database 11.2.0.2.0 Grid Infrastrurure. Under OEM, go tab Server ==> Security ==> User
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lium1

ASKER

Thanks guys.