Cite:
“The non-CDB architecture is deprecated in Oracle Database 12c, and may be desupported and unavailable in a later Oracle Database release. Oracle recommends use of the CDB architecture.” (Oracle 12c Database Upgrade Guide, Chapter 8.1.1).
What does that mean?
First we must clarify some terms:
- Non-CDB: non Container Database. This is the “classic” database, which is usual, until version 11g inclusively.
- Multitenant Database: with a multitenant database we have a container database (CDB), to which several (max. 252) databases, the “Pluggable Databases”, can be attached.
- Single Tenant Database: a special version of the multitenant database, at which to one container database only one additional database (and the Seed Database) can be attached.
To illustrate the new (CDB) architecture once more:
The mentioned cite so means that in the future only this architecture will be supported.
By that two questions are coming up:
- How much is that?
- How do I get there?
Costs
According to the Oracle Licensing Guide multitenant database is a charged option of the Oracle Enterprise Edition. But with the following constraints:
„The multitenant architecture with one user-created pluggable database (single tenant) is available in all editions” Oracle Database Licensing Information 12c Release 1 (12.1) Page 1-2
In any case the concept of the multitenant database can be used without any additional costs.
Upgrade
You often read the following question:
“I’ve upgraded my Oracle 11g database to Oracle 12c. How can I convert the database into a CDB?”
The answer is simple: You just can’t!
This is due to the phrasing of the question: No database can be converted into a CDB, but into a PDB, which can be mount to a CDB then. So the correct question had to be:
“How can I convert the database into a PDB?”
Solution:
First you must create a CDB, if you did not do that already. This works the easiest with the Database Configuration Assistant:
In this example a container database named “CDBACFS” with a pluggable database “PLUGACFS1” is created. But be aware: If you did not license any multitenant database option, the maximum number of possible PDBs is reached by this. Alternatively in the “Advanced Mode” you can create a CDB without any pluggable database or you simply delete the PDB subsequently.
By this the scene is set for mounting your existing database as a new PDB to the CDB.
To mount an existing database to a CDB it has to have a so called “manifest”. That is a XML-file, which basically contains the structures of the database. So subsequently creating this XML structure is required:
% sqlplus sys/@WOLFGANG as sysdba SQL> STARTUP OPEN READ ONLY SQL> execute dbms_pdb.describe('/tmp/wolfgang.xml');
Of course, you can here also choose a different directory and name. Only the suffix “.xml” is mandatory.
Now the database can be mount to the CDB.
% sqlplus sys/@CDBACFS as sysdba SQL> CREATE PLUGGABLE DATABASE wolfgang USING '/tmp/wolfgang.xml' NOCOPY TEMPFILE REUSE;
As a last step the Data Dictionary of the pluggable database must be cleaned, as many elements are not needed in the PDB anymore:
SQL> ALTER SESSION SET CONTAINER = WOLFGANG; SQL> @?/rdbms/admin/noncdb_to_pdb
With these few steps the “old” database WOLFGANG is now available as a beautiful, new pluggable database WOLFGANG and can finally be opened.
SQL> ALTER DATABASE OPEN READ WRITE;
Hints
If you mount the database with “NOCOPY” like in this case, a few “bodies” are left over. Those are the control files, the redo log files and the undo tablespace of the old database, which should then finally be deleted.
If there was not already an explicit DBA before, so not SYS or SYSTEM, you may want to create an additional DBA (role PDB_DBA) for the PDB.
One last advice: I recommend you to start the change to a CDB architecture as soon as possible, because the challenges are lesser in the database upgrade but more in the administration of its new environment.
That contains:
- Most of your SQL or SHELL scripts will probably not work anymore.
- With the often used sqlplus / as sysdba you can however log in to the CDB but not to the PDB.
- To get an overview of the database structure you must now use CDB_-Views instead of DBA_-Views.