Sunday, May 24, 2009

pmcmd : Unix command to control Informatica Workflow

pmcmd command is used to control informatica repository events thru Unix, When informatica server is an Unix server. Since Unix is a very powerful and command end to interact with multiple data storage sources (flatfile, oracle, sql server, xml etc.). We can check for a indicator file and execute/stop/abort a session/workflow.In this way, we can reduce various task/commands and whole dataflow will be automated at an extend.
Session specific,
pmcmd stoptask -s $server_name -u $user_name -p $pass -f $folder -w $wkf $sess
Keys :
stoptask : To stop a task
gettaskdetails : To retrieve task details
starttask : To Execute a task
aborttask : To abort a task
waittask : To Run a task in wait mode
workflow specific,
pmcmd startworkflow-s $server_name -u $user_name -p $pass -f $folder $wkf
Keys :
stopworkflow : To stop a workflow
getworkflowdetails : To retrieve workflow details
startworkflow : To Execute a workflow
abortworkflow : To abort a workflow
waitworkflow : To Run a workflow in wait mode

pmcmd command with parameter file
pmcmd startworkflow-s $server_name -u $user_name -p $pass -f $folder -paramfile paramfile_name -wait $wkf

Apart from these pmcmd command options , various utility options available
(check informatica help file for details)

Sunday, May 17, 2009

Mapping Variables Stores Values in Informatica Repository

We use mapping Variales for current session run to store and manipulate expression. We will See intelligent use of mapping variables. Mapping variables are very simple to create.
In mapping designer,
Goto Mapping Menu
Select Parameters and Variables option. create date type variable $$URF_CA_FROM.
Initialized with '04/05/2009' (any valid date value for first run).

Use this variable in any transformation column.
Use function SETVARIABLE($$URF_CA_FROM,SYSDATE) to store current date.
Link it with some other transformation coulmn of same datatype(date).
Now, When we run this mapping, variable will store current session system date value and persist in repository. At Next run time, We can utilize this value in soure qualifier in where condition.
We can use any datatype of variable to store prev run value and use this value in next execution.
i.e.
If session run on 02/06/2009, $$x variable stores this value.
now, we are running session on 12/06/2009, we can retrieve value of $$x in any transformation in same mapping. We can see this variable'spersist value in workflow manager.
right click on session at workflow level. select View persistent Values option to see and reset values.
***This logic will eliminate lot of DB dependencies and make incremental logic easy.
Limitations:
  • Variable must be initialized
  • We need to link SETVARIABLE() function column to same datatype column.
  • It should executed at least once for insert/update/delete.

Saturday, May 16, 2009

Use of Update Override Properties In Target

Mapping : Target Properties
Update Override
Informatica supports Update stretegy transformation to update/insert/delete operations on Target. If we need to process insert timestamp for insert scenario and Update timestamp for Update scenario.Generaly, We will use 2 UPDATE STRETEGY transformations to achieve this functionality. Think If we have a complex mapping with more then 10 Targets, Then we need to use 20 UPDATE STRETEGY transformations.
It will increase Mapping complexity and execution time. It will create a mess in mapping.

Lets do it in decent way, We can make this mapping simple and fast.
Take SYSDATE as a temperory column in a transformation. Link it with insert timestamp and update timestamp columns. Now open TARGET property in mapping. Select UPDATE OVERRIDE property.Generate the default update statement. Take update timestamp and remove insert timestamp column from default update statement. Now when update scenario will come, only update timestamp will be updated.


This DB type is basically used in data warehousing, to implement increamental logic. When Table stores insert timestamp and update timestamp.
i.e.