Using pmrep to import an Informatica folder
Here’s the companion script for the “Using pmrep to export an Informatica folder” article. Use this script to import objects into PowerCenter.
One use for scripting an import would be to schedule it during off hours, for example moving development code to production during off hours. You may also need to export some objects, then do a "mass change" or Find/Replace on the XML file, then export them back in (for example, export all sessions, find/replace a connection).
Overview of ObjectImport
Here is the basic object import syntax:pmrep objectimport -i m_mapping_name.xml -c import_Infa_Objects_Control.txtThe pmrep objectimport function is easy to use, it is a little different however, in that you are required to use a “control file”, designated by the "-c", to define what PowerCenter folder and repository the objects will be imported into. There is an example Control File at the end of the article with important sections highlighted.
You must also use the control file to specify how to resolve conflicts, “Replace”, “Reuse”, etc., (see the RESOLVECONFLICT section). You can choose the option to generically “replace” all objects or you can specify Replace or Reuse by object type as defined in the TYPEOBJECT keyword, for example in the control file below, I choose to replace workflows but reuse schedulers.
Optionally, using the keyword TYPEFILTER, you can use the control file to filter which object types will get imported (applicable if you have a folder with many objects and various object types but only need to import a subset of those)
Script
My script has two imports options, one to import a single object and the other option will loop over a folder containing multiple objects to import , you can use either one depending on your requirement, just comment out the object import you don't need. Download the script and control file here
Example Control File
A word of caution, if you export Mappings that have SAP ABAP and import them back into the repository, replacing the mapping, you may have an issue where the mapping save time is newer than the ABAP generation time and the session will no longer run.
Thank you for your support
or |
I am trying to create a dynamic query in a shell script to export all the objects retrieved from the query for a particular Label.
That is, If i pass "Release 1" as parameter to the script it should export all the objects that are labelled Release 1.
'Executequery' of pmrep are used to execute only saved query. Is there a possibility wherein you paramaterize the query on the fly
Thanks,
Dani
I have one thread opened in Informatica Communities and some other forums, no one was able to help me till now, maybe you can help me out? It is pretty tough though!
Import Control File - RENAME conflict Resolution - Custom Name
(https://community.informatica.com/thread/35661)
Thanks,
Carlos
Dependencies will only be Imported if they are included in the file you are importing. For example, if you use the ObjectExport cmd to export an object and specify the switches -m -s -b –r, then dependencies will be included in the exported xml file and so will be available when the file is imported.
Please see this post for more information about ObjectExport and Dependencies
http://jeffkinzer.blogspot.com/2010/06/using-pmrep-to-export-informatica.html
rocky.trn@gmail.com
For that I generated the following control file (XML syntax removed):
IMPORTPARAMS RETAIN_GENERATED_VALUE="YES" CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="Deployment of tag ICC/Tags/INSIGHTS_IS1500_SFDC/CH6323_V01_ICC_DI_SFDC-20141217_182009"
FOLDERMAP SOURCEFOLDERNAME="ICC_DI_ABAC" SOURCEREPOSITORYNAME="CanonDevDI_RS" TARGETFOLDERNAME="ICC_DI_ABAC" TARGETREPOSITORYNAME="CanonTstDI_RS"
FOLDERMAP SOURCEFOLDERNAME="ICC_DI_SFDC" SOURCEREPOSITORYNAME="CanonDevDI_RS" TARGETFOLDERNAME="ICC_DI_SFDC" TARGETREPOSITORYNAME="CanonTstDI_RS"
FOLDERMAP SOURCEFOLDERNAME="ICC_BP_Shared" SOURCEREPOSITORYNAME="CanonDevDI_RS" TARGETFOLDERNAME="ICC_BP_Shared" TARGETREPOSITORYNAME="CanonTstDI_RS"
RESOLVECONFLICT
SPECIFICOBJECT NAME="lkp_INT_METADATA_ID" OBJECTTYPENAME="Lookup Procedure" FOLDERNAME="ICC_DI_ABAC" REPOSITORYNAME="CanonTstDI_RS" RESOLUTION="REUSE"
SPECIFICOBJECT NAME="lkp_T_INT_EXCN_LOG_Get_EXCN_ID" OBJECTTYPENAME="Lookup Procedure" FOLDERNAME="ICC_DI_ABAC" REPOSITORYNAME="CanonTstDI_RS" RESOLUTION="REUSE"
SPECIFICOBJECT NAME="m_ABaC_ABaC_Update_Failure_EXCN_LOG" OBJECTTYPENAME="MAPPING" FOLDERNAME="ICC_DI_ABAC" REPOSITORYNAME="CanonTstDI_RS" RESOLUTION="REUSE"
SPECIFICOBJECT NAME="m_ABaC_ABaC_Update_Success_EXCN_LOG" OBJECTTYPENAME="MAPPING" FOLDERNAME="ICC_DI_ABAC" REPOSITORYNAME="CanonTstDI_RS" RESOLUTION="REUSE"
SPECIFICOBJECT NAME="m_ABaC_ABaC_Insert_EXCN_LOG" OBJECTTYPENAME="MAPPING" FOLDERNAME="ICC_DI_ABAC" REPOSITORYNAME="CanonTstDI_RS" RESOLUTION="REUSE"
TYPEOBJECT OBJECTTYPENAME="ALL" RESOLUTION="REPLACE"
RESOLVECONFLICT
IMPORTPARAMS
However, when importing the workflow, I get the following error:
Folder [ICC_DI_ABAC] cannot be found in repository [CanonTstDI_RS]
I am certain that the folder ICC_DI_ABAC exists in CanonTstDI_RS.
When I remove the "REUSE" entries from the control file, the import is successful.
What am I doing wrong?
I am also facing similar issue, could you please let me know how to reslove.
Thanks & REgards,
Pavan
Specifically, the REPOSITORYNAME attribute under the RESOLVECONFLICT element of the control file is given as the target repository name when it should be the source repository name. To resolve this change the REPOSITORYNAME value in the control file to the source repository name."
jk