- V$CONTAINERS
displays information about PDBs and the root associated with the current instance
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> select con_id,name,open_mode from V$CONTAINERS
2 ;
CON_ID NAME OPEN_MODE
---------- -------------------- ----------
1 CDB$ROOT READ WRITE
2 PDB$SEED READ ONLY
3 ORCLPDB READ WRITE
SQL> alter session set container=orclpdb;
Session altered.
SQL> select con_id,name,open_mode from V$CONTAINERS;
CON_ID NAME OPEN_MODE
---------- -------------------- ----------
3 ORCLPDB READ WRITE
SQL>
SQL> alter session set container=cdb$root;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> col pdb_name for a15
SQL> select pdb_id,pdb_name, status from cdb_PDBS;
PDB_ID PDB_NAME STATUS
---------- --------------- ----------
3 ORCLPDB NORMAL
2 PDB$SEED NORMAL
SQL>
- The status column
some imprtant status
NEW - The PDB has never been opened since it was created
NORMAL - The PDB is ready to be used.
UNPLUGGED - The PDB has been unplugged. The only operation that can be performed on it is DROP PLUGGABLE DATABASE.
RELOCATING: The PDB is in the process of being relocated to a different CDB.
RELOCATED: The PDB has been relocated to a different CDB.
the status column
/*
some imprtant status
NEW - The PDB has never been opened since it was created
NORMAL - The PDB is ready to be used.
UNPLUGGED - The PDB has been unplugged. The only operation that can be performed on it is DROP PLUGGABLE DATABASE.
RELOCATING: The PDB is in the process of being relocated to a different CDB.
RELOCATED: The PDB has been relocated to a different CDB.
*/
SQL> alter session set container=orclpdb;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
ORCLPDB
SQL> select pdb_id,pdb_name, status from cdb_PDBS;
PDB_ID PDB_NAME STATUS
---------- ----------- ----------
3 ORCLPDB NORMAL
SQL>
'Database > Oracle' 카테고리의 다른 글
28 - [Oracle 19C] V$TABLESPACE vs cdb_tablespaces (0) | 2023.11.20 |
---|---|
27 - [Oracle 19C] V$DATAFILE vs cdb_data_files (0) | 2023.11.20 |
25 - [Oracle 19C] DB name and DB version and instance name. (0) | 2023.11.17 |
24 - [Oracle 19C] To query temps files (0) | 2023.11.17 |
23 - [Oracle 19C] To query data files (0) | 2023.11.17 |