Creating a Container Database (CDB) in Oracle Database Cloud Service Using dbaascli
As a database administrator working with Oracle Database Cloud Service (DBCS), you have powerful command-line tools at your disposal. One of these is dbaascli, which allows you to perform various database operations directly from the server. Today, I’ll walk you through creating a Container Database (CDB) using this utility.
Why Use dbaascli?
The dbaascli utility provides a streamlined way to perform common database administration tasks in Oracle Cloud environments. It’s particularly useful for:
- Automating database operations
- Performing tasks without needing to log in to the database directly
- Managing databases in Oracle Cloud environments
Creating a CDB with dbaascli
Here’s the command I recently used to create a new CDB in our Oracle Cloud environment:
dbaascli database create \
--dbName MYCDB1 \
--dbUniqueName MYCDB1 \
--dbSID MYCDB1 \
--oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_1 \
--dbCharset WE8MSWIN1252 \
--dbNCharset AL16UTF16 \
--createAsCDB true \
--nodeList vmhost1,vmhost2 \
--honorNodeNumberForInstance true
Let’s break down each parameter:
Required Parameters
--dbName: The global database name (MYCDB1 in this case)--dbUniqueName: The unique database name (typically same as dbName for single-instance databases)--dbSID: The system identifier for the database instance--oracleHome: The Oracle home directory where the database software is installed--createAsCDB: Set to “true” to create a Container Database
Character Set Parameters
--dbCharset: The database character set (WE8MSWIN1252 for Western European Windows)--dbNCharset: The national character set (AL16UTF16 for Unicode support)
RAC-Specific Parameters
--nodeList: Comma-separated list of nodes in the RAC cluster (vmhost1,vmhost2)--honorNodeNumberForInstance: When set to “true”, instance numbers will match node numbers
Post-Creation Steps
After running this command, you should:
- Verify the database creation was successful by checking the alert log
- Connect to the CDB using SQL*Plus or your preferred tool
- Create any required Pluggable Databases (PDBs) using the
CREATE PLUGGABLE DATABASEcommand - Set up any necessary backup and recovery procedures
Best Practices
- Naming Conventions: Use consistent naming for your databases to make administration easier
- Character Sets: Choose character sets carefully based on your application requirements
- RAC Configuration: For RAC environments, ensure all nodes are properly configured before database creation
- Documentation: Document your database creation parameters for future reference
Troubleshooting
If you encounter issues during database creation:
- Check the log files in the
$ORACLE_BASE/diag/rdbmsdirectory - Verify that the Oracle home path is correct
- Ensure you have sufficient storage space
- Check that all nodes in a RAC environment are accessible
The dbaascli utility is a powerful tool for Oracle Cloud database administrators. By mastering commands like this, you can efficiently manage your database environment while maintaining consistency across your infrastructure.
Have you used dbaascli for database operations? Share your experiences in the comments!
