Running Multiple Instances of EPM Automate

You can run multiple instances of EPM Automate against one environment from the same directory. Similarly, you can run multiple instances of EPM Automate against different environments from the same or different directories.

For example, you may need to simultaneously refresh the Planning application cube in https://cloudpln.pbcs.us1.oraclecloud.com and https://testcloudpln.pbcs.us1.oraclecloud.com. In this scenario, you have two options:

  • Run two instances of EPM Automate from the same directory to refresh application cubes in different environments

  • Execute EPM Automate from separate directories to connect to the environments and then refresh application cubes

In both scenarios, each instance of EPM Automate works independently; logging out of one instance does not log you out of other instances. Activities initiated using EPM Automate continues to run to completion in the environment even if you sign out from the other instance.

This section contains Windows and Unix/Linux sample scripts (caller and multisession) that may be used to create two EPM Automate sessions to perform tasks. To run multiple simultaneous sessions, you must add the following connection information in the caller script, which calls the multisession script to run login, uploadfile, listfiles, and logout commands. You can modify the multisession script to perform tasks other than these. Make sure that both these scripts are stored in the same directory.

  • For caller.BAT only: EPM_SID: a unique numeric session identifier. This must be set in the caller script to a unique value for each session. In the sample scripts, it is set to unique values as follows:

    • In caller.BAT, EPM_SID is set to !RANDOM!, which assigns it a unique system generated number. This number is also used to generate the log files for each session. If you want to track the log file for each session, you may specify a unique number instead of !RANDOM!.

    • In caller.sh, EPM_SID is set to the process ID, which is unique. If you want to track the log file for each session, you may specify a unique EPM_SID by modifying the export EPM_SID=$$ statement in the multisession script to use the passed in value, and then pass a unique value for this parameter in the caller script for each session, for example by specifying the value of EPM SID in caller.sh as follows:

      $SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "/home/user/Snapshot1.zip" &
      $SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "/home/user/Snapshot2.zip" &
  • USERNAME: Login ID of a Service Administrator

  • PASSWORD: Password of the Service Administrator

  • URL: Connection URL of the environment

  • IDENTITYDOMAIN: identity domain of the environment

Sample Windows Scripts

caller.BAT

@echo off
setlocal EnableExtensions EnableDelayedExpansion

REM syntax: start /B multisession.bat EPM_SID "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "SNAPSHOTPATH"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "C:\Snapshot1.zip"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "C:\Snapshot2.zip"

endlocal

multisession.BAT

@echo off

set EPM_SID=%1
set USERNAME=%2
set PASSWORD=%3
set URL=%4
set IDENTITYDOMAIN=%5
set SNAPSHOTNAME=%6

echo User: %USERNAME% > %EPM_SID%.log
echo Cloud Instance: %URL% >> %EPM_SID%.log

call epmautomate login %USERNAME% %PASSWORD% %URL% %IDENTITYDOMAIN% >> %EPM_SID%.log
call epmautomate uploadfile %SNAPSHOTNAME% >> %EPM_SID%.log
call epmautomate listfiles >> %EPM_SID%.log
call epmautomate logout

Sample Bourne Shell Script

caller.sh
#!/bin/sh

set +x
SCRIPT_DIR=`dirname "${0}"`

# syntax: /home/user/multisession.sh "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "SNAPSHOTPATH" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "/home/user/Snapshot1.zip" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "IDENTITYDOMAIN" "/home/user/Snapshot2.zip" &
multisession.sh
#!/bin/sh

set +x

EPM_AUTOMATE_HOME=/home/user/epmautomate

export JAVA_HOME=/home/user/jre
export EPM_SID=$$

USERNAME=$1
PASSWORD=$2
URL=$3
IDENTITYDOMAIN=$4
SNAPSHOTNAME=$5

echo User: $USERNAME > $EPM_SID.log
echo Cloud Instance: $URL >> $EPM_SID.log

$EPM_AUTOMATE_HOME/bin/epmautomate.sh login $USERNAME $PASSWORD $URL $IDENTITYDOMAIN >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh uploadfile $SNAPSHOTNAME >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh listfiles >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh logout