Tech Monger

Programming, Web Development and Computer Science.

Skip to main content| Skip to information by topic

Get Session Statistics in Informatica from Command Line

In this tutorial we will learn how to use pmcmd getsessionstatistics command to fetch essential session run information. This tool is handy especially if you want to automate report containing session run summary. In output you would get vital details about session and transformations like Failed and Success Rows of Source & Target, Transformation statistics like Applied, Affected and Rejected rows, Throughput Per Second. Additionally it also outputs an error code along with error details of both individual transformations and session.

Important Options and Arguments

GetSessionStatistics command requires following parameters.

Flag Use
-f or -folder Name of folder in which workflow resides.
-w or -workflow Name of Workflow.
Space separated session name.

GetSessionStatistics also accepts following arguments apart from above Arguments

Flag Use
-rn or -runinsname Name of the run instance of workflow. Useful when running multiple tasks in parallel.
-wfrunid Accepts workflow run id for the task.

GetSessionStatistics Example

Before running getsessionstatistics command first connect to the integration service using pmcmd either in interactive or in command Line mode.

General Syntax

getsessionstatistics  -f  "Folder Name"  -w  "Workflow Name" "Session Name"

Example in Interactive Mode

Secure Connection using Environment Variables INF_UNAME and INF_PWD

pmcmd 
connect -sv  "integration service"  -d  "domain-name"  -uv INF_UNAME  -pv INF_PWD
Connected to Integration Service: [integration service].
getsessionstatistics  -f  MY_FOLDER_NAME  -w  MY_WORKFLOW_NAME  MY_SESSION_NAME

Connection without Environment Variables.

pmcmd 
connect  -sv  "integration service"  -d  "domain-name"  -u  MY_USERNAME
password:
Connected to Integration Service: [integration service].
getsessionstatistics  -f  MY_FOLDER_NAME  -w  MY_WORKFLOW_NAME  MY_SESSION_NAME

Example in Command Line Mode

Secure Invocation using Environment Variables INF_UNAME and INF_PWD in command line mode.

pmcmd  getsessionstatistics  -sv  "integration service" -d  "domain-name"  -uv  
INF_UNAME  -pv  INF_PWD  -f  MY_FOLDER_NAME  -w  MY_WORKFLOW_NAME  MY_SESSION_NAME

Invocation without Environment Variables.

pmcmd  getsessionstatistics  -sv  "integration service"  -d  "domain-name"  -u  
MY_USERNAME  -p  *****  -f  MY_FOLDER_NAME  -w  MY_WORKFLOW_NAME  MY_SESSION_NAME

Output of GetSessionStatistics

Folder: [MY_FOLDER_NAME]
Workflow: [MY_WORKFLOW_NAME]
Instance: [MY_SESSION_NAME]
Mapping: [MY_MAPPING_NAME]
Session log file: [/path/to/session.log]
Source success rows: [10000]
Source failed rows: [5]
Target success rows: [50000]
Target failed rows: [10]
Number of transformation errors: [0]
First error code [3824]
First error message: [[ERROR] Type:(Teradata DBS Error)]
Task run status: [Failed]
Integration Service: [INT_SERVICE_NAME]
Integration Service Process: [INT_SERVICE_PROCESS_NAME]
Integration Service Grid: [INT_SERVICE_GRID_NAME]
----------------------------
Node Name(s) [NODE_NAME]
Preparation fragment

Partition: [Partition #1]
Transformation instance: [T1_TRANS_NAME]
Transformation: [T1_TRANS_NAME]
Applied rows: [39000]
Affected rows: [43000]
Rejected rows: [0]
Throughput(Rows/Sec): [5]
Throughput(Bytes/Sec): [0]
Last error code [0], message [No errors encountered.]
Start time: [Wed May 02 02:30:22 2018]
End time: [Wed May 02 21:50:59 2018]

Partition: [Partition #1]
Transformation instance: [T2_TRANS_NAME]
Transformation: [T2_TRANS_NAME]
Applied rows: [56333]
Affected rows: [56333]
Rejected rows: [0]
Throughput(Rows/Sec): [5]
Throughput(Bytes/Sec): [0]
Last error code [0], message [No errors encountered.]
Start time: [Wed May 02 02:30:22 2018]
End time: [Wed May 02 21:50:59 2018]

Using getsessionstatistics of pmcmd you can retrieve information about session run without opening powercenter monitor and can send statistics as report via script. If you don not want complete statistics but only need specific values of session run then you should query repository to get session run details.

Tagged Under : Informatica PMCMD