Use o script nesta seção para criar uma solução de autoatendimento para ignorar atualizações, de modo que os ambientes do Oracle Fusion Cloud Enterprise Performance Management sejam atualizados trimestralmente com um ciclo de teste de seis semanas. Nesse caso, os ambientes de produção são atualizados seis semanas após os ambientes de teste.
Por padrão, o Cloud EPM aplica uma atualização mensal a seus ambientes. Use o comando skipUpdate para ignorar a aplicação de atualizações mensais para um ambiente ou para exibir solicitações atuais de ignorar atualização. Você pode automatizar a execução manual dos comandos skipUpdate usando os scripts incluídos nesta seção. Esses scripts automatizam o processo de ignorar atualização para que as atualizações sejam aplicadas trimestralmente com um ciclo de teste de seis semanas.
Note:
Cenário de amostra: O ciclo de atualização do ambiente de teste é estabelecido nas primeiras sextas-feiras de fevereiro (atualização 24.02), maio (atualização 24.05), agosto (atualização 24.08) e novembro (atualização 24.11). O Ambiente de Produção será atualizado na terceira sexta-feira de março (atualização 24.02) com a versão que foi utilizada para atualizar o ambiente de teste na primeira sexta-feira de fevereiro (atualização 24.02). Atualização semelhante no ambiente de produção ocorrerá na terceira semana de junho (atualização 24.05), setembro (atualização 24.08) e dezembro (atualização 24.11). Nesse cenário, o ambiente de produção não é atualizado para a atualização atual, mas sim com a atualização que está atualmente no ambiente de teste.
Script de Amostra para Windows
Crieskip_update.ps1 copiando o script a seguir. Armazene-o em um diretório local. Consulte Execução do Script para obter informações sobre como executar este script:
# 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
Script de Amostra para Linux/UNIX
Crieskip_update.sh copiando o script a seguir. Armazene-o em um diretório local. Consulte Execução do Script para obter informações sobre como executar este script:
#!/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
processSkipUpdatesScript do Groovy
Crie o script Groovyskip_update.groovy copiando o script a seguir e atualizando-o. Consulte Execução do Script para obter informações sobre como executar este script:
Atualize as seguintes variáveis neste script Groovy:
username O nome de usuário de um Administrador de Serviço no ambiente em que você deseja definir a cadência de atualização não mensal.password A senha do Administrador de Serviço ou o nome e o local do arquivo de senhas criptografado.url O URL do ambiente em que você deseja definir a cadência de atualização não mensal.updateversions Uma lista de atualizações do Cloud EPM separadas por vírgulas que devem ser aplicadas no ambiente identificado pelo parâmetro url. Por exemplo, updateversions=02,05,08,11.
As versões devem ser especificadas com dois dígitos; inclua um zero à esquerda para atualizações de 01 a 09. O script tenta executar o comando skipUpdate para as atualizações não incluídas no valor do parâmetro updateversions. Por exemplo, se você especificar updateversions=02,05,08,11, o script tentará definir sinalizadores para ignorar as atualizações de 01 (janeiro), 03 (março), 04 (abril), 06 (junho), 07 (julho), 09 (setembro), 10 (outubro) e 12 (dezembro). Nesse caso, serão aplicadas no ambiente as atualizações de 02 (fevereiro), 05 (maio), 08 (agosto) e 11 (novembro) do Cloud EPM.
podtype Tipo de ambiente do Cloud EPM. Os valores válidos são test e prod.proxyserverusername O nome de usuário para autenticar uma sessão segura com o servidor proxy que controla o acesso à Internet.proxyserverpassword A senha para autenticar o usuário com o servidor proxy.proxyserverdomain O nome do domínio definido para o servidor proxy.Note:
Se você não usar um servidor proxy, não especifique qualquer valor para os parâmetrosproxyserverusername, proxyserverpassworde 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')Criação do Arquivo input.properties para Execução de scripts skip_update do Windows e Linux/UNIX
skip_update.ps1 ou skip_update.sh, crie o arquivo input.properties e atualize-o com as informações do seu ambiente. Salve o arquivo em um diretório local. O conteúdo desse arquivo muda de acordo com o sistema operacional.
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 Parâmetros de input.properties
| Parâmetro | Descrição |
|---|---|
javahome |
Localização de JAVA_HOME. Somente para Linux/UNIX. |
epmautomatescript |
Caminho absoluto do arquivo executável do EPM Automate executable (epmautomate.sh). Somente para Linux/UNIX. |
username |
Nome de usuário de um Administrador de Serviço. |
senha |
A senha do Administrador de Serviço ou o nome e a localização do arquivo de senha criptografado. |
url |
O URL do ambiente em que você deseja definir a frequência de atualização não mensal. |
updateversions |
updateversions Uma lista de atualizações do Cloud EPM separadas por vírgulas que devem ser aplicadas no ambiente identificado pelo parâmetro url. Por exemplo, updateversions=02,05,08,11.
As versões devem ser especificadas com dois dígitos; inclua um zero à esquerda para atualizações de 01 a 09. O script tenta executar o comando skipUpdate para as atualizações não incluídas no valor do parâmetro |
podtype |
Tipo de ambiente do Cloud EPM. Os valores válidos são test e prod. |
Execução do Script
skip_update.ps1 ou skip_update.sh copiando o script de uma seção anterior.input.properties e salve-o no diretório em que o script skip_update está localizado. O conteúdo desse arquivo varia em função do seu sistema operacional. Consulte Criação do Arquivo input.properties para Execução dos Scripts skip_update do Windows e Linux/UNIX.
Certifique-se de ter privilégios de gravação nesse diretório. Para Windows, pode ser que você precise iniciar o PowerShell usando a opção Executar como Administrador para poder executar o script.
skip_update.ps1../skip_update.sh.skip_update.groovy e atualize-o conforme a necessidade.