Hi Tom,
Could you please clarify, why I get the following error in standby database.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select log_mode, open_mode, database_role from v$database;
LOG_MODE OPEN_MODE DATABASE_ROLE
------------ -------------------- ----------------
ARCHIVELOG READ ONLY WITH APPLY PHYSICAL STANDBY
SQL> DECLARE
tst_row dual%ROWTYPE;
BEGIN
SET TRANSACTION READ ONLY;
END;
/
DECLARE
*
ERROR at line 1:
ORA-16000: database or pluggable database open for read-only access
Thanks.
Looks like a bug. We try to compile the type definition and temporarily store it in a table (which of course is not permitted)
Reproduced in 18 and 19 as well. Even if using temporary undo or a global temporary table, you'll still get it.
I've got some more info for you. Assuming you are planning on doing some "real" work, ie, DML etc...then you can redirect your anonymous block to the primary, for example:
SQL> DECLARE
2 tst_row dual%ROWTYPE;
3 BEGIN
4 null;
5 END;
6 /
DECLARE
*
ERROR at line 1:
ORA-16000: database or pluggable database open for read-only access
SQL> alter session enable adg_redirect_plsql;
Session altered.
SQL> DECLARE
2 tst_row dual%ROWTYPE;
3 BEGIN
4 null;
5 END;
6 /
PL/SQL procedure successfully completed.