Adding an RDS for Oracle tenant database to your CDB instance
In the RDS for Oracle multi-tenant configuration, a tenant database is a PDB. To add a tenant database, make sure you meet the following prerequisites:
-
Your CDB has the multi-tenant configuration enabled. For more information, see Multi-tenant configuration of the CDB architecture.
-
You have the necessary IAM permissions to create the tenant database.
You can add a tenant database using the Amazon Web Services Management Console, the Amazon CLI, or the RDS API. You can't add multiple tenant databases in a single operation: you must add them one at a time. If the CDB has backup retention enabled, Amazon RDS backs up the DB instance before and after it adds a new tenant database.
To add a tenant database to your DB instance
Sign in to the Amazon Web Services Management Console and open the Amazon RDS console at https://console.amazonaws.cn/rds/
. -
In the upper-right corner of the Amazon RDS console, choose the Amazon Web Services Region in which you want to create the tenant database.
-
In the navigation pane, choose Databases.
-
Choose the CDB instance to which you want to add a tenant database. Your DB instance must use the multi-tenant configuration of the CDB architecture.
-
Choose Actions and then Add tenant database.
-
For Tenant database settings, do the following:
-
For Tenant database name, enter the name of your new PDB.
-
For Tenant database master username, enter the name of the master user for your PDB.
-
Choose either of the following credentials management options:
-
Managed in Amazon Secrets Manager
In Select the encryption key, choose either a KMS key that Secrets Manager creates or a key that you have created.
Note
We recommend Amazon Secrets Manager as the most secure technique for managing credentials. Additional charges apply. For more information, see Password management with Amazon RDS and Amazon Secrets Manager.
-
Self managed
To specify a password, clear the Auto generate a password check box if it is selected. Enter the same password in Master password and Confirm master password.
-
Under Additional configuration, enter the name of your PDB for Initial database name. You can't name the CDB, which has the default name
RDSCDB
.
-
-
For Tenant database character set, choose a character set for the PDB. The default is AL32UTF8. You can choose a PDB character set that is different from the CDB character set.
-
For Tenant database national character set, choose a national character set for the PDB. The default is AL32UTF8. The national character set specifies the encoding only for columns that use the
NCHAR
data type (NCHAR
,NVARCHAR2
, andNCLOB
) and doesn't affect database metadata.
For more information about the preceding settings, see Settings for DB instances.
-
-
Choose Add tenant.
To add a tenant database to your CDB with the Amazon CLI, use the command create-tenant-database with the following required parameters:
-
--db-instance-identifier
-
--tenant-db-name
-
--master-username
-
--master-user-password
This following example creates a tenant database named
mypdb2
in the RDS for Oracle CDB instance named
my-cdb-inst
. The PDB character set is
UTF-16
.
Example
For Linux, macOS, or Unix:
aws rds create-tenant-database --region us-east-1 \ --db-instance-identifier
my-cdb-inst
\ --tenant-db-namemypdb2
\ --master-usernamemypdb2-admin
\ --master-user-passwordmypdb2-pwd
\ --character-set-nameUTF-16
For Windows:
aws rds create-tenant-database --region us-east-1 \ --db-instance-identifier
my-cdb-inst
^ --tenant-db-namemypdb2
^ --master-usernamemypdb2-admin
^ --master-user-passwordmypdb2-pwd
^ --character-set-nameUTF-16
The output looks similar to the following.
...} "TenantDatabase" : { "DbiResourceId" : "db-abc123", "TenantDatabaseResourceId" : "tdb-bac567", "TenantDatabaseArn" : "arn:aws:rds:us-east-1:123456789012:db:my-cdb-inst:mypdb2", "DBInstanceIdentifier" : "my-cdb-inst", "TenantDBName" : "mypdb2", "Status" : "creating", "MasterUsername" : "mypdb2", "CharacterSetName" : "UTF-16", ... } }...