Database Reference
In-Depth Information
USERNAME OWNER OBJECT_NAME ALL CONTAINER_
-------------------- -------- -------------------- --- ----------
GSMADMIN_INTERNAL SYS CDB_SERVICES Y
GSMADMIN_INTERNAL SYS GV_$ACTIVE_SERVICES Y
C##MY_DBA SYS V$SESSION N LNE6
C##MY_DBA SYS V$SESSION N PDB1
C##MY_DBA SYS V$SESSION N CDB$ROOT
APPQOSSYS SYS V_$WLM_PCMETRIC Y
SYSBACKUP Y
SYS Y
SYSTEM Y
DBSNMP Y
10 rows selected.
SQL>
The results of the query show that the common user
c##my_dba
can view the contents of
v$session
for the containers
CDB$ROOT
,
PDB1
, and
LNE6
.
Common User Access to Data in PDBs
Previously we gave an example of granting common users access to objects in PDBs. In the
example we used the
ALTER USER
statement to alter the common user
c##my_dba
so that this
user can access the contents of the
CDB_USERS
view in the
CDB$ROOT
and in the
PDB1
and
LNE6
PDBs when logged into
CDB$ROOT
.
SQL> CONNECT sys/system@CONT as SYSDBA
Connected.
SQL> ALTER USER c##my_dba
2 SET CONTAINER_DATA = (cdb$root, pdb1, lne6)
3 FOR cdb_users CONTAINER = CURRENT;
User altered.
SQL>
If you do not include the current container (in this case
CDB$ROOT
), you will receive an
ORA-65057 error message. The
ALTER USER
statement in this example modifies the settings
for the user
c##my_dba
as follows:
SET CONTAINER_DATA
lets user
c##my_dba
see the common
and local users in the
CDB$ROOT
and in the
PDB1
and
LNE6
PDBs when the user queries the
CDB_USERS
table from the root.
SQL> SELECT USERNAME, OWNER, OBJECT_NAME, ALL_CONTAINERS, CONTAINER_NAME
2 FROM CDB_CONTAINER_DATA
Search WWH ::
Custom Search