將快照複製到 Oracle Object Storage 或從中複製

本主題包含完成下列任務的範例指令碼:

  • 物件快照 (維護快照) 從 Oracle Enterprise Performance Management Cloud 複製到 Oracle Object Storage 分組,並附加快照複製日期來重新命名。
  • 將備份快照從 Oracle Object Storage 分組複製到 EPM Cloud

此區段中的指令碼會假設您已在 Oracle Object Storage 建立保留快照的分組。執行這些指令碼之前,請更新下列預留位置以針對您的用途自訂:

Table 3-1 參數和其值

預留位置 預期值
JAVA_HOME 安裝 EPM Automate 使用之 JDK 的目錄。

範例: ./home/JDK/bin

epmautomateExe 安裝 EPM Automate 的目錄。

範例: ./home/utils/EPMAutomate/bin

cloudServiceUser EPM Cloud 服務管理員的使用者 ID。

範例: John.doe@example.com

cloudServicePassword 服務管理員的密碼,或密碼檔案所在的位置。如果密碼包含特殊字元,請參閱處理特殊字元

範例: ex_PWD_213

cloudServiceUrl 要從中複製物件快照EPM Cloud 環境的 URL。

範例: https//test-cloud-id_Dom.pbcs.us1.oraclecloud.com

objectStorageUser Oracle Object Storage 中的使用者 ID。

若要將快照複製到 Object Storage,此使用者必須具有要對其複製快照之分組的寫入存取權。若要從 Object Storage 複製快照,此使用者必須具有要從中複製快照之分組的讀取存取權。

範例: jDoe

objectStoragePassword objectStorageUser 的密碼。

範例: example_PWD

objectStorageBucketUrl 要對其複製快照之 Oracle Object Storage 分組的 URL。請參閱 URL 格式的下列資訊來源:

範例: https//swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/axaxnpcrorw5/bucket-20210301-1359

snapshot 您要從 Oracle Object Storage 分組中複製之快照的名稱。

範例: Artifact Snapshot20210429.zip

將快照從 EPM Cloud 複製到 Oracle Object Storage 的範例 EPM Automate 指令碼

自訂並執行此指令碼以重新命名,然後將物件快照EPM Cloud 複製到 Oracle Object Storage 分組。

#!/bin/sh
export JAVA_HOME=<path_to_jdk>
epmautomateExe=<path_to_epmautomate_executable>
cloudServiceUser=<cloud_service _user>
cloudServicePassword=<cloud_service_password>
cloudServiceUrl=<cloud_service_url>
# User with write access to Object Storage bucket
objectStorageUser=<object_storage_user> 
objectStoragePassword=<object_storage_password>
objectStorageBucketUrl=<object_storage_bucket>
currentDate=`date +'%Y%m%d'`
sourceSnapshot="Artifact Snapshot"
targetSnapshot="${sourceSnapshot} ${currentDate}"
$epmautomateExe login ${cloudServiceUser} ${cloudServicePassword} ${cloudServiceUrl}
$epmautomateExe renamesnapshot "${sourceSnapshot}" "${targetSnapshot}"
$epmautomateExe copyToObjectStorage "${targetSnapshot}" ${objectStorageUser} ${objectStoragePassword} "${objectStorageBucketUrl}/${targetSnapshot}"
$epmautomateExe logout
exit 0

將快照從 Oracle Object Storage 複製到 EPM Cloud 的範例 EPM Automate 指令碼

自訂並執行此指令碼以將特定日期的物件快照從 Oracle Object Storage 分組複製到 EPM Cloud

#!/bin/sh
export JAVA_HOME=<path_to_jdk>
epmautomateExe=<path_to_epmautomate_executable>
cloudServiceUser=<cloud_service _user>
cloudServicePassword=<cloud_service_password>
cloudServiceUrl=<cloud_service_url>
# User with read access to Object Storage bucket
objectStorageUser=<object_storage_user> 
objectStoragePassword=<object_storage_password>
objectStorageBucketUrl=<object_storage_bucket>
snapshot=<desired_snapshot>
$epmautomateExe login ${cloudServiceUser} ${cloudServicePassword} ${cloudServiceUrl}
$epmautomateExe copyFromObjectStorage ${objectStorageUser} ${objectStoragePassword} "${objectStorageBucketUrl}/${snapshot}"
$epmautomateExe logout
exit 0