使用 API 管理受保護的資料庫

複查 REST API 端點清單以管理受保護的資料庫。

如需有關使用 API 和簽署要求的資訊,請參閱 REST API安全證明資料。如需 SDK 的相關資訊,請參閱軟體開發套件與命令行介面

使用下列 REST API 端點管理受保護的資料庫。

  • 建立受保護資料庫:CreateProtectedDatabase

    您可以執行 CreateProtectedDatabase API 的模擬執行,以便在實際建立受保護資料庫之前,先驗證是否符合所有先決條件。

    請參閱執行模擬執行以檢查建立受保護資料庫的準備程度

  • 刪除受保護資料庫:DeleteProtectedDatabase
  • 檢視受保護資料庫的詳細資訊:GetProtectedDatabase
  • 擷取受保護的資料庫組態詳細資訊:FetchProtectedDatabaseConfiguration
  • 修改受保護的資料庫:UpdateProtectedDatabase
  • 變更受保護資料庫區間:ChangeProtectedDatabaseCompartment
  • 取消刪除受保護的資料庫:CancelProtectedDatabaseDeletion
  • 排定刪除受保護資料庫:ScheduleProtectedDatabaseDeletion

執行模擬執行以檢查建立受保護資料庫的準備狀況

當您執行 CreateProtectedDatabase API,並將 opc-dry-run 選項設為 TRUE 時,會指示要求為乾式執行,在建立受保護資料庫之前先檢查是否有遺漏的先決條件。在模擬執行期間,CreateProtectedDatabase API 會傳回錯誤訊息,警告您任何遺漏的需求,而不會實際建立受保護的資料庫。如果發生錯誤,您可以複查、更正及重複模擬執行,直到 CreateProtectedDatabase 要求未傳回任何錯誤為止。

這些是您可以透過執行 CreateProtectedDatabase API 的模擬執行來識別的常見問題:

  • 復原服務子網路的可用 IP 位址不足,無法支援所需的專用端點數目。

    確定在用於資料庫 VCN 中復原服務作業的子網路中,仍有足夠的未配置 IP 位址可供使用。

    請參閱註冊復原服務子網路

  • 復原服務沒有管理所選區間中網路資源的權限。

    複查並指派必要的原則。請參閱 OCI 中 Oracle 資料庫使用復原服務所需的權限

  • 「復原服務」容量不足。

    複查您租用戶的服務限額並要求提高限額

    請參閱自治式復原服務限制

  • 復原服務資源超出配額限制

    複查並管理區間內的復原服務資源使用量。請參閱自治式復原配額

  • 具有相同資料庫 ID 的受保護資料庫已經存在

    選取其他資料庫以使用復原服務

  • 指定的保護原則不存在,或不是作用中狀態

    請參閱管理保護原則

  • 不符合註冊「復原服務」子網路的先決條件

    請確定先註冊「復原服務」子網路後,再對復原服務啟用自動備份。

    請參閱註冊復原服務子網路

範例 CreateProtectedDatabase API 的 9-1 模擬執行要求

此範例為模擬執行要求範例。

CreateProtectedDatabaseRequest createProtectedDatabaseRequest = CreateProtectedDatabaseRequest.builder()
.createProtectedDatabaseDetails(createProtectedDatabaseDetails)
.opcRetryToken("EXAMPLE-opcRetryToken-Value")
.opcDryRun(true)
.opcRequestId("UCCBPPQDHXIF5I7A11SS<unique_ID>").build();

這是模擬測試的範例輸出。

Status Code : 409
Service Code: IncorrectState
Error Message:
Authorization failed. Autonomous Recovery Service does not have the required security policies to 
manage virtual-network-family in the chosen compartment. 
See, 'Prerequisites for Using Recovery Service as a Automatic Backup Destination' in the 
Recovery Service documentation.

The following compartment quotas were exceeded: 
protected-database-backup-storage-gb in policy 'example-policy' by 1.

The prerequisite of registering a Recovery Service subnet is not met. 
Ensure that you register a Recovery Service subnet before enabling automatic backups. 
See, 'Register Recovery Service Subnet' in the Recovery Service documentation.
確定您複查並執行設定復原服務中描述的所有先決條件作業。