Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Oracle, How do I alter a user that have a special character in the name?

I am using Oracle 11g and I need to unlock an specific user but this user have a dot in the name.For Example lets say my user name is 'foo.mock'. I know that adding this kind of characters in user names is not a good practice but I dont administrate the database.

So I tried with

Alter user foo.mock account unlock;

and with

Alter user 'foo.mock' account unlock;

and also tried to save the name in a variable and then use that variable in alter query but nothing worked.

Any Idea how to do this?

like image 876
Yoiku Avatar asked Sep 19 '25 09:09

Yoiku


1 Answers

You can enclose it in double quotes, but you need to match the case from dba_users, which is usually uppercase but may not be if it was created quoted:

alter user "FOO.MOCK" account unlock;

Read more about quoted and non-quoted identifiers.

like image 62
Alex Poole Avatar answered Sep 21 '25 13:09

Alex Poole