Statistics for Informatica

download Statistics for Informatica

of 7

Transcript of Statistics for Informatica

  • 7/29/2019 Statistics for Informatica

    1/7

    Loading Session Statistics into adatabase table

    Applies to:

    Informatica PowerCenter

    Summary

    This article briefs about loading the session statistics into a database table.

    Author Bio

    Author(s): Sukumar Balasubramanian

    Company: CIBC

    Created on: January 11, 2010

    Sukumar Balasubramanian is an experienced Informatica ETL Consultant working with CIBC, Canada.He has good exposure to Data Integration/Data Warehousing Projects. He is also a key contributor ininformatica-l group of ittoolbox

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 1

    http://technet.informatica.com/http://technet.informatica.com/http://technet.informatica.com/http://technet.informatica.com/
  • 7/29/2019 Statistics for Informatica

    2/7

    Loading Session Statistics into a database table

    Table of Contents

    INTRODUCTION .................................................................................................................................. ............3

    SOLUTION OVERVIEW .................................................................................................................................. .4

    SOLUTION STEPS ...........................................................................................................................................4

    SESSION1 ................................................................................................................................................... .4

    WORKFLOW VARIABLES ............................................................................................................................4

    ASSIGNMENT TASK ....................................................................................................................................4

    SESSION2 ................................................................................................................................................... .4

    PRE-Session Variable ..................................................................................................................................5

    Workflow Execution .......................................................................................................................................5

    ADVANTAGES ................................................................................................................................................6

    DISCLAIMER AND LIABILITY NOTICE ............................................................................................................7

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 2

    http://technet.informatica.com/http://technet.informatica.com/http://technet.informatica.com/
  • 7/29/2019 Statistics for Informatica

    3/7

    Loading Session Statistics into a database table

    INTRODUCTION

    A frequent issue that a developer faces with Informatica Development is that developers won't have access

    to informatica repository views due to security reasons. But they need to load the session statistics such as

    Session Start & End Time, Success Rows, Failed Rows and Rejected Rows etc. into a database table for

    audit/log purpose.

    This article briefs about loading the session statistics into a database table using Informatica pre-defined

    variables.

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 3

  • 7/29/2019 Statistics for Informatica

    4/7

    Loading Session Statistics into a database table

    SOLUTION OVERVIEW

    After performing the below solution steps your end workflow will look as follows:

    START SESSION1 ASSIGNMENT TASK SESSION2

    SOLUTION STEPS

    SESSION1

    This session is used to achieve your actual business logic. Meaning this session will perform your actual dataload. It can be anything FileTable, FileFile or TableTable.

    WORKFLOW VARIABLES

    Create the following workflow variables.

    $$Workflowname

    $$SessionStartTime

    $$SessionEndTime

    $$TargetSuccessrows

    $$TargetFailedRows

    ASSIGNMENT TASK

    Use the Expression tab in the Assignment Task and assign as follows:

    $$workflowname = $PMWorkflowName

    $$sessionStartTime = $ SESSION1.StartTime

    $$SessionEndTime = $ SESSION1.Endtime

    $$ TargetSuccessrows = $ SESSION1. TgtSuccessRows

    $$ TargetFailedRows= $ SESSION1. TgtFailedRows

    SESSION2

    This session is used to load the session statistics into a database table.

    This should call a mapping say m_sessionLog

    This mapping m_sessionLog should have mapping variables for the above defined workflowvariables such as $$wfname, $$Stime, $$Etime, $$TSRows and $$TFRows.

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 4

  • 7/29/2019 Statistics for Informatica

    5/7

    Loading Session Statistics into a database table

    This mapping m_sessionLog should use a dummy source and it must have a expressiontransformation and a target ( database Audit table)

    Inside the expression you must assign the mapping variables to the output ports

    workflowname=$$wfname

    starttime=$$Stime

    endtime=$$Etime

    SucessRows=$$TSRowsFailedRows=$$TFRows

    Create a target database table with the following columns

    Workflowname, start time, end time, success rows and failed rows.

    Connect all the required output ports to the target which is nothing but your audit table.

    PRE-Session Variable

    Session 2: In the Pre-session variable assignment tab assign the mapping variable = workflowvariable

    In our case

    $$wfname=$$workflowname

    $$Stime=$$sessionStartTime

    $$Etime=$$sessionEndTime

    $$TSRows=$$TargetSuccessrows

    $$TFRows=$$TargetFailedrows

    Workflow Execution

    Execute the workflow.

    1. Session1 will achieve your business requirement.

    2. Once the session is completed the assignment task will assign the session1 statistics to theappropriate workflow variables.

    3. Session2 will assign the workflow variables to the mapping variables and load the session1 sessionstats to the audit table in your database.

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 5

  • 7/29/2019 Statistics for Informatica

    6/7

    Loading Session Statistics into a database table

    ADVANTAGES

    Pure informatica solution. No Unix/windows scripts are required for this purpose

    We need only one mapping to load the required session statistics into our Audit table.

    After each session we need to assign and call the above mapping that loads the previous sessionstatistics into our audit table.

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 6

  • 7/29/2019 Statistics for Informatica

    7/7

    Loading Session Statistics into a database table

    DISCLAIMER AND LIABILITY NOTICE

    Informatica offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this software asset,including any liability resulting from incompatibility between the content within this asset and the materials and services offered byInformatica. You agree that you will not hold, or seek to hold, Informatica responsible or liable with respect to the content of this softwareasset.

    Informatica Technology Network http://technet.informatica.com

    2009 Informatica Corporation. All Rights Reserved. 7