oci_database_pluggable_database

This resource provides the Pluggable Database resource in Oracle Cloud Infrastructure Database service.

Creates and starts a pluggable database in the specified container database. Pluggable Database can be created using different operations (e.g. LocalClone, RemoteClone, Relocate ) with this API. Use the StartPluggableDatabase and StopPluggableDatabase APIs to start and stop the pluggable database.

Example Usage

resource "oci_database_pluggable_database" "test_pluggable_database" {
	#Required
	container_database_id = oci_database_database.test_database.id
	pdb_name = var.pluggable_database_pdb_name

	#Optional
	container_database_admin_password = var.pluggable_database_container_database_admin_password
	defined_tags = var.pluggable_database_defined_tags
	freeform_tags = {"Department"= "Finance"}
	kms_key_version_id = oci_kms_key_version.test_key_version.id
	pdb_admin_password = var.pluggable_database_pdb_admin_password
	pdb_creation_type_details {
		#Required
		creation_type = var.pluggable_database_pdb_creation_type_details_creation_type
		source_pluggable_database_id = oci_database_pluggable_database.test_pluggable_database.id

		#Optional
		dblink_user_password = var.pluggable_database_pdb_creation_type_details_dblink_user_password
		dblink_username = var.pluggable_database_pdb_creation_type_details_dblink_username
		is_thin_clone = var.pluggable_database_pdb_creation_type_details_is_thin_clone
		refreshable_clone_details {

			#Optional
			is_refreshable_clone = var.pluggable_database_pdb_creation_type_details_refreshable_clone_details_is_refreshable_clone
		}
		source_container_database_admin_password = var.pluggable_database_pdb_creation_type_details_source_container_database_admin_password
	}
	should_create_pdb_backup = var.pluggable_database_should_create_pdb_backup
	should_pdb_admin_account_be_locked = var.pluggable_database_should_pdb_admin_account_be_locked
	tde_wallet_password = var.pluggable_database_tde_wallet_password
}

Argument Reference

The following arguments are supported:

Use RELOCATE_PDB for relocating the Pluggable Database from Source CDB and creating it in target CDB. This will relocate a pluggable database (PDB) to a different database from the source PDB. The source PDB must be in the READ_WRITE openMode when performing the relocate. * pdb_creation_type_details - (Optional) The Pluggable Database creation type. Use LOCAL_CLONE_PDB for creating a new PDB using Local Clone on Source Pluggable Database. This will Clone and starts a pluggable database (PDB) in the same database (CDB) as the source PDB. The source PDB must be in the READ_WRITE openMode to perform the clone operation. isThinClone options are supported for Exadata VM cluster on Exascale Infrastructure, Exadata Cloud@Customer VM Cluster on Exadata Cloud@Customer infrastructure, and Exadata Cloud VM cluster on cloud Exadata infrastructure Use REMOTE_CLONE_PDB for creating a new PDB using Remote Clone on Source Pluggable Database. This will Clone a pluggable database (PDB) to a different database from the source PDB. The cloned PDB will be started upon completion of the clone operation. The source PDB must be in the READ_WRITE openMode when performing the clone. For Exadata Cloud@Customer instances, the source pluggable database (PDB) must be on the same Exadata Infrastructure as the target container database (CDB) to create a remote clone. isThinClone options are supported for Exadata VM cluster on Exascale Infrastructure, Exadata Cloud@Customer VM Cluster on Exadata Cloud@Customer infrastructure, and Exadata Cloud VM cluster on cloud Exadata infrastructure. Use RELOCATE_PDB for relocating the Pluggable Database from Source CDB and creating it in target CDB. This will relocate a pluggable database (PDB) to a different database from the source PDB. The source PDB must be in the READ_WRITE openMode when performing the relocate. * creation_type - (Required) The Pluggable Database creation type. * dblink_user_password - (Applicable when creation_type=RELOCATE_PDB | REMOTE_CLONE_PDB) The DB link user password. * dblink_username - (Applicable when creation_type=RELOCATE_PDB | REMOTE_CLONE_PDB) The name of the DB link user. * is_thin_clone - (Applicable when creation_type=LOCAL_CLONE_PDB | REMOTE_CLONE_PDB) True if Pluggable Database needs to be thin cloned and false if Pluggable Database needs to be thick cloned. * refreshable_clone_details - (Applicable when creation_type=REMOTE_CLONE_PDB) Parameters for creating Pluggable Database Refreshable Clone. Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API. * is_refreshable_clone - (Applicable when creation_type=REMOTE_CLONE_PDB) Indicates whether Pluggable Database is a refreshable clone. * source_container_database_admin_password - (Required when creation_type=RELOCATE_PDB | REMOTE_CLONE_PDB) The DB system administrator password of the source Container Database. * source_pluggable_database_id - (Required) The OCID of the Source Pluggable Database. * pdb_name - (Required) The name for the pluggable database (PDB). The name is unique in the context of a container database. The name must begin with an alphabetic character and can contain a maximum of thirty alphanumeric characters. Special characters are not permitted. The pluggable database name should not be same as the container database name. * should_create_pdb_backup - (Optional) Indicates whether to take Pluggable Database Backup after the operation. * should_pdb_admin_account_be_locked - (Optional) The locked mode of the pluggable database admin account. If false, the user needs to provide the PDB Admin Password to connect to it. If true, the pluggable database will be locked and user cannot login to it. * tde_wallet_password - (Optional) The existing TDE wallet password of the CDB. * convert_to_regular_trigger - (Optional) (Updatable) An optional property when incremented triggers Convert To Regular. Could be set to any integer value. * refresh_trigger - (Optional) (Updatable) An optional property when incremented triggers Refresh. Could be set to any integer value. * rotate_key_trigger - (Optional) (Updatable) An optional property when incremented triggers Rotate Key. Could be set to any integer value.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Pluggable Database * update - (Defaults to 20 minutes), when updating the Pluggable Database * delete - (Defaults to 20 minutes), when destroying the Pluggable Database

Import

PluggableDatabases can be imported using the id, e.g.

$ terraform import oci_database_pluggable_database.test_pluggable_database "id"