Translate

Monday 30 March 2015

Creating Users in Oracle 12c

User Creation - 12c

Starting from Oracle 12c there are two kinds of users.

1. Common User

2. Local User

Common User


1. Should Created as CDB$ROOT . You have the option to specify if you want to create the user in all container databases.

2. Username should be prefixed with c##

3. If we specify default tablespace, Quota etc we should ensure that they are present in PDB's as well.

Local User


1. Only local to a particular PDB

2. It will not be created in other databases.

3. We should alter the session and create the user.


Common User












CDB_USERS dictionary displays user information whether it is a common user,con_id etc.








CDB_USERS Dictionary



















Connect Common User to a PDB














Even though you have granted create session to C##CHANAKYA you are not able to connect to pluggable database.  Why?

This is because the user is not having create session privilege for that PDB. Make sure you use the below command to grant the privilege.

grant create session to username container=ALL;

.














Local User

Now lets create a common user in PDB and check


























We cannot connect to other PDB's because user is only local to that particular PDB. In our case

India user was created only in ORC2 hence we cannot connect to ORC1.










By using the CONTAINER clause we can specify in which particular PDB users should be created.


No comments:

Post a Comment