I'm new to pluggable databases and am puzzled by the dictionary views DBA_PDBS
and V$PDBS
. What's the differnence? The documentation is not helpful, either:
V$PDBS
displays information about PDBs associated with the current instance. 1
SELECT * FROM v$pdbs;
CON_ID NAME OPEN_MODE ...
2 PDB$SEED READ ONLY
3 XEPDB1 READ WRITE
DBA_PDBS
describes PDBs belonging to a given CDB. 2
SELECT * FROM dba_pdbs;
PDB_ID PDB_NAME STATUS ...
2 PDB_SEED NORMAL
3 XEPDB1 NORMAL
Internally, V$PDBS
seems to be based on SYS.X$CON
, while DBA_PDBS
is based on SYS.CONTAINERS$
.
There are similar cases with V$DATAFILE vs DBA_DATA_FILES or V$TABLESPACE vs DBA_TABLESPACES: in this case these views data are read from database control files and are likely redundant for restore/recovery purposes (ie when the SYSTEM tablespace is not yet available, DBAxxx views are not there but when database instance needs to work on datafiles and tablespaces). It's likely for the same reason that we have V$PDBS in addition to DBA_PDBS.