Wednesday, December 27, 2006

Informatica 7.1:How to invoke sessions through UNIX shell scripting.

In most of the ETL environment having INFA installed in UNIX we used to invoke sessions by UNIX.

1/
It gives better control.
2/
Can be embedded in a UNIX ETL scripts and thus can the process be automated.
3/
Can do all things which you can do in GUI mode.

You can invoke a session using pmcmd command.
A typical script may look like as follows:
.
.
.
.
. .my_env #Environment file having all the variables which
# we will use in PMCMD command.
.
.
# Some more logic- May be collecting info regarding all the sessions to be
# picked up alongwith their folder name from a Master table of the database.
.
.
.
PMCMD_STATUS=pmcmd startworkflow -u $INFO_USER -p $INFO_PWD -s $INFO_PORT -f $INFO_FOLDER -paramfile $INFO_PARAMFILE -nowait $INFO_SESSION
.
# Check whether your session has successfully instantiated or not.
.
if [ $PMCMD_STATUS -ne 0 ]; then
echo "\n Error Occurred... `date +%m%d%y%H%M%S`: The Informatica Session Named $INFO_SESSION Failed"
exit;
else
echo "\n Cheers... `date +%m%d%y%H%M%S`: The Informatica Session Named $INFO_SESSION Successfully Started on `date +%m%d%y%H%M%S`\n"
fi
.
# Do something- Blah blah blah
.
.
.


Informatica Workflow Administration guide is a good help for doing such things from command line mode.

All available tasks which can be performed by pmcmd are as follows:


$ pmcmd
pmcmd>
pmcmd> help
Usage: help [command]
Usage: version
Usage: pingserver
Usage: getserverproperties
Usage: shutdownserver <-complete|-stop|-abort>
Usage: getserverdetails [-all|-running|-scheduled]
Usage: getrunningsessionsdetails
Usage: startworkflow [<-folder|-f> folder]
[<-startfrom> taskInstancePath [<-recovery>]]
[<-paramfile> paramfile] [-wait|-nowait] workflow
Usage: stopworkflow [<-folder|-f> folder] [-wait|-nowait] workflow
Usage: abortworkflow [<-folder|-f> folder] [-wait|-nowait] workflow
Usage: waitworkflow [<-folder|-f> folder] workflow
Usage: resumeworkflow [<-folder|-f> folder] [-wait|-nowait] [<-recovery>]
workflow
Usage: scheduleworkflow [<-folder|-f> folder] workflow
Usage: unscheduleworkflow [<-folder|-f> folder] workflow
Usage: getworkflowdetails [<-folder|-f> folder] workflow
Usage: starttask [<-folder|-f> folder] <-workflow|-w> workflow
[<-paramfile> paramfile] [-wait|-nowait] [<-recovery>]
taskInstancePath
Usage: stoptask [<-folder|-f> folder] <-workflow|-w> workflow [-wait|-nowait]
taskInstancePath
Usage: aborttask [<-folder|-f> folder] <-workflow|-w> workflow [-wait|-nowait]
taskInstancePath
Usage: waittask [<-folder|-f> folder] <-workflow|-w> workflow taskInstancePath
Usage: resumeworklet [<-folder|-f> folder] <-workflow|-w> workflow
[-wait|-nowait] [<-recovery>] taskInstancePath
Usage: gettaskdetails [<-folder|-f> folder] <-workflow|-w> workflow
taskInstancePath
Usage: getsessionstatistics [<-folder|-f> folder] <-workflow|-w> workflow
taskInstancePath
Usage: connect <-serveraddr|-s> [host:]portno
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
Usage: disconnect
Usage: setwait
Usage: setnowait
Usage: unsetfolder
Usage: setfolder folder
Usage: showsettings
Usage: exit


---: My blog is not responsible for any damages happened from the suggestion of my blog :---
Reach me at : m_a_hasim@yahoo.com

Labels:

2 Comments:

Anonymous Anonymous said...

Hi

I have a question about pmcmd using in Unix.

$ cd /infa-rds-d/infdrdsp/7.1.5/powercenter
$ pmcmd
/usr/lib/hpux64/dld.so: Unable to find library '1:/home/build3p/PMReleases/Symphony715/HP-UX.IPF.64/rw/710/lib/libtls4d.sl'.
Killed

I'm wondering why such error happened. Is there any other setting need to be done? Could you help this?

--Magic

10:50 AM  
Blogger Abul Hasim said...

Please check the necessary paths like PM_HOME and SHLIB_PATH is properly set.

~Hasim

7:50 PM  

Post a Comment

<< Home