2016/03/10

Underscore (hidden) parameters in Multitenant database

It is pretty usual when your application needs some underscore (hidden) parameter to be set.
But what can happen in new Multitenant database.

[oracle@ora12c ~]$ sqlplus / as sysdba                                          

SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 10 15:45:21 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options                                         

SQL> sho con_name

CON_NAME
------------------------------
CDB$ROOT                      

SQL> alter session set container=pdb1;

Session altered.

SQL> sho con_name

CON_NAME
------------------------------
PDB1
SQL> sho parameter _connect_by_use_union_all
SQL> alter system set "_connect_by_use_union_all" = 'old_plan_mode';

System altered.

SQL> sho parameter _connect_by_use_union_all

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_connect_by_use_union_all            string      old_plan_mode
SQL> select value from v$spparameter where name='_connect_by_use_union_all';

VALUE
------------------------------------
old_plan_mode

SQL> alter pluggable database close immediate;

Pluggable database altered.

SQL> alter pluggable database open read write;

Pluggable database altered.

SQL> sho con_name

CON_NAME
------------------------------
PDB1
SQL> sho parameter _connect_by_use_union_all
SQL> select value from v$spparameter where name='_connect_by_use_union_all';

VALUE
------------------------------------
old_plan_mode

SQL>

So, you can set underscore parameter on PDB level but it is "disappeared" after reboot either PDB or whole CDB.
So far the only workaround I`ve found is to create LOGON trigger with corresponding parameter set by alter session statement.

No comments: