ORACLE 12cR1 Common and Local users.

Common user is fresh concepts before 12c database .
 A common user is a database user that has the same identity in the root and in every existing and future PDB.
Every common user can connect to and perform operations within the root, and within any PDB in which it has privileges.
Every common user is either Oracle-supplied or user-created. Examples of Oracle-supplied common users are SYS and SYSTEM.

Common users have the following characteristics:
1.A common user can log in to any container (including CDB$ROOT) in which it has the CREATE SESSION privilege.but a common user
have different privilege in different pdbs.
2.The name of every user-created common user must begin with the characters c## or C##.
3.A common user resides in the root, but must be able to connect to every PDB with the same identity.
4. if c##dba is a common user that has privileges on multiple containers, 
then the c##dba schema in each of these containers may contain different objects.

Local Users in a CDB 
A local user is a database user that is not common and can operate only within a single PDB.
A local user have same funcation in a NO-CDB.

SQL> select NAME,CON_ID,PDB from v$services;
NAME                                                                     CON_ID PDB
-------------------------------------------------------------------------------------------------------------------------------- ---------- ------------------------------------------------------------
pdbemrep.com                                                                  3 PDBEMREP
EMREPXDB                                                                  1 CDB$ROOT
trsen.com                                                                  1 CDB$ROOT
SYS$BACKGROUND                                                                  1 CDB$ROOT
SYS$USERS                                                                  1 CDB$ROOT

SQL> sho con_name;
CON_NAME
------------------------------
CDB$ROOT

SQL> select username,common from dba_users

USERNAME                 COMMON
---------------------------------------- ------
ORACLE_OCM                 YES
OJVMSYS                  YES
SYSKM                     YES
XS$NULL                  YES
GSMCATUSER                 YES
MDDATA                     YES
SYSBACKUP                 YES
DIP                     YES
SYSDG                     YES
APEX_PUBLIC_USER             YES
SPATIAL_CSW_ADMIN_USR             YES
......
SQL> alter session set container=pdbemrep;
Session altered.

when we query dba_users on pdb ,then have user informations (common is NO)


SQL> show con_name
CON_NAME
--------
PDBEMREP

SQL>select username,common from dba_users
USERNAME                 COMMON
---------------------------------------- ------
BI                     NO
PM                     NO
IX                     NO
SH                     NO
OE                     NO
HR                     NO
SCOTT                     NO
ORACLE_OCM                 YES
OJVMSYS                  YES
SYSKM                     YES
XS$NULL                  YES
......

 

if we direct the pdb's any users ,then we can used network service way

first,query the listener informations and reference the servcie informations from v$services


LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 04-NOV-2016 19:40:43
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sitgc.trsen.cn)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                03-NOV-2016 15:49:10
Uptime                    1 days 3 hr. 51 min. 35 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.0.1.2/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/sitgc/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sitgc.trsen.cn)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=sitgc.trsen.cn)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/trsen/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "EMREPXDB.com" has 1 instance(s).
  Instance "EMREP", status READY, has 1 handler(s) for this service...
Service "trsen.com" has 1 instance(s).
  Instance "EMREP", status READY, has 1 handler(s) for this service...
Service "pdbemrep.com" has 1 instance(s).
  Instance "EMREP", status READY, has 1 handler(s) for this service...
The command completed successfully


[oracle@sitgc:/tmp]$sqlplus sh/sh@sitgc.trsen.cn:1521/pdbemrep.com
SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 4 19:40:54 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Last Successful login time: Fri Nov 04 2016 18:44:25 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show user;
USER is "SH"
SQL> show con_name;
CON_NAME
------------------------------
PDBEMREP
SQL> select tname from tab;
TNAME
--------------------------------------------------------------------------------
SALES
COSTS
TIMES
PRODUCTS
CHANNELS
PROMOTIONS