コンテナ一覧(SQLにてcdb_pdbsを参照する方法)
col PDB_ID for 9 col PDB_NAME for a10 col STATUS for a10
select PDB_ID,PDB_NAME,STATUS from cdb_pdbs ;
PDB_ID PDB_NAME STATUS
------ ---------- ----------
3 PDBORCL NORMAL
2 PDB$SEED NORMAL
SQL>
コンテナ一覧(sqlplusにてshowコマンドで表示する方法)
show pdbs ;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
SQL>
コンテナ切替
alter session set container=PDBORCL ;
以下実際に切り替えてみる
-- コンテナ切替前
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDBORCL READ WRITE NO
-- コンテナ切り替え
alter session set container=PDB$SEED
;
-- 切り替え後確認
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
SQL>
-- コンテナ切替(ルートへ)
alter session set container=CDB$ROOT
;
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
SQL>