Read-Only Session in Oracle 23ai

 One of the new parameters introduced in Oracle 23ai is the read_only parameter:

SQL> show parameter READ_ONLY
NAME TYPE VALUE
----- ----------- --------
read_only boolean FALSE

This parameter can only be configured at the session level. Setting this parameter to true disables the execution of DML and DDL statements within the session:

SQL> alter system set read_only=true scope=spfile;
ORA-32017: failure in updating SPFILE
ORA-02065: illegal option for ALTER SYSTEM
SQL> alter session set read_only=true;
Session altered.
SQL> delete tbl1;
ORA-28193: Can perform read operations only
SQL> drop table tbl1;
ORA-28193: Can perform read operations only

If a transaction is active within the session, enabling this parameter is not allowed:

SQL> delete tbl1;
1 row deleted.

SQL> alter session set read_only=true;
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-65023: active transaction exists in container

Comments

Popular posts from this blog

Oracle 21c Enhancements for TTS Export/Import

Oracle 23ai — Speed up IMPDP Using NOVALIDATE Constraints

Staging Tables in Oracle 23ai