Tech Monger

Programming, Web Development and Computer Science.

Skip to main content| Skip to information by topic

Create Script Specific Informatica PMREP Connections

If you want to run simultaneous scripts which make use of pmrep connect then you would find that default connect command would fail or will not behave correctly. Learn how to avoid pmrep connection collision using environment variable INFA_REPCNX_INFO.

How PMREP Connect Works ?

Whenever you initiate pmrep connect command it creates default connection file pmrep.cnx inside the current working directory or home directory of the the user using which command has been initiated. This file contains information about current user session and gets checked before every other pmrep command that require user authentication.

Running Simultaneous PMREP Scripts

Problem

If two different pmrep scripts are running in parallel by the same operating system user or inside same directory then pmrep.cnx file created by the first script gets overridden by the second script. Hence any pmrep command invoked by the first script fails or misbehaves because information inside pmrep.cnx is invalid for the first script's pmrep session.

Solution

To fix above issue we must explicitly define connection file for the script inside environment variable INFA_REPCNX_INFO. Connection file name should be set for INFA_REPCNX_INFO before invoking pmrep connect like below.

Example - Set INFA_REPCNX_INFO
INFA_REPCNX_INFO=./script.cnx
export INFA_REPCNX_INFO
pmrep connect -r MY_REP_SVC -d MY_INF_DOAMIN -n MY_USERNAME -X INF_PWD

Above code will create script specific connection file script.cnx inside current working directory. Since this connection file is exclusively created for your script it prevents pmrep session collision with other simultaneously running scripts.

Conclusion

It is good practice to always define script specific pmrep connection file before invoking pmrep connect. If wrong connection file is picked by the script then it could fail or potentially make changes in the different repository causing unintended consequences.

Tagged Under : Informatica PMREP