If you have created and enabled a new service and then created a pluggable database, you may receive this error if you want to switch the container containing the session.
Error:
ORA-44787: Service cannot be switched into
1 2 3 4 5 6 7 8 9 10 11 12 13 | [oracle@oradb labs]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Dec 19 20:36:17 2018 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> alter session set container=PDB1; ERROR: ORA-44787: Service cannot be switched into. |
Solution
The problem will not occur when the pluggable database is closed and opened. Or create service after creating pluggable database.
1 2 3 4 5 6 7 8 9 10 11 12 | SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> alter pluggable database PDB1 close immediate; Pluggable database altered. SQL> alter pluggable database PDB1 open; Pluggable database altered. |
You can then change the container without receiving this error.
1 2 3 | SQL> alter session set container=PDB1; Session altered. |