EPM Automate enables you to remotely perform tasks within Oracle Enterprise Performance Management Cloud environments. You can create scripts that can complete a wide array of tasks and automate their run using a scheduler.

The Oracle Cloud Infrastructure (OCI) Object Storage service is an internet-scale, high-performance storage platform that offers reliable and cost-efficient data durability. OCI Object Storage can store an unlimited amount of unstructured data of any content type, including analytic data and rich content, like images and videos.

In this article, we will discuss how we can use EPM Automate command line interface (CLI) to back up the EPM snapshots onto the OCI Object Storage.

Prerequisites

We deploy a custom Python script for exporting logs in CSV format for a custom time range that require the following prerequisites:

Solution overview

The solution in this use case involves a custom shell script deployed on an OCI Compute instance with OCI CLI software developer kit (SDK) and EPM-Automate CLI installed.

The script uses EPM-Automate CLI command to download the EPM snapshots on the Compute Instance, then timestamps the snapshot file, and uses the OCI CLI to transfer this data to an OCI Object Storage bucket and removes the old snapshots and logs.

In this bucket, we create a cron job for running the script to automate the whole process for taking daily or weekly backups of the snapshots on OCI Object Storage. You can further use Object Storage’s lifecycle management policies to keep the backups of the snapshots for a set period and remove or archive the old snapshots.

A graphic depicting the architecture for the solution.

Script overview and deployment

Before we work on script deployment, we need to download the java openjdk and set up the correct JAVA_HOME path. Also, install OCI CLI and EPM Automate CLI.

As mentioned in the installation steps, extract the epmautomate file in a directory that has read, write, and run permissions. To run this script properly the script, keep the epmautomate directory with the proper permissions and a directory named “snapshots” (which you need to create) in the same directory.

We use the following shell-script for taking the backups of the EPM snapshots:

#!/bin/bash
export JAVA_HOME=[java-home-path]
export PATH=[epm-automate-path]:$PATH
export SNAPSHOT_DIR_PATH=[snapshot-dir-path]
rm -f $SNAPSHOT_DIR_PATH/snapshots/snapshot*
rm -f $SNAPSHOT_DIR_PATH/downloadfile*.log
echo 'Taking Backup from EPM....'
epmautomate.sh login '[epm-username]' '[epm-password]' [epm-url]
epmautomate.sh downloadfile 'Artifact Snapshot'
epmautomate.sh logout
name='snapshot'$(date +%Y%m%d%H%M%S)'.zip'
echo 'Moving snapshot in file'$SNAPSHOT_DIR_PATH'/snapshots/'$name’.......’
mv 'Artifact Snapshot.zip' $SNAPSHOT_DIR_PATH/snapshots/$name
echo 'Uploading'$name'in Object Storage....'
oci os object put -bn 
  
    –file $SNAPSHOT_DIR_PATH/snapshots/$name

  

Change the following placeholders with the values of your environment. The details of each placeholder are mentioned in line:

  • [JAVA-HOME-PATH]: Path to the java openjdk file

  • [EPM-AUTOMATE-PATH]: Path to the epmautomate bin file

  • [SNAPSHOT-DIR-PATH]: Path where the snapshot directory, epmautomate directory, and script are placed

  • [EPM-USERNAME]: Username for accessing your EPM environment

  • [EPM-PASSWORD]: Password for accessing your EPM environment

  • [EPM-URL]: URL for accessing your EPM environment

  • [OCI_BUCKET_NAME]: Name of the OCI Object Storage bucket where backups are stored

Conclusion

In this article, we discussed how we can use EPM Automate CLI to back up the EPM snapshots into OCI Object Storage.

Oracle Cloud Infrastructure provides Enterprise features for developers to build modern cloud applications. If you want to try out this blog for free, I recommend the Oracle Cloud Free Tier with US$300 credits for a 30-day free trial. Free Tier also includes several “Always Free” services that are available for an unlimited time, even after your free credits expire.