ORA-65040: operation not allowed from within a pluggable database

ORA-65040: operation not allowed from within a pluggable database

When running the switch logfile command in the PDB environment connected, you get the following error:

SQL> show pdbs
CON_ID      CON_NAME      OPEN MODE    RESTRICTED
----------- ------------  -----------  -----------
          3  PDB2         READ WRITE   NO

SQL> alter system switch logfile;
alter system switch logfiel
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database

Cause: Command runs from the PDB container database.

Solution: Redo log is handled by CDB database, so the command need to run from CDB ROOT. Connect the CDB root database and run the command.

SQL> alter session set container=cdb$root;
session altered.

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

SQL> alter system switch logfile;
system altered.

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