This article is reproduced from http://blog.itpub.net/29047826/viewspace-1453577/, Invasion and deletion.  12C has introduced pluggable libraries, and there are two types of administrative users: Local Users and public users. A local user is a user in a pluggable database (PDB), and there is no difference between a 12c version. A public user exists only in a pluggable environment and does not exist in a traditional database environment. How do you understand public users? It can be simply used as a container (CDB) user and can be utilized in each common and all pluggable database (PDB). This user is like a community of property management staff, from the community property to appoint and can manage all the community users. If you log in to the CDB database for the first time, creating a user in the traditional way will result in an error, because the user created in the CDB environment is a public user, and the syntax is different from the normal user. 1. Use Sqlplus to log on to pluggable databases [[email protected] ~]$ sqlplus/as sysdba 2. With Con_name you can see that the current logged-in environment is the CDB root library, and the CDB contains a pluggable library named PDB1. [email protected] > show con_name pdbs; con_name------------------------------cdb$root con_id con _name OPEN MODE RESTRICTED------------------------------------------------------------2 pdb$seed READ only NO3 PDB1 REA D WRITE no 3. To create a public user Bighero, you need to use C # #或者c # #作为该用户名的开头. [email protected] > Create User C # #bighero identified by Bighero; user created. if using the traditional method of creating users will error [ Email protected] > Create user Bighero identified by bighero;create user Bighero identified by Bighero*error at Li NE 1:ora-65096: Invalid common user or role name 4. Creating a common role, like common users, requires the use of C # #或者c # #作为角色名的开头. [email protected] > Create role C # #myroles container = all; Grant the DBA role to the common role C # #myroles for all Pdb[email protected] > Grant DBA to C # #myroles container = all; Grant public role to public user, use range for all pdb[email protected] > gr Ant C # #myroles to C # #bighero container = all; You can also use the grant Xx to user method to complete [email protected] > Grant DBA to C # #bighero identified by Bighero container = all; 5. Use public users to log in to CDB, the PDB to see if it is generic. Login PDB uses a link string already configured in TNSNames @pdb1[[email protected] ~]$ sqlplus C # #bighero/bigheroc##[email protected] > Show Con_name con_name------------------------------cdb$root [[email protected] ~]$ sqlplus c## Bighero/[email protected]c##[email protected] > show Con_name con_ The NAME------------------------------pdb1 link string is as follows: [[email protected] admin]$ cat tnsnames.orapdb1= ( DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.228.12) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (service_name = pdb1) ) ) 6. Creating users in the PDB and creating regular users is no different. Create user Baymax identified by Baymaxdefault tablespace baymax_comptemporary tablespace Tempquota Unlimited on baymax_comp; 7. Switching mode between CDB and PDB [email protected] > Alter session SET container = pdb1; [email protected] > Alter Session Set container = Cdb$root;
End of full text
Oracle 12c Create users