Utilice el script de esta sección para crear una solución de autoservicio y omitir las actualizaciones para que los entornos de Oracle Fusion Cloud Enterprise Performance Management se actualicen trimestralmente con un ciclo de prueba de seis semanas. En este caso, los entornos de producción se actualizan seis semanas más tarde que los entornos de prueba.
De forma predeterminada, Cloud EPM aplica una actualización mensual a sus entornos. Utilice el comando skipUpdate para omitir la aplicación de las actualizaciones mensuales en un entorno o para ver las solicitudes de omisión de actualización actuales. Puede automatizar la ejecución manual de los comandos skipUpdate con los scripts incluidos en esta sección. Estos scripts automatizan el proceso de omisión de actualización para que las actualizaciones se apliquen de forma trimestral con un ciclo de prueba de seis semanas.
Note:
Escenario de ejemplo: el ciclo de actualización del entorno de prueba se establece en el primer viernes de febrero (actualización 24.02), mayo (actualización 24.05), agosto (actualización 24.08) y noviembre (actualización 24.11). El entorno de producción se actualizará el tercer viernes de marzo (actualización 24.02) con la versión que se ha utilizado para actualizar el entorno de prueba el primer viernes de febrero (actualización 24.02). Una actualización similar en el entorno de producción tendrá lugar en la tercera semana de junio (actualización 24.05), septiembre (actualización 24.08) y diciembre (actualización 24.11). En este escenario, el entorno de producción no se actualiza a la fecha actual, sino con la fecha actual del entorno de prueba.
Script de Windows de ejemplo
Creeskip_update.ps1 copiando el siguiente script. Almacénelo en un directorio local. Consulte Ejecución del script para obtener información sobre la ejecución de 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 Linux/UNIX de ejemplo
Creeskip_update.sh copiando el siguiente script. Almacénelo en un directorio local. Consulte Ejecución del script para obtener información sobre la ejecución de 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 de Groovy
Cree el script de Groovyskip_update.groovy copiando el siguiente script y actualizándolo a continuación. Consulte Ejecución del script para obtener información sobre la ejecución de este script:
Actualice las siguientes variables en este script de Groovy:
username Nombre de usuario de un Administrador del servicio en el entorno en el que desea definir la cadencia de actualización no mensual.password Contraseña del administrador de servicio o nombre y ubicación del archivo de contraseña cifrado.url URL del entorno en el que desea definir una cadencia de actualización que no sea mensual.updateversions Lista separada por comas de actualizaciones de Cloud EPM que se deben aplicar al entorno identificado por el parámetro url. Por ejemplo, updateversions=02,05,08,11.
Las versiones se deben especificar con dos dígitos; incluya un cero delante para las actualizaciones 01 a 09. El script intenta ejecutar el comando skipUpdate para las actualizaciones no incluidas en el valor de parámetro updateversions. Por ejemplo, si especifica updateversions=02,05,08,11, el script intenta definir indicadores de omisión de actualización para las actualizaciones 01 (enero), 03 (marzo), 04 (april), 06 (junio), 07 (jullio), 09 (septiembre), 10 (octubre) y 12 (diciembre). En este caso, se aplican al entorno las actualizaciones de Cloud EPM 02 (febrero), 05 (mayo), 08 (agosto) y 11 (noviembre).
podtype Tipo de entorno de Cloud EPM. Los valores válidos son test y prod.proxyserverusername Nombre de usuario para autentificar una sesión segura con el servidor proxy que controla el acceso a Internet.proxyserverpassword Contraseña para autenticar el usuario con el servidor proxy.proxyserverdomain Nombre del dominio definido para el servidor proxy.Note:
Si no utiliza un servidor proxy, no especifique ningún valor para los parámetrosproxyserverusername, proxyserverpassword y 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')Creación del archivo input.properties para ejecutar scripts skip_update en Windows y Linux/UNIX
skip_update.ps1 o skip_update.sh, cree el archivo input.properties y actualícelo con información para el entorno. Guarde el archivo en un directorio local. El contenido de este archivo difiere en función del sistema operativo.
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 | Descripción |
|---|---|
javahome |
Ubicación JAVA_HOME. Solo para Linux/UNIX. |
epmautomatescript |
Ruta de acceso absoluta del ejecutable de EPM Automate (epmautomate.sh). Solo para Linux/UNIX. |
username |
Nombre de usuario de un administrador del servicio. |
password |
Contraseña del administrador de servicio o el nombre y la ubicación del archivo de contraseña cifrado. |
url |
URL del entorno en el que desea establecer una cadencia de actualización que no sea mensual. |
updateversions |
updateversions Lista separada por comas de actualizaciones de Cloud EPM que se deben aplicar al entorno identificado por el parámetro url. Por ejemplo, updateversions=02,05,08,11.
Las versiones se deben especificar con dos dígitos; incluya un cero delante para las actualizaciones 01 a 09. El script intenta ejecutar el comando skipUpdate para las actualizaciones no incluidas en el valor de parámetro |
podtype |
Tipo de entorno de Cloud EPM. Los valores válidos son test y prod. |
Ejecución del script
skip_update.ps1 o skip_update.sh copiando el script de una sección anterior.input.properties y guárdelo en el directorio en el que está ubicado el script skip_update. El contenido de este archivo difiere según su sistema operativo. Consulte Creación del archivo input.properties para ejecutar scripts skip_update en Windows y Linux/UNIX.
Asegúrese de que tiene privilegios de escritura en este directorio. Para Windows, puede que necesite iniciar PowerShell mediante la opción Ejecutar como administrador para poder ejecutar el script.
skip_update.ps1../skip_update.sh.skip_update.groovy y actualícelo según sea necesario.