This topic is included in our Multitenant slides for a long time. But whenever I want to point somebody to the blog post, I realize that it’s not on the blog yet. Actually I discussed this topic recently during a customer visit again. It’s time to put it on the blog. When you use Oracle Multitenant: Be aware of the silent COMPATIBLE change.

Photo by Clint Patterson on Unsplash
Mixed version environments
When you work with Oracle Multitenant, the sooner or later you will have mixed version environments. This may be CDBs with Oracle 12.1.0.2 or Oracle 12.2.0.1 together with new Oracle 19c CDBs. In case you can’t or won’t do an “Everything at once” upgrade, you rather will prefer and attempt an unplug/plug/upgrade for one or more PDBs.
My example shows only one PDB, but you can do this of course with as many PDBS as necessary.
Default COMPATIBLE
When you create a CDB in Oracle 12.2.0.1, it will get the default COMPATIBLE
value for Oracle 12.2.0.1: 12.2.0
. Please remember: Never use more than 3 numbers, and stay with the default for the release. When you create a 19c CDB, it will have COMPATIBLE=19.0.0
– this is expected. But here you may need to pay attention. And potentially you may want to change the default value in your creation scripts or templates.
See also:
Silent COMPATIBLE change
The danger here is: You unplug your PDB from CDB1 and plug it into CDB2. And at this point, COMPATIBLE gets increased silently. Of course, when you do a PLUG_COMPATIBILITY_CHECK, you will get a message in PDB_PLUG_IN_VIOLATIONS. But it is not required to do this check. Or, even it contains warnings, you are not forced to do anything. You can still unplug the PDB, and plug it into CDB2.
And then it happens.
And there is no way back anymore.
This is the danger.
At this point you can’t do the usual fallback activities anymore. No downgrade is possible as you did increase COMPATIBLE. Well, you didn’t – it just happened.
What would be the recommended way?
I recommend to have COMPATIBLE
set equally across all CDBs as long as you haven’t upgraded fully to 19c yet. This will prevent such situations where you destroy the quickest fallback possibility accidentially, the downgrade.
But this has two or three negative implications. At first, you can’t benefit from the new COMPATIBLE
-dependent features. Then you will need downtime again to adjust COMPATIBLE
later on. And the big question will be: When you do the above exercise with 50 PDBs in the target CDB, you potentially won’t be able to restart the entire CDB just to change COMPATIBLE
. Of course, you could run for a long while with COMPATIBLE=12.2.0
in 19c. But this may not be your desired solution. And finally, I know that there are different viewing angles regarding the test scenarios whether you may need to do separate tests with COMPATIBLE=12.2.0
, and later, with COMPATIBLE=19.0.0
.
The ideal solution would be if a PDB you plug in would keep its source COMPATIBLE
– and you could adjust it on a PDB level. But it hasn’t been implemented this way.
More Information and Links
- Everything at Once – Multitenant Upgrade from 12.1.0.2 to 12.2.0.1
- Unplug a 12.2.0.1 PDB and plug into the Cloud
- Unplug / Plug / Upgrade
- Database Migration from non-CDB to PDB β The COMPATIBLE pitfall
- When and how should you change COMPATIBLE?
- Should you change COMPATIBLE when you apply an RU?
- Unplugging, Plugging and Upgrading a PDB to a new CDB – Tech Paper
–Mike
We tested.. so we decided to go with pdb clone for 12c to 19c and then upgrade…for pdbs which are less than a tb. Cloning is additional time buts its no risk approach.
I would like to share different approach, what about if we plug PDB 12.2.1 into CDB 19.6 for example?
This means that if we can accomplish such a situation it will be very useful in order to have a high version of CDB and lower version of PDB.
But why?
very simple, due to the fact that you can accommodate in the single CDB 19c, different applications with different requirements from DB version perspective and this is one of the biggest problems.
What I did as the test is to plug 12.2 PDB into 19.6 CDB which is fine and still show me that PDB is under restricted mode.
Is there any special way to keep 12.2 PDB into 19.6 CDB and open for application?
Thanks for your feedback
No, there is no such feature on purpose.
Your 12.2 PDB has a 12.2 dictionary. As a mix of different dictionary versions within one CDB is not allowed, we (generously π ) allow you to open it RESTRICTED only.
If you want UNRESTRICTED, you need to upgrade it. But nevertheless, at this stage you can’t plug back anymore. Your PDB flies under COMPATIBLE=19.0.0 already when you plugged it in. You can’t plug back.
Cheers,
Mike
Very interesting…
I already test one case and it look like ok… with very basic tests.
What I did:
Create empty CDB with 12.2
Shutdown CDB and switch Oracle Home to 19.6 and copy all necessary files in order to startup CDB from new Oracle Home etc.
Startup Upgrade – run upgrade process with compatibility 12.2 – upgrade finish just fine.
After upgrade process compatibility is still 12.2
Plug-in PDB with 12.2 by adding compatibility parameter during the plug process in the xml files
Upgrade 12.2 PDB and this keep compatibility 12.2
—- results
SQL*Plus: Release 19.0.0.0.0 – Production on Wed Feb 19 23:34:44 2020
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> alter pluggable database TESTPDB open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
3 TESTPDB READ WRITE NO
SQL> show parameter comp
NAME TYPE VALUE
———————————— ———– ——————————
compatible string 12.2.0
Interesting
The idea is to have 19.6 Software with both CDB and PDB with compatible 12.2 and to be easy to change it to 19.6 when Application get certified with 19c
Yep – as COMPATIBLE is a “global” parameter which gets defined for the CDB$ROOT and applies automatically to all PDBs plugged in, this is the only chance you have. This is why I recommend my customers to leave COMPATIBLE on the “old” level as longs as they don’t have a “clean” (i.e. fully 19c) environment. Otherwise you may get in trouble when you unplug/plug.
Cheers,
Mike