Running Multiple Instances of EPM Automate
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.
-
EPM Automate uses the environment variable
EPM_SID
to distinguish multiple sessions. This variable 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 uniqueEPM_SID
by modifying theexport EPM_SID=$$
statement in themultisession
script to use the passed in value, and then pass a unique value for this parameter in thecaller
script for each session, for example by specifying the value ofEPM SID
incaller.sh
as follows:$SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot1.zip" & $SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot2.zip" &
-
-
USERNAME
: Login ID of a Service Administrator -
PASSWORD
: Password of the Service Administrator -
URL
: Connection URL of the environment
Sample Windows Scripts
caller.BAT
@echo off
setlocal EnableExtensions EnableDelayedExpansion
REM syntax: start /B multisession.bat EPM_SID "USERNAME" "PASSWORD" "URL" "SNAPSHOTPATH"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "C:\Snapshot1.zip"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "C:\Snapshot2.zip"
endlocal
multisession.BAT
@echo off
set EPM_SID=%1
set USERNAME=%2
set PASSWORD=%3
set URL=%4
set SNAPSHOTNAME=%5
echo User: %USERNAME% > %EPM_SID%.log
echo Cloud Instance: %URL% >> %EPM_SID%.log
call epmautomate login %USERNAME% %PASSWORD% %URL% >> %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" "SNAPSHOTPATH" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot1.zip" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "/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
SNAPSHOTNAME=$4
echo User: $USERNAME > $EPM_SID.log
echo Cloud Instance: $URL >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh login $USERNAME $PASSWORD $URL >> $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