Oracle 23c: Hybrid Read-Only Mode for Pluggable Databases

Share on:

Overview:

  • Oracle 23c database introduces a new feature to open Pluggable database in a new mode called hybrid read-only
  • Hybrid read-only mode enables a PDB to operate as either read-write or read-only, depending on the user who is connected to the PDB
  • For Oracle Multitenant Database common users (like SYSTEM, or C##<USER>), the PDB will be in read-write mode
  • For Pluggable database local users (like HR, or SCOTT), the PDB will be restricted to read-only mode
  • Hybrid read-only mode enables you to patch and maintain an application in a safe mode for open PDBs without the risk of local users, including higher privileged common users, interfering with the ongoing maintenance operation of the PDB

In this blog, I’ll demonstrate opening a PDB in a hybrid read-only mode, and then test a DML command from common and local users.

 

Prerequisites:

  • Oracle Database 23c Free Developer Release
  • A Pluggable Database with HR Database schema

 

Step #1: Open a PDB in Hybrid Read-Only Mode

– Connect to the root container as SYS, close the PDB, then open the PDB in hybrid read-only mode.

SQL> alter pluggable database &PDB_NAME close immediate instances=all;
SQL> alter pluggable database &PDB_NAME OPEN HYBRID READ ONLY instances=all;

hybrid

Note: The pluggable database open mode will be READ WRITE even after opening in hybrid read-only mode.

 

Step #2: Testing a DML from a PDB Database Local User

– Connect to the PDB as HR and run a DML statement
– You will get the below error message

SQL Error: ORA-16000: Attempting to modify database or pluggable database that is open for read-only access.

hybrid2

hybrid3

 

Step #3: Testing a DML from a Common Database User

– Connect to the PDB as system HR and run a DML statement
– A DML statement will be executed without error

hybrid4

Share on:

More from this Author

Oracle 23c: Managing Flashback Database Logs Outside the Fast Recovery Area

Overview: In previous Database releases, you could store flashback database logs only in the fast recovery area Oracle 23c Database introduces the ... Read More

Oracle 23c: Read-Only Users and Sessions

Overview: Oracle 23c Database introduces a new feature to control whether a user or session is enabled for read-write operations, irrespective of the ... Read More

Back to Top