본문 바로가기

Database/Oracle

22 - [Oracle 19C] to change container (cdb_, dba_)

 

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 ORCLPDB			  READ WRITE NO


SQL> select count(1) from cdb_tables;

  COUNT(1)
----------
      4363

SQL>

 

 

 

컨테이너를 변경하면 변경된 컨테이너에 관련된 테이블만 조회가 되므로 카운트 개수가 다르다.

 

SQL>
SQL> alter session set container=orclpdb;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
ORCLPDB
SQL>
SQL> select count(1) from cdb_tables;

  COUNT(1)
----------
      2184

SQL>