Recovering a Compartment
Learn how to recover a compartment.
To recover a compartment, you must first select it from the list on the Compartment page. You may have to use the state filter to see the deleted compartment. Remember that deleted compartments are renamed by appending a random string of characters to the original compartment name. For example, CompartmentA might become CompartmentA.qR5hP2BD. Oracle displays the deleted compartment on the Compartments page for 90 days.
When you recover a deleted compartment, the name isn't changed. For example, if you recover a deleted compartment named CompartmentA.qR5hP2BD, the name remains the same. Because policy statements are updated to use the new names of deleted compartments, any policy statements that had referenced the deleted compartment now reference the recovered compartment.
- Open the navigation menu and click Identity & Security. Under Identity, click Compartments. A list of the compartments in your tenancy is displayed.
- In State, select Deleted.
- For the compartment you want to recover, click the , and then click Restore.
- At the prompt, click Restore.
Use the recover command and required parameters to recover a compartment:
export compartment_id=compartment_ocid # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/compartment/recover.html#cmdoption-compartment-id oci iam compartment recover --compartment-id compartment_ocid
For a complete list of flags and variable options for CLI commands, see
Run the RecoverCompartment operation to recover a compartment.