HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

Oracle 12c create user

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
useroracle12ccreate

Problem

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?

Solution

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;

Code Snippets

create user c##name identified by password;

Context

StackExchange Database Administrators Q#60806, answer score: 8

Revisions (0)

No revisions yet.