使用本节中的脚本可存档等于或超过指定天数的匹配事务(包括支持和调整详细信息),然后从 Account Reconciliation 中清除存档的事务。存档的匹配事务记录在 ZIP 文件中。
脚本的工作原理
input.properties 文件中的信息登录环境archiveTmTransactions 命令来创建存档。生成的 ZIP 文件和日志文件分别使用默认名称 Archive_Transactions_INTERCO_JOB_ID.zip 和 Archive_Transactions_INTERCO_JOB_ID.log
epmautomate archiveTmTransactions INTERCO 365 filterOperator=contains filterValue=14001
input.properties 文件来更改命令参数。purgeArchivedTmTransactions 命令(使用 archiveTmTransactions 作业的作业 ID)从应用程序中删除存档的匹配事务。重新运行该脚本
input.properties 文件,并使用环境信息进行相应的更新。将该文件保存到一个本地目录。在本次讨论中,此目录名为 parentsnapshotdirectory。此文件的内容因操作系统的不同而异。
请确保您对此目录具有写权限。对于 Windows,您可能需要使用以管理员身份运行选项启动 PowerShell,以便能够运行脚本。
transaction_match.ps1 (Windows PowerShell) 或 transaction_match.sh (Linux/UNIX) 脚本,并将其保存到 input.properties 所在的 parentsnapshotdirectory 中。./transaction_match.sh。transaction_match.ps1。创建 input.properties 脚本
通过复制并更新以下脚本来创建 input.properties。
javahome=JAVA_HOME epmautomatescript=EPM_AUTOMATE_LOCATION epmusername=exampleAdmin1 epmpassword=examplePassword1.epw epmurl=exampleURL1 objectstorageusername=exampleAdmin2 objectstoragepassword=examplePassword2 objectstorageurl=exampleURL2 matchtype=INTERCO age=365 filteroperator=contains filtervalues=FilterValue=14001 proxyserverusername=myProxyserver proxyserverpassword=myProxyserver_pwd proxyserverdomain=myProxyDomain
注:
仅限 Windows:从 input.properties 文件中删除以下属性:
javahome=JAVA_HOMEepmautomatescript=EPM_AUTOMATE_LOCATION如果没有为 Windows 网络环境启用在代理服务器中进行身份验证,则从 input.properties 文件中删除以下属性。
proxyserverusernameproxyserverpasswordproxyserverdomain表 3-25 input.properties 参数
| 参数 | 说明 |
|---|---|
javahome |
EPM Automate 使用的 JDK 的安装目录。从 Windows 版本的 input.properties 中删除此条目。
示例: |
epmautomatescript |
安装 EPM Automate 的目录。从 Windows 版本的 input.properties 中删除此条目。
示例: |
epmusername |
服务管理员、超级用户、用户或有权存档匹配事务的查看者的名称。
示例: |
epmuserpassword |
标识为 epmusername 的用户的加密密码文件。
示例: |
epmurl |
要存档匹配事务的环境的 URL。
示例: |
objectstorageusername |
具有向 Oracle Object Storage Cloud 写入所需访问权限的用户的 ID。
对于在联合身份提供程序中创建的用户,请指定用户的全限定名称(例如 示例: |
objectstoragepassword |
与 objectstorageusername 中标识的用户关联的 Swift 密码或身份验证令牌。此密码与用户用于登录对象存储控制台的密码不同。身份验证令牌是 Oracle 生成的令牌,您可以将其与第三方 API 一起用于身份验证,例如与 Swift 客户端一起用于身份验证。有关创建此令牌的说明,请参阅 Oracle Cloud Infrastructure 文档中的“创建身份验证令牌”。
示例: |
objectstorageurl |
Oracle Object Storage Cloud 存储桶的 URL,后面可以附加对象名称。
示例: |
matchtype |
应存档匹配事务的匹配类型的标识符 (TextID)。
示例: |
age |
自匹配事务以来的天数。将存档超过或等于此值的匹配事务。 示例: |
filteroperator |
用于标识包含要存档的匹配事务的帐户的筛选条件。必须是以下项之一:equals、not_equals、starts_with、ends_with、contains 或 not_contains。
此值与 示例: |
filtervalues |
一个或多个用于标识要存档的事务的筛选器值。如果 equals 或 not_equals 指定为 filterOperator,可以使用空格分隔的列表指定多个值。如果指定多个值,将选择与任何筛选器运算符和筛选器值组合匹配的帐户中的事务进行存档。
示例: |
proxyserverusername |
使用具有 Internet 访问控制权的代理服务器对安全会话进行身份验证的用户名。
示例: |
proxyserverpassword |
用于在代理服务器中对用户进行身份验证的密码。
示例: |
proxyserverdomain |
为代理服务器定义的域的名称。
示例: |
Windows 脚本
通过复制以下脚本来创建 transaction_match.ps1。将其存储在存储 input.properties 的文件夹中。
# Archive and Purge Transaction Matching PowerShell script
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$epmusername="$($inputproperties.epmusername)"
$epmpassword="$($inputproperties.epmpassword)"
$epmurl="$($inputproperties.epmurl)"
$objectstorageusername="$($inputproperties.objectstorageusername)"
$objectstoragepassword="$($inputproperties.objectstoragepassword)"
$objectstorageurl="$($inputproperties.objectstorageurl)"
$matchtype="$($inputproperties.matchtype)"
$age="$($inputproperties.age)"
$filteroperator="$($inputproperties.filteroperator)"
$filtervalues="$($inputproperties.filtervalues)"
$proxyserverusername="$($inputproperties.proxyserverusername)"
$proxyserverpassword="$($inputproperties.proxyserverpassword)"
$proxyserverdomain="$($inputproperties.proxyserverdomain)"
echo "Running processes to archive and purge transaction matching transactions ..."
if (${proxyserverusername}) {
echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl} ${proxyserverusername} ${proxyserverpassword} ${proxyserverdomain}"
epmautomate login ${epmusername} ${epmpassword} ${epmurl} ${proxyserverusername} ${proxyserverpassword} ${proxyserverdomain}
} else {
echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl}"
epmautomate login ${epmusername} ${epmpassword} ${epmurl}
}
echo "Running epmautomate archiveTmTransactions \"${matchtype}\" ${age} filterOperator=${filteroperator} ${filtervalues}"
epmautomate archiveTmTransactions "${matchtype}" "${age}" "filterOperator=${filteroperator}" "${filtervalues}" > ./outfile.txt.tmp
$jobIdLine=Select-String -Path "outfile.txt.tmp" -Pattern "Job ID"; $jobIdLine=($jobIdLine -split ":")[-2]; $jobid=($jobIdLine -split " ")[1];
$logfile="Archive_Transactions_${matchtype}_${jobid}.log"
$transactionsfile="Archive_Transactions_${matchtype}_${jobid}.zip"
epmautomate listfiles > ./files.txt.tmp
$transactionslogfound=Select-String -Path "./files.txt.tmp" -Pattern "${logfile}"
$transactionsfilefound=Select-String -Path "./files.txt.tmp" -Pattern "${transactionsfile}"
rm ./outfile.txt.tmp
rm ./files.txt.tmp
if (${transactionslogfound}) {
echo "Running epmautomate downloadfile \"${logfile}\""
epmautomate downloadfile "${logfile}"
if (${transactionsfilefound}) {
echo "Running epmautomate downloadfile ${transactionsfile}"
epmautomate downloadfile "${transactionsfile}"
if ($?) {
echo "Running epmautomate copyToObjectStorage ${transactionsfile} ${objectstorageusername} ${objectstoragepassword} ${objectstorageurl}"
epmautomate copyToObjectStorage "${transactionsfile}" "${objectstorageusername}" "${objectstoragepassword}" "${objectstorageurl}"
if ($?) {
echo "Running epmautomate purgeArchivedTMTransactions JOBID=${jobid}"
epmautomate purgeArchivedTMTransactions "JobID=${jobid}"
}
else {
echo "EPMAutomate copyToObjectStorage failed. Purging of archived matched transactions will not be attempted."
}
}
else {
echo "Download of transactions file ${transactionsfile} failed. Copy to object storage, and purging of archived matched transactions will not be attempted."
}
}
else {
echo "No matched transactions found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
}
}
else {
echo "Matchtype ID \"${matchtype}\" not found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
}
echo "Running epmautomate logout"
epmautomate logout
echo "Script processing completed."
Linux/UNIX 脚本
通过复制以下脚本来创建 transaction_match.sh。将其存储在存储 input.properties 的文件夹中。
#!/bin/sh
. ./input.properties
export JAVA_HOME=${javahome}
echo "Running processes to archive and purge transaction matching transactions..."
if [[ "${proxyserverusername}" != "" ]]
then
echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}"
${epmautomatescript} login "${epmusername}" "${epmpassword}" "${epmurl}" "ProxyServerUserName=${proxyserverusername}" "ProxyServerPassword=${proxyserverpassword}" "ProxyServerDomain=${proxyserverdomain}"
else
echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl}"
${epmautomatescript} login "${epmusername}" "${epmpassword}" "${epmurl}"
fi
echo "Running epmautomate archiveTmTransactions \"${matchtype}\" ${age} filterOperator=${filteroperator} ${filtervalues}"
${epmautomatescript} archiveTmTransactions "${matchtype}" "${age}" "filterOperator=${filteroperator}" "${filtervalues}" > ./output.txt.tmp
jobid=$(grep "Job ID" ./output.txt.tmp | cut -d':' -f3 | cut -d' ' -f2)
logfile="Archive_Transactions_${matchtype}_${jobid}.log"
transactionsfile="Archive_Transactions_${matchtype}_${jobid}.zip"
${epmautomatescript} listfiles > ./files.txt.tmp
transactionslogfound=$(grep "${logfile}" ./files.txt.tmp | wc -l)
transactionsfilefound=$(grep "${transactionsfile}" ./files.txt.tmp | wc -l)
rm ./files.txt.tmp
rm ./output.txt.tmp
if [ ${transactionslogfound} -eq 0 ]
then
echo "Matchtype ID \"${matchtype}\" not found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
else
echo "Running epmautomate downloadfile \"${logfile}\""
${epmautomatescript} downloadfile "${logfile}"
if [ ${transactionsfilefound} -eq 0 ]
then
echo "No matched transactions found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
else
echo "Running epmautomate downloadfile ${transactionsfile}"
${epmautomatescript} downloadfile "${transactionsfile}"
if [ $? -eq 0 ]
then
echo "Running epmautomate copyToObjectStorage ${transactionsfile} ${objectstorageusername} ${objectstoragepassword} ${objectstorageurl}"
${epmautomatescript} copyToObjectStorage "${transactionsfile}" "${objectstorageusername}" "${objectstoragepassword}" "${objectstorageurl}"
if [ $? -eq 0 ]
then
echo "Running epmautomate purgeArchivedTMTransactions JOBID=${jobid}"
${epmautomatescript} purgeArchivedTMTransactions "JobID=${jobid}"
else
echo "EPMAutomate copyToObjectStorage failed. Purging of archived matched transactions will not be attempted."
fi
else
echo "Download of transactions file ${transactionsfile} failed. Copy to object storage, and purging of archived matched transactions will not be attempted."
fi
fi
fi
echo "Running epmautomate logout"
${epmautomatescript} logout
echo "Script processing completed."