I have a CDB called ORCL, which has a PDB called ORCLPDB1.
SQL> select name, open_mode from v$pdbs;
NAME
--------------------------------------------------------------------------------
OPEN_MODE
--------------------
PDB$SEED
READ ONLY
ORCLPDB
READ WRITE
ORCLPDB1
MOUNTED
When I use sqlplus /@localhost:1521/orcl as sysdba
to connect to CDB, execute SELECT NAME, OPEN_MODE FROM v$database;
, I get:
NAME OPEN_MODE
------------------ ----------------------------------------
ORCL READ WRITE
Use sqlplus /@localhost:1521/orclpdb as sysdba
to connect to PDB, execute SELECT NAME, OPEN_MODE FROM v$database;
, I get:
SQL> SELECT NAME, OPEN_MODE FROM v$database;
NAME OPEN_MODE
------------------ ----------------------------------------
ORCL MOUNTED
My question is:
Why is the NAME always ORCL?
If you connect as a PDB, is the data in v$database the data of the currently connected PDB or the data of the CDB to which the PDB belongs?
Ackerven is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.