Check currently connected PDB name in Multitenant

Check the currently connected PDB in SQLPLUS session

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

SQL> show con_id
CON_ID
------------------------------
1

Change the currently connected database in Multitenant

SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
         4 PDB1                           READ WRITE NO
         5 PDB2                           READ WRITE NO

SQL> alter session set container=PDB1;
Session altered.

SQL> show con_name
CON_NAME
------------------------------
PDB1

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply