Oracle 18c Non-CDB databases in the Oracle Database Cloud Service (ODBCS)
Oracle is implementing a cloud first approach and hence the newest releases such as Oracle Database 18c first appear in the Oracle Database Cloud Service (ODBCS). But only in the Container DB architecture for this PaaS offering. However, that doesn't mean that non-CDB databases can't still be created and used in the ODBCS PaaS by simply creating new instances using the DBCA.
CDB vs. Non-CDB
Since Oracle Database 12c, Oracle has been pushing the container database architecture. Some important points regarding this:- This is Oracle's strategic direction and while the traditional non-CDB architecture is possible but is officially "deprecated".
- Deprecated does not mean de-supported. See Mike Dietrich's blog for a discussion on that: https://blogs.oracle.com/upgrade/non-cdb-architecture-of-oracle-databases-is-deprecated-since-oracle-database-12102
- The multitenant option is only required for CDBs with more than user-created PDB. The Oracle documentation quote on this is: "The multitenant architecture with one user-created pluggable database (single tenant) is available in all editions without the Multitenant Option" Source: https://docs.oracle.com/database/121/DBLIC/options.htm#DBLIC2166
- There are very few limitations or technical restrictions with the multi-tenant option as of Oracle18c. The official documentation currently doesn't list any.
The cloud-first strategy
Oracle has adopted a cloud first strategy meaning that the newest databases releases are deployed to the Oracle Database Cloud Service (ODBCS) in both the Oracle Cloud Infrastructure (OCI) and Classic Oracle Cloud environments prior to downloadable releases for on-premises. As of the time of writing this, Oracle Database 18c is only available in the ODBCS (meaning PaaS) and is not downloadable. But that doesn't mean that you can't still test it both with and without the CDB architecture. The catch is that when you deploy 18c ODBCS instances as PaaS, Oracle will automatically create the database as a container database. There are no options for non-CDB database creations through the cloud instance creation wizards. And for reference, Francisco Munoz Alvarez has documented how to create ODBCS instances step-by-step in the Database Classic Cloud in his blog: https://oraclenz.org/?p=4219 However, the ODBCS isn't quite a true PaaS. Rather, I think it's more like a pre-configured IaaS offering with a database installed. Which really means that once we get access to the underlying server, we can essentially do anything we want. This includes spinning up new instances for which we can choose the architecture to use.Considerations
The first thing to consider is resources. If you want to add additional instances to the ODBCS then you'll need to ensure that you provision a machine shape (virtual or bare metal) with enough resources beforehand. Or alternatively, shut-down the PaaS Oracle templated instance if you want to create your own. The next thing to consider is supportability. But since Oracle generally licenses by the processing unit (CPU or oCPU) or machine shape in the cloud, this shouldn't be an issue. The Oracle documentation ( https://cloud.oracle.com/iaas/database/faq) actually says: Hence, it appears that we can add additional databases as needed as long as we're paying for the machine or "DB System".Creating a Non-CDB instance in the Database Classic Cloud
The first thing to do is provision a ODBCS database in the Database Classic Cloud. There is no option to create a non-CDB database: After creating, we can view some basic architectural properties: Nothing surprising there. But of course it is a CDB with the one PDB called "PDB1". We can't really "change" this instance to a non-CDB but we can stop it, optionally remove it and re-create it as a non-CDB from our ODBCS machine (meaning logging into the machine and sudo to "oracle") using a DBCA command as simple as:export ORACLE_SID=TRAD
export ORACLE_HOME=/u01/app/oracle/product/18.0.0/dbhome_1
export PATH=${ORACLE_HOME}/bin:${PATH}
read -s ORA_PWD
echo -e "\n\nORACLE_SID = "${ORACLE_SID} \
"\nORACLE_HOME = "${ORACLE_HOME}"\n\n"
cd ${ORACLE_HOME}/bin/
./dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbName ${ORACLE_SID} \
-sid ${ORACLE_SID} \
-sysPassword ${ORA_PWD} \
-systemPassword ${ORA_PWD} \
-emConfiguration NONE \
-datafileDestination '/u02/app/oracle/oradata/' \
-recoveryAreaDestination '/u04/app/oracle/fast_recovery_area' \
-storageType FS \
-datafileJarLocation $ORACLE_HOME/assistants/dbca/templates \
-automaticMemoryManagement FALSE \
-initparams sga_target=1500M
In the first few steps of the above, I simply assign some parameter data into environment variables for command reusability, and then echo them to ensure they're set correctly. Notice that for clarity (differentiation), I've changed the instance name from ORCL to TRAD. The actual DBCA command doesn't really differ from what we've used in previous versions. And of course the DBCA command arguments including initialization parameters can further be customized as needed. Finally, we could also use the DBCA to remove the Oracle PaaS created CDB instance if we wanted to. Once the command runs, that's it - the new non-CDB database is ready for use. Running the same architectural checks confirms it has been created as intended:
And that's all we have to do. We now have an Oracle18c non-CDB database in the Oracle Cloud to test or certify our applications against. And it's created in the ODBCS prior to the release of the downloadable on-premises version of Oracle18c.
Creating a Non-CDB instance in the Oracle Cloud Infrastructure (OCI)
The process in the OCI is almost exactly the same. There are however some key (general) differences between ODBCS in OCI and Database Classic:- OCI uses ASM (and of course Gird Infrastructure) where as Classic uses traditional filesystems for storage.
- The Database Templates provided in the Oracle Homes are different. Rather than the regular "General Purpose" template that we're used to, in the OCI there is only a single template called "seed_db".
- The Oracle home paths are slightly different: classic uses the full version "18.0.0" in the path where as OCI uses "18.1". (Incidentally, there are numerous places with inconsistencies in the ODBCS as to whether the version is 18.1 or 18.0.)
export ORACLE_SID=OCITRAD
export ORACLE_HOME=/u01/app/oracle/product/18.1/dbhome_1
export PATH=${ORACLE_HOME}/bin:${PATH}
read -s ORA_PWD
echo -e "\n\nORACLE_SID = "${ORACLE_SID} \
"\nORACLE_HOME = "${ORACLE_HOME}"\n\n"
cd ${ORACLE_HOME}/bin/
./dbca -silent -createDatabase \
-templateName seed_db.dbc \
-gdbName ${ORACLE_SID} \
-sid ${ORACLE_SID} \
-sysPassword ${ORA_PWD} \
-systemPassword ${ORA_PWD} \
-emConfiguration NONE \
-datafileDestination '+DATA' \
-recoveryAreaDestination '+RECO' \
-storageType ASM \
-datafileJarLocation $ORACLE_HOME/assistants/dbca/templates \
-automaticMemoryManagement FALSE \
-initparams sga_target=1500M
Also, notice the change in template name required to manually create a database in the OCI. Once run, the new, non-CDB instance looks as expected:
Conclusion
It's important to remember that the non-CDB architecture is deprecated and certainly not promoted by Oracle. And it makes sense to switch to the CDB architecture as soon as possible as it will eventually be mandatory. However, that day hasn't come yet and hence if you really must continue to use the non-CDB architecture then you can still get a jump start with testing Oracle Database 18c using the Oracle Database Cloud Service (either Classic or OCI) before the on-premises downloadable version of Oracle Database 18c is available.Share this
Previous story
← Which Cassandra version should I use (2018)?
Next story
Locally debug your serverless function →
You May Also Like
These Related Stories
HugePages for Oracle Database in Azure Cloud
HugePages for Oracle Database in Azure Cloud
Aug 22, 2018
4
min read
How to Create an Oracle SE2 Database and Avoid Licensing Problems
How to Create an Oracle SE2 Database and Avoid Licensing Problems
Jun 16, 2022
9
min read
Oracle Database 18c schema only accounts
Oracle Database 18c schema only accounts
Mar 16, 2018
5
min read
No Comments Yet
Let us know what you think