התחברות

התחברות
x
או
x
הרשמה
x

או

קליק אחד ואתם מחוברים. מהיר .קל .מאובטח.

מעניין? שתפו דף זה באמצעות הטלפון הנייד

מאמרים

מגמות של ביג דאטה בעולם הביטוח
CA Technologies
SSIS - Buffer Size Optimization
קטגוריה ראשית
בדיקות BI ו-DWH לעומת הבדיקות בתחומים אחרים
קטגוריה ראשית
איסוף דרישות לפרויקטי BI
קטגוריה ראשית
כח המידע במיקוד
קטגוריה ראשית
0

הדף שלנו בפייסבוק

ברוך הבא, אורח
שם משתמש: סיסמא: זכור אותי

דיון: טיפ שבועי - ייצוא תיקיה עם פקודת pmrep

טיפ שבועי - ייצוא תיקיה עם פקודת pmrep 9 years 8 months ago #5902

  • Or Pelach
  • Or Pelach's Avatar
  • Offline
  • Moderator
  • הודעות: 134
  • קרמה: -1
Using pmrep to export an Informatica folder
Sometimes you need to export the contents of a PowerCenter folder for offline storage. This post will show you how to quickly export a PowerCenter folder's contents using the pmrep command's ObjectExport function.

The nice thing about this tip is I give you a script (attached Windows batch script) that will export a folder's contents as individual XML files and export one XML file containing all the folder's contents. This gives you flexibility when you need to import the objects back into the repository, you can pick and choose from the individual files or import all the folder's contents with the one file.


Overview of ObjectExport
If you are not familiar with pmrep's ObjectExport function, here's a look at the syntax:
pmrep ObjectExport -n objName -o objType -f FolderName -m -s -b -r -u objName.xml
ObjectExport exports objects by name, to export multiple objects from a folder you can either supply names one at a time, re-executing the command for each name or you can supply an input file containing a list of object names. You also must supply the object name's folder (-f). The last parameter is the output file name.

ObjectExport creates XML that can be imported back into PowerCenter. The switches -m -s -b –r are required to get dependent objects (tables, shortcuts, non-reusable objects) for the object you are exporting. For some objects, if you do not export its dependent objects, it will not re-import into the repository correctly.
Create A List Of Objects
My script uses an input file to supply the list of objects to export. I created the list by executing a PowerCenter Query and filtering on Object type FOLDER and my folder name.

You could also use the pmrep function's ListObjects or ListObjectDependencies to create your input file but I like the format of the output file created by the Query.

To create a query: open PowerCenter Designer (or Repository Manager or any of the tools) and select the menu options: Tools > Queries.

On the resulting dialog, click New to create a new query. For "Query Conditions" fill in the following:
Variable Value
Query Name Folder_Backup
Query Type Shared
Parameter Name Folder
Operator Is Equal To
Value 1 our_folder

Save the Query and run a test to see the results are what you expect.

To save the query results to an output file your ObjectExport script can use, you can manually save the results (File > Export) or execute the query within a script using this syntax:
pmrep executequery -q %INFA_QUERY_NAME% -t shared -u %OUTPUT_PATH%\export_results.txt
Script
Now that we have a file containing a list of folder contents, it's a simple matter of "reading" the file and executing pmrep ObjectExport for each object name in the file.

Here's the (Windows batch script) syntax for reading the query output and executing pmrep ObjectExport. The pmrep ObjectExport syntax shown below is the same as above except parameter values are used for name, object type and folder.
FOR /F "tokens=2,3,4* delims=, " %%i in (query_results.txt) do
pmrep ObjectExport -n %%j -o %%k -f %%i -m -s -b -r -u %%j.xml
To output one xml that represents all objects in a folder, change the pmrep ObjectExport –n switch to –i query_results.txt and remove the switches –o and –f
pmrep ObjectExport -i query_results.txt -m -s -b -r -u All_Folder_Objects.xml
The script for this article puts all the pieces together for you, including the a statement for executing the query.
Caveats
This article's script uses the environment variable technique described here. To run the script you would have to implement the env. variables or hard code the values.
Conclusion
I hope you find this tip (and script file) useful. If you have questions or suggestions post them as a comment below.

IMPORTANT, YOU are responsible for backing up your systems before trying or implementing any suggestions from this blog. I do not guarantee 100% accuracy of any code examples. I do not presume to know your system environment(s) or Security requirements; all code examples from this blog should be thoroughly tested before any attempted use on a production system.

File Attachment:

שם קובץ: ExportFolder.txt
גודל קובץ:2 ק''ב
עריכה אחרונה: 9 years 8 months ago  ע''י Or Pelach.
הנהלת האתר ביטלה גישת כתיבה ציבורית.
מנהלים: Laromme Barr
זמן יצירת העמוד: 0.199 שניות

Microsoft

Oracle

IBM

Informatica

Sap

SAS

Qlikview

Cloudera

Machine Learning