User Tools

Site Tools


database:oracle:switch-to-pluggable-db-sqlplus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
database:oracle:switch-to-pluggable-db-sqlplus [2023/04/12 18:25] – removed - external edit (Unknown date) 127.0.0.1database:oracle:switch-to-pluggable-db-sqlplus [2023/07/04 19:36] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Switch to a pluggable db (Oracle 12) ======
  
 +After you are connected with sqlplus to a container database (which is happening by default), run the connect command inside your sqlplus session.
 +
 +<code sql>
 +conn SYS@PMJ as SYSDBA
 +</code>
 +Then you'll be required to enter the SYS password. \\
 +<note>
 +  * If you use a non dba user, don't specify 'as SYSDBA' clause.
 +  * Here PMJ is the name of the pluggable database. 
 +</note>
 +
 +Another way to switch to a PDB is to change the container:
 +
 +<code sql>
 +alter session set container=PMJ;
 +</code>
 +
 +To go back to the CDB container:
 +
 +<code sql>
 +alter session set container=CDB$ROOT;
 +</code>
 +
 +
 +====== Connect directly to a pluggable db ======
 +
 +<code>
 +sqlplus /nolog
 +connect SNT@PMJ
 +</code>