database:oracle:switch-to-pluggable-db-sqlplus
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
database:oracle:sqlplus [2020/04/14 14:29] – external edit 127.0.0.1 | database:oracle:sqlplus [2023/04/12 18:24] – odefta | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Switch to a pluggable db (Oracle 12) ====== | ====== 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> | <code sql> | ||
- | alter session set container=PMJ | + | conn SYS@PMJ as SYSDBA |
</ | </ | ||
+ | Then you'll be required to enter the SYS password. \\ | ||
+ | < | ||
+ | * If you use a non dba user, don't specify 'as SYSDBA' | ||
+ | * Here PMJ is the name of the pluggable database. | ||
+ | </ | ||
+ | |||
+ | Another way to switch to a PDB is to change the container: | ||
+ | |||
+ | <code sql> | ||
+ | alter session set container=PMJ; | ||
+ | </ | ||
+ | |||
+ | To go back to the CDB container: | ||
+ | |||
+ | <code sql> | ||
+ | alter session set container=CDB$ROOT; | ||
+ | </ | ||
+ | |||
====== Connect directly to a pluggable db ====== | ====== Connect directly to a pluggable db ====== |
database/oracle/switch-to-pluggable-db-sqlplus.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1