Create Database
This topic describes how to create a database in Oracle Base Database Cloud@Customer.
Before you begin, review the following:
- You cannot modify the
db_name,db_unique_name, or SID prefix after the database is created. - After the database is created, you cannot change the backup destination.
You can create a Database:
Using the Console
Perform the following steps in the Console.
-
On the Data Infrastructures list page, select the Data Infrastructure that you want to work with. If you need help finding the list page or the Data Infrastructure, see List Data Infrastructures.
- On the Data Infrastructure details page, select the VM Cluster tab to view the list of all VM Clusters.
- On the VM Clusters tab, select the VM Cluster that you want to work with.
-
On the VM Cluster details page, select the Databases tab to view the list of all databases.
-
On the Databases tab, select Create Database.
-
On the Create Database page, provide the following details.
-
Database name: Specify a user-friendly name to identify the database. The database name must follow these guidelines:
- Maximum of 8 characters
- Contains only alphanumeric characters
- Begins with an alphabetic character
- Must not match the first 8 characters of any
db_unique_nameon the VM Cluster - Must be unique within the VM Cluster
- Do not use
grid, because it is a reserved name - Do not use
ASM, because it is a reserved name
-
Unique name for the database: Optionally, specify a unique name for the database. This attribute defines the value of the
db_unique_namedatabase parameter. Thedb_unique_namemust follow these guidelines:- The value is not case-sensitive.
- Maximum of 30 characters
- Can contain alphanumeric characters and underscores (
_) - Begins with an alphabetic character
- Must be unique across the fleet or tenancy
If you do not specify a unique name, the
db_unique_namedefaults to the following format:<db_name>_<3-character unique string>_<region-name>If you plan to configure the database for backup to a Recovery Appliance backup destination, the unique database name must match the name configured in the Recovery Appliance.
-
Database version: From the list, select the Oracle AI Database software release that you want to deploy.
-
PDB name: (Optional) Specify the name for the first PDB. A PDB is created with the database.
To avoid potential service name collisions when using Oracle Net Services to connect to the PDB, ensure that the PDB name is unique across the VM Cluster. If you do not provide a PDB name, a system-generated name is used.
-
Database Home:
- Database Home source: Select an existing Database Home or create one, as applicable. This field is not available when you create a database from the Database Home details page.
- Select an existing Database Home: If one or more Database Homes already exist for the selected database version, this option is selected by default. Select a Database Home from the list.
- Create a new Database Home: If no Database Homes exist for the selected database version, this option is selected by default.
-
Database Home: Specify the name for the new Database Home.
-
Unified Auditing: (Optional) Enable the unified auditing if required. This is enabled by default for Oracle AI Database 26ai.
-
Database image: Determines what Oracle AI Database version is used for the database. You can mix database versions, but not editions. By default, the latest Oracle-published database Software Image is selected.
Select Change Database Image to use a different Oracle-published image or a custom database Software Image that you have created in advance, then select an Image type:
-
Oracle Provided Database Software Images: These images contain generally available versions of Oracle AI Database software.
-
Custom Database Software Images: These images are created by your organization and contain customized configurations of software updates. Use the Compartment and Database version filters to select the custom database Software Images from a specific compartment or Oracle AI Database software major release version.
The custom database Software Image must be based on an Oracle AI Database release that meets the following criteria:
-
The release is currently supported by OCI.
-
The release is supported by the hardware model you are provisioning.
-
After selecting a Software Image, select the Select button.
For the available Oracle AI Database major version releases, images are provided for the current version plus the three most recent older versions (N through N - 3). For example, if an instance is using Oracle Database 19c, and the latest version of 19c offered is 19.31.0.0, images available for provisioning are for versions 19.31.0.0, 19.30.0.0, 19.29.0.0 and 19.28.0.0.
-
- Database Home source: Select an existing Database Home or create one, as applicable. This field is not available when you create a database from the Database Home details page.
-
Administration password:
-
User name: Displays the user name.
- Password: Enter the Oracle AI Database administration password.
- This password is used for the following database administration accounts and functions:
- The password for the
SYSandSYSTEMusers - The Transparent Data Encryption (TDE) keystore password
- The
PDBADMINuser in the first PDB.
- The password for the
- The password must be:
- 9 to 30 characters long
- Contain at least:
- Two uppercase letters
- Two lowercase letters
- Two numeric characters
- Two special characters
- Use only the following special characters:
_#-
- Must not contain the tenancy name
- Must not contain reserved words, such as
OracleorTable, regardless of case
- This password is used for the following database administration accounts and functions:
- Confirm password: Reenter the password.
-
-
Backups:
-
Enable automatic backups: Turn on to enable automatic backups. Automatic backups are performed daily if enabled.
-
Backup destination type: Select a backup destination for the database. Select one of the following options:
-
Recovery Appliance: Stores backups in a previously defined Oracle Zero Data Loss Recovery Appliance backup destination.
- Compartment: Select the compartment for the Recovery Appliance backup.
- Backup destinations: Select a Recovery Appliance backup destination from the list.
- Recovery appliance connection string: Displays the connection string of the selected recovery appliance.
- VPC user: Select a virtual private catalog (VPC) user from the list.
- Password: Enter the password for the VPC user.
- Enter the source database’s TDE wallet or RMAN password: Enter the password.
- Real-time data protection: Turn on for continuous data protection. Real-time data protection minimizes the possibility of data loss.
-
Network File System (NFS): Stores backups in a previously defined Network File System (NFS) backup destination.
- Compartment: Select the compartment for the NFS backup.
- Backup destinations: Select a NFS backup destination from the list.
-
-
-
Encryption:
-
Key management: Select a key management. The default option is Oracle Wallet.
- Oracle Wallet:
- Use the administrator password for the TDE wallet: When this option is turned on, the password entered for the
SYSuser is also used for the TDE wallet. To specify a different TDE wallet password, clear this selection, and then enter and confirm the TDE wallet password.
- Use the administrator password for the TDE wallet: When this option is turned on, the password entered for the
- Oracle Key Vault:
- Compartment: Select the compartment that contains the keystore.
- Key Store: Select the keystore.
- External Keystore:
- TDE wallet password: Enter the TDE wallet password.
- External keystore credentials: Enter credentials in the format supported by the external keystore provider.
- Oracle Wallet:
-
-
Advanced Options: Expand to provide additional details.
-
Management: Expand to provide additional details.
-
Oracle SID prefix: Optionally, specify the Oracle SID prefix for the database. The instance number is automatically appended to the SID prefix to become the
instance_namedatabase parameter. If not provided, then the SID prefix defaults to thedb_name. -
Character Set: The character set for the database. The default is
AL32UTF8. -
National character set: The national character set for the database. The default is
AL16UTF16.
-
-
Tags: Expand to provide additional details. You can add free-form tags or defined tags to this resource. You must have permission to use the tag namespace for defined tags. For more information about using tags to manage your resources, see Tags. Tags can be applied later or at any time to a resource.
-
-
- Select Create.
The Database details page is now displayed. While the creation process is running, the state of the database is Provisioning. When the database creation process completes, the state of the database changes to Available.
Using dbaascli Utility
To create an Oracle AI Database in the specified database home of required version, use the dbaascli database create command.
You can use the dbaascli database create command to:
- Create a Container Database (CDB) or non-Container Database
- Create a CDB with pluggable databases (PDBs)
- Create an Oracle AI Database with the specified Character Set
-
Create Oracle Databases on a subset of cluster nodes
Note: Databases created on a subset of nodes will not be displayed in the OCI console.
- Create Oracle AI Database version 12.1.0.2 or higher with the release update JAN 2021 or higher. For databases with lower versions, it is recommended to use the OCI Console based API.
-
Connect to the virtual machine as the
opcuser.For detailed instructions, see Connecting to a Virtual Machine with SSH.
-
Start a
rootuser command shell:sudo -s -
Run the following command:
dbaascli database create --dbName database name --oracleHome Oracle Home PathParameters:
Parameter Description --dbNamespecifies the name of the database --oracleHomespecifies Oracle home location To create a CDB, run the following command:
dbaascli database create --dbName database name --oracleHome Oracle Home PathTo create a non-CDB, run the following command:
dbaascli database create --dbName database name --oracleHome Oracle Home Path --createAsCDB falseWhen prompted, enter the
sysandtdepasswords. -
Exit the
rootuser command shell:exitFor more details on advanced supported options, see
dbaascli database create.
Running Prerequisite Checks Prior to Creating Oracle AI Database
To run prerequisites checks, use the --executePrereqs command option. This will perform only the prerequisite checks without performing the actual Oracle AI Database creation.
-
Connect to the virtual machine as the
opcuser.For detailed instructions, see Connecting to a Virtual Machine with SSH.
-
Start a
rootuser command shell:sudo -s -
Run the following command:
dbaascli database create --dbName database name --oracleHome Oracle Home Path --executePrereqsParameters:
Parameter Description --dbNamespecifies the name of the database --oracleHomespecifies the Oracle home location -
Exit the
rootuser command shell:exitFor more details on advanced supported options, see
dbaascli database create.
Resuming or Reverting Oracle AI Database Creation Operation
To resume or revert a failed database creation operation, use the --resume or --revert command option.
For example:
dbaascli database create --dbName database name --oracleHome Oracle Home Path --resume
Note:
- While using the
--resumeor--revertcommand options, ensure that you use the same command from the same node that was used for actual create operation flow. - You can resume database creation only if there is a failure in the post database creation step.
Using dbaascli to Duplicate a Cloud Database
You can create a duplicate database using dbaascli. This new database can be in the same cloud region as the source region or across the regions. The following steps describe how to create a duplicate database on cloud.
Note: If a database is configured with OCI Vault for TDE encryption and you want to duplicate a database, then refer to the following sections.
Prepare for duplication:
Ensure that the following prerequisites are met:
-
Make sure that there is a network path setup to access the source database through the
EZConnectstring. -
Copy the TDE wallet file (
ewallet.p12) to the target database node. The node where you decide to run thedbaasclicommand. -
Create an Oracle home on the target node if required. Oracle home version must be the same version as the source or of higher RU version.
Run prerequisite checks:
To run prerequisites checks, use the --executePrereqs command option. This will perform only the prerequisite checks without performing the actual Oracle Database duplication.
dbaascli database duplicate --dbName <database name> --oracleHome <Oracle Home Path> --sourceDBConnectionString <source database EZConnect string> --sourceDBTDEWalletLocation <location of copied wallet> --sourceDBTdeConfigMethod FILE --tdeConfigMethod FILE --executePrereqs
Duplicate the database:
dbaascli database duplicate --dbName <database name> --oracleHome <Oracle Home Path> --sourceDBConnectionString <source database EZConnect string> --sourceDBTDEWalletLocation <location of copied wallet> --sourceDBTdeConfigMethod FILE --tdeConfigMethod FILE
Note: If source database is using OKV for TDE keystore management, current duplicate database operation does not support this configuration.
Duplicate an On-Premises Database
Using dbaascli, you can duplicate an on-prem database onto the cloud. This can be done with the dbaascli database duplicate command. This command creates a new database on the cloud, which is a duplicate of an on-prem database along with its data. While this process is going on, the on-prem database remains still operational. You can migrate your applications to the duplicated database on the cloud after due verification.
Prepare for duplication:
The migration process includes the following prerequisites to be met.
-
Make sure that there is a network path setup to access an on-prem database from the OCI node through the
EZConnectstring. -
If an on-prem database is configured with TDE, copy the TDE wallet file (
ewallet.p12) to the OCI node, where you decide to run thedbaasclicommand. -
Create an Oracle home on the OCI node if required. The Oracle home version must be the same as the source or of a higher RU version.
Verify the necessary RPMs:
This process requires a minimum dbaastools RPM version of
23.3.2.0.0 but updating to the latest dbaastools rpm is always recommended.
-
To check the currently installed version, run:
dbaascli --version DBAAS CLI version 23.3.2.0.0 -
To apply the latest tools RPM, as the
rootuser, run:# dbaascli admin updateStack
Run the prerequisite checks:
To run the prerequisite checks, use the --executePrereqs command option. This will perform only the prerequisite checks without performing the actual Oracle Database duplication.
dbaascli database duplicate --dbName <database name> --oracleHome <Oracle Home Path> --sourceDBConnectionString <source database EZConnect string> --sourceDBTDEWalletLocation <location of copied wallet> --executePrereqs
Duplicate the database:
Duplicate the database using the following command:
dbaascli database duplicate --dbName <database name> --oracleHome <Oracle Home Path> --sourceDBConnectionString <source database EZConnect string> --sourceDBTDEWalletLocation <location of copied wallet>
For example:
dbaascli database duplicate --sourceDBConnectionString xyzhost.oracle.com:1521/dbuniquename.oracle.com --dbName orcl --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_1 --sourceDBTDEWalletLocation /tmp/wallet_copy/tde --waitForCompletion false
Upon successful completion of this command, the database is duplicated to Cloud and ready for sanity checks for application usage. Once verification is done, application connections can be migrated to the Cloud database.
Refer to dbaascli database duplicate -help for additional configuration options.
Few considerations for migration:
-
If you prefer to allocate multiple channels for RMAN duplicate, you could do so by specifying the
--rmanParallelismargument. -
Oracle Base Database Cloud@Customer configures database memory as Automatic Shared Memory Management (ASMM). If your on-prem database is configured with different memory management, make sure to adjust memory parameter values accordingly on the OCI side by providing values for
--sgaSizeInMBand--pgaSizeInMB. -
Verify that the on-prem database does not contain any deprecated or invalid initialization parameters.
-
Database initialization parameters related to database storage (datafile location, redo location, recovery area destination, control file multiplexing) may be changed using the
--initParamsargument.For example, to override
db_create_online_log_destvalue for the duplicate database:--initParams db_create_online_log_dest_1=+DATAC1,db_create_online_log_dest_2=+RECOC1
Troubleshooting the database duplication:
-
dbaasclioperation log file can be found under/var/opt/oracle/log/<dbname>/database/duplicate -
One of the jobs of the duplicate is to run
dbca. Its log file can be found under/u02/app/oracle/cfgtoollogs/dbcaand/u02/app/oracle/cfgtoollogs/dbca/<dbuniquename>.
If the operation fails, you will have an option to resume the operation by providing the --resume argument to the same command. Alternatively, clean up the database using dbaascli database delete -dbname <dbname> -force, and then rerun the database duplicate command.