Oracle DBA, How To, Error, Cause and Action

To View 12c Tablespaces

To view tablespace and it's corresponding container

SQL> col name form a12
SQL> SELECT file#, tbs.name, tbs.ts#, tbs.con_id
  2  FROM v$datafile dbf, v$tablespace tbs
  3  WHERE dbf.ts#=tbs.ts#
  4  AND dbf.con_id=tbs.con_id;
     FILE# NAME       TS#        CON_ID
---------- ------------ ---------- ------
1 SYSTEM  0 1
2 SYSTEM               0      2
3 SYSAUX 1      1
4 SYSAUX 1      2
5 UNDOTBS1 2 1
6 USERS  4      1
7 SYSTEM 0      3
8 SYSAUX 1      3
9 USERS 3      3
9 rows selected.



Extracted from Oracle 12c Document, CON_ID = 0 mean CDB. 

About Viewing Information When the Current Container Is the Root

When the current container is the root, a common user can view data dictionary information for the root and for PDBs by querying container data objects. A container data object is a table or view that can contain data pertaining to the following:
  • One or more containers
  • The CDB as a whole
  • One or more containers and the CDB as a whole
Container data objects include V$GV$CDB_, and some Automatic Workload Repository DBA_HIST* views. A common user's CONTAINER_DATA attribute determines which PDBs are visible in container data objects.
In a CDB, for every DBA_ view, there is a corresponding CDB_ view. All CDB_ views are container data objects, but most DBA_ views are not.
Each container data object contains a CON_ID column that identifies the container for each row returned. Table 43-1 describes the meanings of the values in the CON_ID column.

Table 43-1 CON_ID Column in Container Data Objects
Value in CON_ID ColumnDescription
0
The data pertains to the entire CDB
1
The data pertains to the root
2
The data pertains to the seed
3 - 254
The data pertains to a PDB
Each PDB has its own container ID.

No comments:

Post a Comment

Thanks for your comment.