10

I have some problem with creating user in Enterprise Oracle Database System. A could'n create user using command like

create user name identified by password;

because of exception:

ORA-65096: invalid common user or role name

So I found solution on Google:

alter session set container=PDBORCL;

and after that - is work. User was created.

But I can't log in to this account. What is wrong? I add all privileges to this account (CREATE SESSION of course too). I got error:

ORA-01017: invalid username/password; login denied.

What the hell is going on?

6 Answers 6

8

If you want to create a user that can admin any of the pluggable databases, prefix the username with C##.

For example:

create user c##name identified by password;
0
4

Please see the following to understand the issue

enter image description here

So even though you're connected with user SYSTEM to the pdb, when you issue connect without specifying the pdb, it'll try to connect to the container and the user is not defined there.

4

You could also prefix your script with

alter session set "_ORACLE_SCRIPT"=true;

http://www.dba-oracle.com/t_ora_65096_create_user_12c_without_c_prefix.htm

3

It's a new feature in 12c - Multitenant architecture:

http://docs.oracle.com/cd/E16655_01/server.121/e17633/cdblogic.htm#CNCPT89248

You tried to create a user in the root container database (CDB) which is intended for administration of one or more pluggable databases (PDB).

2

You created a user in a pdb. You need to connect to that pdb to be able to connect with the newly created user as the user is only known to that pdb if it is not a common user. To connect to the correct pdb you need to specify the correct service name in the connect string.

0

Do you need give the grant to create session next the line:

GRANT CREATE SESSION TO USERNAME WITH ADMIN OPTION;
1
  • I think you mean "You need to grant create session", or something.
    – Hannah Vernon
    Jan 10, 2017 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.