You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then relocate PDB2 to CDB2 with updated terraform as below, terraform apply -var-file="pdb_id.tfvars"
resource"oci_database_pluggable_database""this" {
container_database_id="YOUR-CDB2-OCID-HERE"// will trigger force replacement: create new pdb by relocating, then destroy to remove state of old pdbpdb_name="PDB2"pdb_admin_password="YOUR-OWN-PW-HERE"tde_wallet_password="YOUR-OWN-PW-HERE"pdb_creation_type_details {
creation_type="RELOCATE_PDB"source_container_database_admin_password="YOUR-OWN-PW-HERE"source_pluggable_database_id=var.pluggable_database_id
}
lifecycle {
create_before_destroy=true// create new pdb from source pdb before destoryignore_changes=[ pdb_creation_type_details ] // for idempotency
}
}
variable"pluggable_database_id" {
type=stringdefault=""
}
output"pluggable_database_id" {
value=oci_database_pluggable_database.this.id
}
The destroy of old pdb should be considered success as the state is already TERMINATED, which is handled by the PDB relocation.
Actual Behavior
New PDB is created in new CDB successfully by relocation and old PDB in old CDB is terminated in OCI. However, terraform return Error 409 when clearing the state of old pdb.
│ Error: 409-IncorrectState, The operation cannot be performed because the Pluggable Database with ID ocid1.pluggabledatabase.oc1.eu-milan-1.xxxxx is in the TERMINATED state.
Steps to Reproduce
1a. terraform apply
1b. terraform output > pdb_id.tfvars
2a. update the script with relocation part
2b. terraform apply -var-file="pdb_id.tfvars"
Community Note
Terraform Version and Provider Version
Terraform v1.9.8
Oracle/oci 6.21.0
Affected Resource(s)
oci_database_pluggable_database
Terraform Configuration Files
1a. create new PDB2 in CDB1 first.
1b. save ocid of pdb2 as tfvar
Debug Output
https://gist.github.com/chanstev/c073ff4a3ecbca5602ba3a4476a3caa1
Panic Output
n/a
Expected Behavior
The destroy of old pdb should be considered success as the state is already TERMINATED, which is handled by the PDB relocation.
Actual Behavior
New PDB is created in new CDB successfully by relocation and old PDB in old CDB is terminated in OCI. However, terraform return Error 409 when clearing the state of old pdb.
│ Error: 409-IncorrectState, The operation cannot be performed because the Pluggable Database with ID ocid1.pluggabledatabase.oc1.eu-milan-1.xxxxx is in the TERMINATED state.
Steps to Reproduce
1a.
terraform apply
1b.
terraform output > pdb_id.tfvars
2a. update the script with relocation part
2b.
terraform apply -var-file="pdb_id.tfvars"
Important Factoids
References
https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_pluggable_database
The text was updated successfully, but these errors were encountered: