Database Reference
In-Depth Information
SQL> SHOW CON_NAME
CON_NAME
------------------------------
CDB$ROOT
SQL> GRANT CREATE TABLE TO c##my_dba CONTAINER=ALL;
Grant succeeded.
SQL> CONNECT c##my_dba/secret@CONT
Connected.
SQL> ALTER SESSION SET CONTAINER=lne6;
Session altered.
SQL> CREATE TABLE MY_TAB(X NUMBER, Y VARCHAR2(10));
Table created.
SQL>
Viewing Container Data from CDB$ROOT
In a multitenant environment, Oracle restricts access to the
X$
,
V$
,
GV$
, and
CDB_
views so
that they are not automatically available for all PDBs to a common user querying from the
CDB$ROOT
. Oracle Database provides access to these tables and views as container data objects.
Oracle allows you to grant access on these container data objects to users by specifying the
CONTAINER_DATA
clause in the
ALTER USER
statement.
The
CONTAINER_DATA
column is present in the
DBA_VIEWS
and
DBA_TABLES
dictionary
views, as well as the
ALL_
and
USER_
versions of the same. To find information about the
CONTAINER_DATA
attributes, query the
CDB_CONTAINER_DATA
data dictionary view, as in
the following example:
SQL> SHOW con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> SELECT USERNAME, OWNER, OBJECT_NAME, ALL_CONTAINERS, CONTAINER_NAME
2 FROM CDB_CONTAINER_DATA
3 ORDER BY OBJECT_NAME;
Search WWH ::
Custom Search