오래된 일치 트랜잭션 아카이브 및 아카이브된 트랜잭션 비우기

이 섹션의 스크립트를 사용하여 지정된 기간의 일수보다 오래되거나 일수가 같은 일치 트랜잭션을 지원 및 조정 세부정보와 함께 아카이브한 다음, Account Reconciliation에서 아카이브된 트랜잭션을 비웁니다. 아카이브된 일치 트랜잭션은 ZIP 파일로 기록됩니다.

스크립트 작동 방법

  1. input.properties 파일의 정보를 사용하여 환경에 로그인합니다.
  2. 다음 archiveTmTransactions 명령을 실행하여 아카이브를 생성합니다. 생성되는 ZIP 파일 및 로그 파일은 기본 이름 Archive_Transactions_INTERCO_JOB_ID.zipArchive_Transactions_INTERCO_JOB_ID.log를 사용합니다.

    epmautomate archiveTmTransactions INTERCO 365 filterOperator=contains filterValue=14001

    input.properties 파일을 수정하여 명령 매개변수를 변경할 수 있습니다.
  3. 로그 파일 및 아카이브된 트랜잭션이 포함된 .ZIP 파일을 로컬 컴퓨터에 다운로드합니다. 이 스크립트는 일치 트랜잭션을 찾을 수 없는 경우 오류 메시지를 표시합니다.
  4. 아카이브된 트랜잭션이 포함된 .ZIP 파일을 Oracle Object Store로 복사합니다.
  5. purgeArchivedTmTransactions 명령을 실행하여(archiveTmTransactions 작업의 작업 ID와 함께) 아카이브된 일치 트랜잭션을 애플리케이션에서 삭제합니다.

스크립트 실행

  1. input.properties 파일을 생성하고 해당 환경에 대한 정보로 업데이트합니다. 로컬 디렉토리에 파일을 저장합니다. 본 설명에서는 이 디렉토리를 parentsnapshotdirectory라고 합니다. 이 파일의 콘텐츠는 운영 체제에 따라 다릅니다.

    이 디렉토리에서 쓰기 권한이 있어야 합니다. Windows의 경우 관리자 권한으로 실행 옵션으로 PowerShell을 시작해야 스크립트를 실행할 수 있습니다.

  2. transaction_match.ps1(Windows PowerShell) 또는 transaction_match.sh(Linux/UNIX) 스크립트를 생성하고 input.properties가 있는 parentsnapshotdirectory에 저장합니다.
  3. 스크립트를 실행합니다.
    • Linux/UNIX: ./transaction_match.sh를 실행합니다.
    • Windows PowerShell: 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_HOME
  • epmautomatescript=EPM_AUTOMATE_LOCATION

Windows 네트워크 환경에 대해 authentication at proxy server가 사용으로 설정되지 않은 경우 input.properties 파일에서 이러한 등록정보를 제거합니다.

  • proxyserverusername
  • proxyserverpassword
  • proxyserverdomain

표 3-24 input.properties 매개변수

매개변수 설명
javahome EPM Automate에서 사용하는 JDK가 설치된 디렉토리입니다. Windows 버전의 input.properties에서 이 항목을 삭제합니다.

예: javahome=./home/JDK/bin

epmautomatescript EPM Automate가 설치된 디렉토리입니다. Windows 버전의 input.properties에서 이 항목을 삭제합니다.

예:epmautomatescript=./home/utils/EPMAutomate/bin

epmusername 일치 트랜잭션을 아카이브할 권한이 부여된 서비스 관리자, 고급 사용자, 사용자 또는 뷰어의 사용자 이름입니다.

예: epmusername=ServiceAdmin

epmuserpassword epmusername으로 확인된 사용자의 암호화된 비밀번호 파일입니다.

예: epmpassword=myPwd.epw

epmurl 일치 트랜잭션을 아카이브할 환경의 URL입니다.

예: epmurl=https://test-cloudpln.pbcs.us1.oraclecloud.com

objectstorageusername Oracle Object Storage Cloud에 쓰는 데 필요한 액세스 권한을 가진 사용자의 ID입니다.

페더레이션된 ID 제공자에서 생성된 사용자의 경우 사용자의 전체 이름을 지정합니다(예: exampleIdP/jdoe 또는 exampleIdP/john.doe@example.com, 설명: exampleIdP는 페더레이션된 ID 제공자의 이름). 다른 사용자의 경우 사용자 ID를 지정합니다.

예: epmusername=myIdP/jdoe

objectstoragepassword objectstorageusername에서 확인된 사용자에 연계된 Swift 비밀번호 또는 인증 토큰입니다. 이 비밀번호는 사용자가 Object Storage Console에 로그인하는 데 사용하는 비밀번호와 다릅니다. 인증 토큰은 Swift 클라이언트로 인증하는 경우와 같이 타사 API로 인증하는 데 사용하는 Oracle에서 생성된 토큰입니다. 이 토큰 생성에 대한 지침은 Oracle Cloud Infrastructure 설명서에서 인증 토큰을 생성하려면을 참조하십시오.

예: objectstoragepassword=jDoe_PWD

objectstorageurl 선택적 객체 이름이 추가된 Oracle Object Storage Cloud 버킷의 URL입니다.

예: objectstorageurl=https://swiftobjectstorage.region_identifier.oraclecloud.com/v1/namespace/MT_Archives/2023_archives

matchtype 일치 트랜잭션을 아카이브해야 하는 소스 일치 유형의 식별자(TextID)입니다.

예: matchtype=cashrecon

age

트랜잭션이 일치한 이후 경과한 일수입니다. 이 값의 일수보다 오래되거나 일수가 같은 일치 트랜잭션은 아카이브됩니다.

예: age=180

filteroperator 아카이브할 일치 트랜잭션이 포함된 계정을 확인하기 위한 필터 조건입니다. 다음 중 하나여야 합니다. equals, not_equals, starts_with, ends_with, contains 또는 not_contains.

이 값과 filterValue 값을 조합하여 일치 트랜잭션을 아카이브할 소스 계정을 확인합니다.

예: filteroperator=not_equals

filtervalues 아카이브할 트랜잭션을 확인하는 하나 이상의 필터 값입니다. equals 또는 not_equalsfilterOperator로 지정하면 공백으로 구분된 목록을 사용하여 여러 값을 지정할 수 있습니다. 여러 값이 지정되면 필터 연산자 및 필터 값 조합과 일치하는 계정의 트랜잭션이 아카이브용으로 선택됩니다.

예: filterValue=101-120 filterValue=140-202

proxyserverusername 인터넷에 대한 액세스를 제어하는 프록시 서버를 통해 보안 세션을 인증할 사용자 이름입니다.

예: proxyserverusername=myProxyserver

proxyserverpassword 프록시 서버를 통해 사용자를 인증할 비밀번호입니다.

예: proxyserverpassword=myProxyserver_pwd

proxyserverdomain 프록시 서버에 대해 정의된 도메인의 이름입니다.

예: proxyserverdomain=myProxyDomain

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."