I had an AskTOM question come in with an issue trying to PL/SQL on an Active Data Guard (ADG) database (which of course is running in read-only mode). The PL/SQL block seems innocuous; it does not DML and yet refuses to run:
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
I did a trace on the code, and made an interesting discovery, and hence the cause of the error. When we reference a ROWTYPE definition, we need a mechanism to refer to and compile against that definition of that type. Hence we temporarily “create” a type definition to handle that. Tracing the above anonymous block, you’ll see the following entries in the trace file
Recent comments
3 years 3 days ago
3 years 12 weeks ago
3 years 17 weeks ago
3 years 17 weeks ago
3 years 22 weeks ago
3 years 43 weeks ago
4 years 11 weeks ago
4 years 41 weeks ago
5 years 25 weeks ago
5 years 26 weeks ago