이 섹션의 스크립트를 사용하여 Oracle Fusion Cloud Enterprise Performance Management 환경이 6주 테스트 주기에 따라 분기별로 업데이트되도록 업데이트를 건너뛰는 셀프 서비스 솔루션을 생성합니다. 이 경우 프로덕션 환경은 테스트 환경 6주 후에 업데이트됩니다.
기본적으로 Cloud EPM은 월별 업데이트를 환경에 적용합니다. skipUpdate 명령을 사용하면 환경에 월별 업데이트를 적용하는 것을 건너뛰거나 현재 업데이트 건너뛰기 요청을 볼 수 있습니다. 이 섹션에 포함된 스크립트를 사용하여 skipUpdate 명령 수동 실행을 자동화할 수 있습니다. 이러한 스크립트는 업데이트 건너뛰기 프로세스를 자동화하여 업데이트가 6주 테스트 주기에 따라 분기별로 적용되도록 합니다.
Note:
샘플 시나리오: 테스트 환경 업데이트 주기는 2월(24.02 업데이트), 5월(24.05 업데이트), 8월(24.08 업데이트), 11월(24.11 업데이트)의 첫번째 금요일로 설정됩니다. 프로덕션 환경은 2월(24.02 업데이트)의 첫번째 금요일에 테스트 환경을 업데이트하는 데 사용된 버전으로 3월(24.02 업데이트)의 세번째 금요일에 업데이트됩니다. 프로덕션 환경에 대한 비슷한 업데이트는 6월(24.05 업데이트), 9월(24.08 업데이트), 12월(24.11 업데이트)의 세번째 주에 발생합니다. 이 시나리오에서 프로덕션 환경은 현재 업데이트가 아니라 현재 테스트 환경에 적용된 업데이트로 업데이트됩니다.
Windows 샘플 스크립트
다음 스크립트를 복사하여skip_update.ps1을 생성합니다. 로컬 디렉토리에 파일을 저장합니다. 이 스크립트를 실행하는 방법에 관한 내용은 스크립트 실행을 참조하십시오.
# Skip Update PowerShell script
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$password="$($inputproperties.password)"
$url="$($inputproperties.url)"
$updateversions="$($inputproperties.updateversions)"
$podtype="$($inputproperties.podtype)"
$proxyserverusername="$($inputproperties.proxyserverusername)"
$proxyserverpassword="$($inputproperties.proxyserverpassword)"
$proxyserverdomain="$($inputproperties.proxyserverdomain)"
echo "Starting skip_update.ps1 script."
$monthsarr = ("01","02","03","04","05","06","07","08","09","10","11","12")
$global:monthsarrfromcurrent = @()
$global:yearsarrfromcurrent = @()
$updateversionsarr = $updateversions.Split(",")
$currentyear=Get-Date -Format yy
$currentmonth=Get-Date -Format MM
$nextyear=[int]$currentyear+1
function populateFromCurrentArrays() {
$startposition = 0
for ($i = 0; $i -le ($monthsarr.length - 1); $i++) {
if (${currentmonth} -eq $monthsarr[$i]) {
if (${podtype} -eq "prod") {
if (${updateversionsarr} -contains ${currentmonth}) {
$startposition=$i-2
} else {
$startposition=$i-1
}
} else {
if (${updateversionsarr} -contains ${currentmonth}) {
$startposition=$i
} else {
$startposition=$i-1
}
}
break
}
}
if (${startposition} -lt 0) {
$startposition=$startposition+12
}
for ($i = 0; $i -le ($monthsarr.length - 1); $i++) {
if (${i} -ge ${startposition}) {
$global:monthsarrfromcurrent += $monthsarr[$i]
$global:yearsarrfromcurrent += $currentyear
}
}
for ($i = 0; $i -le ($monthsarr.length - 1); $i++) {
if (${i} -lt ${startposition}) {
$global:monthsarrfromcurrent += $monthsarr[$i]
$global:yearsarrfromcurrent += $nextyear
}
}
}
function skipUpdateAdd($yearnumber, $monthnumber) {
echo "Running: epmautomate.bat skipUpdate add version=${yearnumber}.${monthnumber} comment=`"adding skipUpdate`""
epmautomate skipUpdate add version=${yearnumber}.${monthnumber} comment="adding skipUpdate"
}
function processSkipUpdates() {
$addcount = 0
$countlimit = 0
if (${podtype} -eq "prod") {
$countlimit = 3
} else {
$countlimit = 2
}
if ((${proxyserverusername} -eq "") -And (${proxyserverpassword} -eq "") -And (${proxyserverdomain} -eq "")) {
echo "Running: epmautomate.bat login ${username} ${password} ${url}"
epmautomate login ${username} ${password} ${url}
} else {
echo "Running: epmautomate.bat login ${username} ${password} ${url} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}"
epmautomate login ${username} ${password} ${url} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}
}
echo "Running: epmautomate.bat skipUpdate remove"
epmautomate skipUpdate remove
for ($i = 0; $i -le ($global:monthsarrfromcurrent.length - 1); $i++) {
$match = 1
if (${addcount} -eq ${countlimit}) {
echo "Update calls are completed. No more will be attempted."
break
}
for ($j = 0; $j -le ($updateversionsarr.length - 1); $j++) {
if ((${currentmonth} -eq $updateversionsarr[$j]) -And (${addcount} -gt 0)) {
$match = 1
break
}
if (($global:monthsarrfromcurrent[$i] -eq $updateversionsarr[$j]) -And (${addcount} -eq 0)){
$match = 0
break
}
}
if (${match} -eq 1) {
skipUpdateAdd $global:yearsarrfromcurrent[$i] $global:monthsarrfromcurrent[$i]
$addcount += 1
}
}
echo "Running: epmautomate.bat skipUpdate list"
epmautomate skipUpdate list
echo "Running: epmautomate.bat logout"
epmautomate logout
}
function compareUpdateMonths($thismonth, $nextmonth) {
$nextmonthorig=${nextmonth}
if (${nextmonth} -lt ${thismonth}) {
$nextmonth+=12
}
$monthdiff = $nextmonth - $thismonth
if (${monthdiff} -gt 4) {
echo "There are more than 3 versions skipped from version ${thismonth} to version ${nextmonthorig}. Please correct updateversions in input.properties so that there are not more than three versions skipped between each update version. Exiting."
exit 1
}
}
function validateUpdateVersions() {
for ($i = 0; $i -le ($updateversionsarr.length - 1); $i++) {
$nextint = $i + 1
$thisupdatemonth = $updateversionsarr[$i]
$thisupdatemonthint=[int]$thisupdatemonth
$nextupdatemonth=$updateversionsarr[$nextint]
$nextupdatemonthint=[int]$nextupdatemonth
if (${nextupdatemonth} -eq "") {
$nextupdatemonth=$updateversionsarr[0]
$nextupdatemonthint=[int]$nextupdatemonth
}
compareUpdateMonths $thisupdatemonthint $nextupdatemonthint
}
}
validateUpdateVersions
populateFromCurrentArrays
processSkipUpdates
Linux/UNIX 샘플 스크립트
다음 스크립트를 복사하여skip_update.sh를 생성합니다. 로컬 디렉토리에 파일을 저장합니다. 이 스크립트를 실행하는 방법에 관한 내용은 스크립트 실행을 참조하십시오.
#!/bin/sh
. ./input.properties
echo "Starting skip_update.sh script."
export JAVA_HOME=${javahome}
declare -a monthsarr=(01 02 03 04 05 06 07 08 09 10 11 12)
declare -a monthsarrfromcurrent
declare -a yearsarrfromcurrent
updateversionsarr=( $(echo "${updateversions}" | sed 's/,/ /g') )
currentyear=$(date +%y)
nextyear=$((currentyear+1))
currentmonth=$(date +%m)
populateFromCurrentArrays() {
local startposition=0
for i in ${!monthsarr[@]}
do
if [[ "${currentmonth}" == "${monthsarr[$i]}" ]]
then
if [[ "${podtype}" == "prod" ]]
then
if [[ ${updateversionsarr[@]} =~ ${currentmonth} ]]
then
startposition=$((i-2))
else
startposition=$((i-1))
fi
break
else
if [[ ${updateversionsarr[@]} =~ ${currentmonth} ]]
then
startposition=$i
else
startposition=$((i-1))
fi
break
fi
fi
done
if [[ ${startposition} -lt 0 ]]
then
startposition=$((startposition+12))
fi
for i in ${!monthsarr[@]}
do
if [[ ${i} -ge ${startposition} ]]
then
monthsarrfromcurrent=("${monthsarrfromcurrent[@]}" "${monthsarr[$i]}")
yearsarrfromcurrent=("${yearsarrfromcurrent[@]}" "${currentyear}")
fi
done
for i in ${!monthsarr[@]}
do
if [[ ${i} -lt ${startposition} ]]
then
monthsarrfromcurrent=("${monthsarrfromcurrent[@]}" "${monthsarr[$i]}")
yearsarrfromcurrent=("${yearsarrfromcurrent[@]}" "${nextyear}")
fi
done
}
skipUpdateAdd() {
local yearnumber="$1"
local monthnumber="$2"
echo "Running: ${epmautomatescript} skipUpdate add version=${yearnumber}.${monthnumber} comment=\"adding skipUpdate\""
${epmautomatescript} skipUpdate add version=${yearnumber}.${monthnumber} comment="adding skipUpdate"
}
processSkipUpdates() {
local addcount=0
local countlimit=0
if [[ "${podtype}" == "prod" ]]
then
countlimit=3
else
countlimit=2
fi
if [[ "${proxyserverusername}" == "" ]] && [[ "${proxyserverpassword}" == "" ]] && [[ "${proxyserverdomain}" == "" ]]
then
echo "Running: ${epmautomatescript} login ${username} ${password} ${url}"
${epmautomatescript} login ${username} ${password} ${url}
else
echo "Running: ${epmautomatescript} login ${username} ${password} ${url} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}"
${epmautomatescript} login ${username} ${password} ${url} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}
fi
echo "Running: ${epmautomatescript} skipUpdate remove"
${epmautomatescript} skipUpdate remove
for i in ${!monthsarrfromcurrent[@]}
do
local match=1
if [[ ${addcount} -eq ${countlimit} ]]
then
echo "Update add calls are completed. No more will be attempted."
break
fi
for j in ${!updateversionsarr[@]}
do
if [[ "${currentmonth}" == "${updateversionsarr[$j]}" ]] && [[ ${addcount} -gt 0 ]]
then
match=1
break
fi
if [[ "${monthsarrfromcurrent[$i]}" == "${updateversionsarr[$j]}" ]] && [[ ${addcount} -eq 0 ]]
then
match=0
break
fi
done
if [[ ${match} -eq 1 ]]
then
skipUpdateAdd ${yearsarrfromcurrent[$i]} "${monthsarrfromcurrent[$i]}"
addcount=$((addcount+1))
fi
done
echo "Running: ${epmautomatescript} skipUpdate list"
${epmautomatescript} skipUpdate list
echo "Running: ${epmautomatescript} logout"
${epmautomatescript} logout
}
compareUpdateMonths() {
local thismonth=$1
local nextmonth=$2
local nextmonthorig=${nextmonth}
if [[ ${nextmonth} -lt ${thismonth} ]]
then
nextmonth=$((nextmonth+12))
fi
monthdiff=$((nextmonth-thismonth))
if [[ ${monthdiff} -gt 4 ]]
then
echo "There are more than 3 versions skipped from version ${thismonth} to version ${nextmonthorig}. Please correct updateversions in input.properties so that there are not more than three versions skipped between each update version. Exiting."
exit 1
fi
}
validateUpdateVersions() {
for i in ${!updateversionsarr[@]}
do
nextint=$((i+1))
thisupdatemonth="${updateversionsarr[$i]}"
thisupdatemonthint=${thisupdatemonth#0}
nextupdatemonth="${updateversionsarr[$nextint]}"
nextupdatemonthint=${nextupdatemonth#0}
if [[ ${nextupdatemonth} == "" ]]
then
nextupdatemonth="${updateversionsarr[0]}"
nextupdatemonthint=${nextupdatemonth#0}
fi
compareUpdateMonths ${thisupdatemonthint} ${nextupdatemonthint}
done
}
validateUpdateVersions
populateFromCurrentArrays
processSkipUpdatesGroovy 스크립트
다음 스크립트를 복사하여skip_update.groovy를 생성하고 업데이트합니다. 이 스크립트를 실행하는 방법에 관한 내용은 스크립트 실행을 참조하십시오.
이 Groovy 스크립트에서 다음 변수를 업데이트합니다.
username - 월별 이외의 업데이트 주기를 설정하려는 환경에서 서비스 관리자의 사용자 이름입니다.password - 서비스 관리자의 비밀번호 또는 암호화된 비밀번호 파일의 이름 및 위치입니다.url - 월별 이외의 업데이트 주기를 설정할 환경의 URL입니다.updateversions - url 매개변수로 확인된 환경에 적용해야 하는 Cloud EPM 업데이트의 쉼표로 구분된 목록입니다. 예: updateversions=02,05,08,11.
버전은 두 자리 숫자로 지정해야 합니다. 업데이트 01 ~ 09 앞에는 0이 포함됩니다. 이 스크립트는 updateversions 매개변수 값에 포함되지 않은 업데이트에 대해 skipUpdate 명령을 실행하려고 시도합니다. 예를 들어 updateversions=02,05,08,11을 지정하면 이 스크립트는 01(1월), 03(3월), 04(4월), 06(6월), 07(7월), 09(9월), 10(10월), 12(12월) 업데이트에 대해 업데이트 건너뛰기 플래그를 설정하려고 시도합니다. 이 경우 Cloud EPM 업데이트 02(2월), 05(5월), 08(8월), 11(11월)이 환경에 적용됩니다.
podtype - Cloud EPM 환경 유형입니다. 적합한 값은 test 및 prod입니다.proxyserverusername - 인터넷에 대한 액세스를 제어하는 프록시 서버를 사용하여 보안 세션을 인증할 사용자 이름입니다.proxyserverpassword - 프록시 서버를 사용하여 사용자를 인증할 비밀번호입니다.proxyserverdomain - 프록시 서버에 대해 정의된 도메인의 이름입니다.Note:
프록시 서버를 사용하지 않는 경우에는proxyserverusername, proxyserverpassword, proxyserverdomain 매개변수의 값을 지정하지 마십시오.import java.text.SimpleDateFormat
String username = 'service_administrator'
String password = 'examplePWD'
String url = 'example_EPM_URL'
String updateversions = '01,04,07,10'
String podtype = 'test'
String proxyserverusername = ''
String proxyserverpassword = ''
String proxyserverdomain = ''
def currentdate = new Date()
def yf = new SimpleDateFormat("yy")
def mf = new SimpleDateFormat("MM")
String[] monthsarr = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
List<String> monthsarrfromcurrent = new ArrayList<>()
List<String> yearsarrfromcurrent = new ArrayList<>()
String currentyear = yf.format(currentdate)
String nextyear = (currentyear.toInteger() + 1).toString()
String currentmonth = mf.format(currentdate)
String[] updateVersionsStringArr = updateversions.split(',');
def updateversionsarr = new int[updateVersionsStringArr.length];
for(int i = 0; i < updateVersionsStringArr.length; i++)
{
updateversionsarr[i] = Integer.parseInt(updateVersionsStringArr[i]);
}
def LogMessage(String message) {
def date = new Date()
def sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
println('[' + sdf.format(date) + '][GROOVY] ' + message);
}
def LogOperationStatus(EpmAutomateStatus opstatus) {
def returncode = opstatus.getStatus()
LogMessage(opstatus.getOutput())
LogMessage('return code: ' + returncode)
}
int CompareUpdateMonths(int thismonth, int nextmonth) {
int nextmonthorig = nextmonth
if (nextmonth < thismonth) {
nextmonth = nextmonth + 12
}
int monthdiff = nextmonth - thismonth
if (monthdiff > 4) {
LogMessage('There are more than 3 versions skipped from version ' + thismonth + ' to version ' + nextmonthorig + '. Please correct updateversions so that there are not more than three versions skipped between each update version. Exiting.')
return 1
}
return 0
}
int ValidateUpdateMonths(int[] updateversionsarr) {
for(int i = 0; i < updateversionsarr.length; i++)
{
int nextint = i + 1
String nextupdatemonth = ""
int nextupdatemonthint = 0
String thisupdatemonth = updateversionsarr[i]
int thisupdatemonthint = thisupdatemonth.toInteger()
if (nextint < updateversionsarr.length) {
nextupdatemonth = updateversionsarr[nextint]
} else {
nextupdatemonth = updateversionsarr[0]
}
nextupdatemonthint = nextupdatemonth.toInteger()
int returncode = CompareUpdateMonths(thisupdatemonthint, nextupdatemonthint)
if (returncode > 0) {
return 1
}
}
return 0
}
def SkipUpdateAdd(EpmAutomate automate, String yearnumber, String monthnumber) {
String yeardotmonth = yearnumber + '.' + monthnumber
LogMessage('Running: epmautomate skipUpdate add version=' + yeardotmonth + ' comment=\"adding skipUpdate\"')
EpmAutomateStatus status = automate.execute('skipupdate','add','version=' + yeardotmonth,'comment=\"adding skipUpdate\"')
LogOperationStatus(status)
}
LogMessage('Starting skip update processing')
EpmAutomate automate = getEpmAutomate()
// validate update months
int returncode = ValidateUpdateMonths(updateversionsarr)
if (returncode != 0) {
return 1
}
// populate arrays
int startposition = 0
for(int i = 0; i < monthsarr.length; i++)
{
if (currentmonth == monthsarr[i]) {
if (podtype.equals("prod")) {
if (updateVersionsStringArr.contains(currentmonth)) {
startposition = (i-2)
} else {
startposition = (i-1)
}
} else {
if (updateVersionsStringArr.contains(currentmonth)) {
startposition = i
} else {
startposition = (i-1)
}
}
break
}
}
if (startposition < 0) {
startposition = startposition + 12
}
for(int i = 0; i < monthsarr.length; i++)
{
if (i >= startposition) {
monthsarrfromcurrent.add(monthsarr[i])
yearsarrfromcurrent.add(currentyear)
}
}
for(int i = 0; i < monthsarr.length; i++)
{
if (i <= startposition) {
monthsarrfromcurrent.add(monthsarr[i])
yearsarrfromcurrent.add(nextyear)
}
}
// process skip updates
LogMessage("Operation: encrypt " + password + " oracleKey password.epw")
EpmAutomateStatus status = automate.execute('encrypt',password,"oracleKey","password.epw")
LogOperationStatus(status)
if ((proxyserverusername != null && proxyserverusername != '') && (proxyserverpassword != null && proxyserverpassword != '') && (proxyserverdomain != null && proxyserverdomain != '')) {
LogMessage("Operation: login " + username + " password.epw " + url + " ProxyServerUserName=" + proxyserverusername + " ProxyServerPassword=" + proxyserverpassword + " ProxyServerDomain=" + proxyserverdomain)
status = automate.execute('login',username,"password.epw",url,"ProxyServerUserName=" + proxyserverusername,"ProxyServerPassword=" + proxyserverpassword,"ProxyServerDomain=" + proxyserverdomain)
LogOperationStatus(status)
} else {
LogMessage("Operation: login " + username + " password.epw " + url)
status = automate.execute('login',username,"password.epw",url)
LogOperationStatus(status)
}
LogMessage('Running: epmautomate skipUpdate remove')
status = automate.execute('skipupdate','remove')
LogOperationStatus(status)
int addcount = 0
int countlimit = 0
if (podtype.equals("prod")) {
countlimit = 3
} else {
countlimit = 2
}
for (int i = 0; i < monthsarrfromcurrent.size(); i++) {
int match = 1
if (addcount == countlimit){
LogMessage('Update add calls are completed. No more will be attempted.')
break
}
for(int j = 0; j < updateversionsarr.length; j++) {
if ((Integer.parseInt(currentmonth) == updateversionsarr[j]) && (addcount > 0)) {
match = 1
break
}
if ((Integer.parseInt(monthsarrfromcurrent.get(i)) == updateversionsarr[j]) && (addcount == 0)) {
match = 0
break
}
}
if (match == 1) {
SkipUpdateAdd(automate, yearsarrfromcurrent.get(i), monthsarrfromcurrent.get(i))
addcount+=1
}
}
LogMessage('Running: epmautomate skipUpdate list')
status = automate.execute('skipupdate','list')
LogOperationStatus(status)
println(status.getItemsList())
LogMessage('Running: epmautomate logout')
status = automate.execute('logout')
LogOperationStatus(status)
LogMessage('Skip update processing completed')input.properties 파일을 생성하여 skip_update Windows 및 Linux/UNIX 스크립트 실행
skip_update.ps1 또는 skip_update.sh를 실행하려면 input.properties 파일을 생성하고 해당 환경에 대한 정보로 업데이트합니다. 로컬 디렉토리에 파일을 저장합니다. 이 파일의 콘텐츠는 운영 체제에 따라 다릅니다.
Windows
username=exampleAdmin password=examplePassword.epw url=exampleURL updateversions=01,04,07,10 podtype=test
Linux/UNIX
javahome=JAVA_HOME epmautomatescript=EPM_AUTOMATE_LOCATION username=exampleAdmin password=examplePassword.epw url=exampleURL updateversions=01,04,07,10 podtype=test
Table 3-15 input.properties 매개변수
| 매개변수 | 설명 |
|---|---|
javahome |
JAVA_HOME 위치입니다. Linux/UNIX에만 해당합니다. |
epmautomatescript |
EPM Automate 실행 파일의 절대 경로(epmautomate.sh)입니다. Linux/UNIX에만 해당합니다. |
username |
서비스 관리자.의 사용자 이름 |
password |
서비스 관리자의 비밀번호 또는 암호화된 비밀번호 파일의 이름 및 위치입니다. |
url |
월별 이외의 업데이트 주기를 설정할 환경의 URL입니다. |
updateversions |
updateversions - url 매개변수로 확인된 환경에 적용해야 하는 Cloud EPM 업데이트의 쉼표로 구분된 목록입니다. 예: updateversions=02,05,08,11.
버전은 두 자리 숫자로 지정해야 합니다. 업데이트 01 ~ 09 앞에는 0이 포함됩니다. 이 스크립트는 |
podtype |
Cloud EPM 환경 유형입니다. 적합한 값은 test 및 prod입니다. |
스크립트 실행
skip_update.ps1 또는 skip_update.sh를 생성합니다.input.properties 파일을 생성하고 skip_update 스크립트가 있는 디렉토리에 저장합니다. 이 파일의 콘텐츠는 운영 체제에 따라 다릅니다. input.properties 파일을 생성하여 skip_update Windows 및 Linux/UNIX 스크립트 실행을 참조하십시오.
이 디렉토리에서 쓰기 권한이 있어야 합니다. Windows의 경우 관리자 권한으로 실행 옵션으로 PowerShell을 시작해야 스크립트를 실행할 수 있습니다.
skip_update.ps1을 실행합니다../skip_update.sh를 실행합니다.skip_update.groovy Groovy 스크립트를 생성하고 필요에 따라 업데이트합니다.