Sie sind auf Seite 1von 353

Informatica PowerCenter Hands-On Workshop

Agenda
Time :30 :30 :45 :45 :45 :30 :30 :30 3:00 Topic Introduction to PowerCenter Lab 1: Sources and Targets Lab 3: Building a Mapping Data Integration Part 1 Lab 4: Working with Data Data Integration Part 2 Lab 5: Workflow Using Workflow Manager & Workflow Monitor Lab 6: Using the Debugger Lab 7: Web Services Making Your Mapping SOA Ready Lab 9: Extra credit. Sorted input and dynamic partitioning Lab 8: Putting It All Together

About the Virtual Machine


Login to the local machine Launch VMware Player and start workshop image Login to VMware hosted windows OS
Username: Administrator Password: infa

Helpful VMware Commands Ctrl-Alt-Enter switch VMWare to full screen Ctrl-Alt-Insert (in VMware) same as Ctrl-Alt-Del Ctrl-Alt-Esc Return to Desktop from VMware
3

Workshop Objectives

By the end of the day you will:

Understand the broad set of data integration challenges facing organizations today and how the Informatica Platform can be used to address them Access data from different data sources and targets Profile a data set and understand how to look for basic problems that need to be solved Integrate data from multiple sources through Extraction, Transformation and Load (ETL) Debug data integration processes (mappings) Expose integration logic as Web Services for use in a SOA architecture

Introduction to PowerCenter
Enterprise Data Integration and ETL

PowerCenter

Informatica platform unique characteristics

No code No programming Full GUI development

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.dat Oracle PL/SQL

ORACLE

----------------------------------------------------------------------------- "AGGREGATOR_TOTAL_AMOUNT_c" Cursor declaration ---------------------------------------------------------------------------CURSOR "AGGREGATOR_TOTAL_AMOUNT_c" IS SELECT NVL("CUSTOMER_DETAILS_LKP"."CUST_KEY", NULL) "CUST_KEY", NVL("CUSTOMER_DETAILS_LKP"."NAME", NULL) "NAME", NVL("CUSTOMER_DETAILS_LKP"."TYPE", NULL) "TYPE", "AGGREGATOR_TOTAL_AMOUNT"."REGION" "REGION", "AGGREGATOR_TOTAL_AMOUNT"."TOTAL_AMOUNT" "TOTAL_AMOUNT" FROM ( SELECT SUM("AGG_INPUT"."QUANTITY"*"AGG_INPUT"."PRICE")/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.TOTAL_AMOUNT */ "TOTAL_AMOUNT", "AGG_INPUT"."CUST_ID$1"/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.CUST_ID */ "CUST_ID", "AGG_INPUT"."REGION$1"/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.REGION */ "REGION" FROM (SELECT "SPLITTER_INPUT_SUBQUERY"."CUST_ID$2" "CUST_ID$1", "SPLITTER_INPUT_SUBQUERY"."QUANTITY$1" "QUANTITY", NVL("PRODUCT_LKP"."PRICE", NULL) "PRICE", "SPLITTER_INPUT_SUBQUERY"."REGION$2" "REGION$1" FROM ( SELECT "ODS_INVOICE_SUMMARY"."PAYMNT_TYPE" "PAYMNT_TYPE", ...... .....

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.dat Oracle PL/SQL

ORACLE

----------------------------------------------------------------------------- "AGGREGATOR_TOTAL_AMOUNT_c" Cursor declaration ---------------------------------------------------------------------------CURSOR "AGGREGATOR_TOTAL_AMOUNT_c" IS SELECT NVL("CUSTOMER_DETAILS_LKP"."CUST_KEY", NULL) "CUST_KEY", NVL("CUSTOMER_DETAILS_LKP"."NAME", NULL) "NAME", NVL("CUSTOMER_DETAILS_LKP"."TYPE", NULL) "TYPE", "AGGREGATOR_TOTAL_AMOUNT"."REGION" "REGION", "AGGREGATOR_TOTAL_AMOUNT"."TOTAL_AMOUNT" "TOTAL_AMOUNT" FROM ( SELECT SUM("AGG_INPUT"."QUANTITY"*"AGG_INPUT"."PRICE")/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.TOTAL_AMOUNT */ "TOTAL_AMOUNT", "AGG_INPUT"."CUST_ID$1"/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.CUST_ID */ "CUST_ID", "AGG_INPUT"."REGION$1"/* AGGREGATOR_TOTAL_AMOUNT.OUTGRP1.REGION */ "REGION" FROM (SELECT "SPLITTER_INPUT_SUBQUERY"."CUST_ID$2" "CUST_ID$1", "SPLITTER_INPUT_SUBQUERY"."QUANTITY$1" "QUANTITY", NVL("PRODUCT_LKP"."PRICE", NULL) "PRICE", "SPLITTER_INPUT_SUBQUERY"."REGION$2" "REGION$1" FROM ( SELECT "ODS_INVOICE_SUMMARY"."PAYMNT_TYPE" "PAYMNT_TYPE", ...... .....

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.dat Oracle PL/SQL PowerCenter

ORACLE

10

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.dat Oracle PL/SQL Teradata BTEQ PowerCenter

TERADATA ORACLE

11

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.xml customers.dat Oracle PL/SQL Teradata BTEQ XML + Java PowerCenter

TERADATA

12

No code, no programming, GUI development


validation, aggregation, wrong data reporting

customers.xml Oracle PL/SQL Teradata BTEQ XML + Java SAP ABAP PowerCenter

TERADATA

13

No code, no programming, GUI development


validation, aggregation, wrong data reporting standardization a address cleansing TERADATA Oracle PL/SQL Teradata BTEQ XML + Java SAP ABAP DQ tool PowerCenter

14

No code, no programming, GUI development


real time processing standardization and address cleaning WebService input Oracle PL/SQL Teradata BTEQ XML + Java SAP ABAP DQ tool WebService infrastruktura + WSDL + ... PowerCenter TERADATA WebService output

15

Informatica platform unique characteristics

Metadata driven Metadata centric


16

Metadata driven, metadata centric


Implementace zmn

source_system_cd

? => $ !!
17

Informatica na pkladech
PowerCenter

Implementace zmn

source_system_cd

18

Informatica na pkladech
PowerCenter

Dopad zmn

source_system_cd

19

Build Integration Library on Robust reusable platform


Graphical development environment Metadata architecture Rich transformation library: Joining disparate tables & files Pivoting for normalization Aggregating Lookups for data enrichment Parsing Expressions Tuneable memory and threading options Deploy jobs across grid Built for highly available applications

Transform and reconcile data structure and semantics to ensure consistency

20

Proven Scalability
Pipeline Parallel Processing
Provider

PowerCenter
Provider Thread

Consumer
Monitor
Consumer Thread
Portals , Dashboards , and Reports XML , Messaging , and Web Services

Design Designer

Transformation Threads

Manage

Client

XML , Messaging , and Web Services

Workflow Manager

Workflow Monitor

Administrat or

Packaged Applications

In-memory pipeline

Provider Thread

Transformation Threads
Repository Service

Consumer Thread

Services Framework

Packaged Application s

Relational and Flat Files

Repository
Relational and Flat Files

In-memory pipeline

Mainframe and Midrange

Integration Service

Web Services

Mainframe and Midrange

21

Informatica Platform
Single unified architecture
Provider

PowerCenter
Design Manage Workflow Manager Monitor Workflow Monitor

Consumer
Portals , Dashboards , and Reports XML , Messaging , and Web Services

Client

XML , Messaging , and Web Services

Designer

Administrat or

Packaged Applications

Services Framework

Repository Service

X
Repository
Web Services

Packaged Application s

Relational and Flat Files

Relational and Flat Files

Mainframe and Midrange

Integration Service

Mainframe and Midrange

22

PowerCenter SE, RE, AE and Options


PowerCenter Options PC Real Time Edition (RE)
Adv XML Orchestration Partitioning CDC 2 Instances PWX for EAI (1)
PWX for Web Services

Real-time High Availability Adv XML Data Masking High Availability Partitioning Metadata Exchange

Partitioning

PC Advance d Edition (AE)

Session on Grid Workflow on Grid

Workflow on Grid Metadata Manager

PC Standard Edition (SE)


Standard PC Capabilities

Team Based Dev Data Analyzer Standard PC Capabilities

Enterprise Grid Option


Data Validation HP Operations Smart Plug In IBM Tivoli Monitor Plug In

Partitioning Pushdown Optimization Team Based Development Unstructured Data

Real-time Standard PC Capabilities

PCSE

PCAE

PCRE

23

PowerExchange

24

Enterprise Data Integration


Universal Data Access
Messaging , and Web Services

WebSphere MQ JMS MSMQ SAP NetWeaver XI

Web Services TIBCO webMethods

Packaged Applications

JD Edwards SAP NetWeaver Lotus Notes SAP NetWeaver BI Oracle E-BusinessSAS PeopleSoft Siebel

Relational and Flat Files

Oracle DB2 UDB DB2/400 SQL Server Sybase

Informix Teradata Netezza ODBC JDBC

SaaS / BPO

Salesforce CRM Force.com RightNow NetSuite

ADP Hewitt SAP By Design Oracle OnDemand

Mainframe and Midrange

ADABAS Datacom DB2 IDMS IMS

VSAM C-ISAM Binary Flat Files Tape Formats

Industry Standards

EDIX12 EDI-Fact RosettaNet HL7 HIPAA XML LegalXML IFX cXML

AST FIX Cargo IMP MVR

Unstructure d Data and Files

Word, Excel PDF StarOffice WordPerfect Email (POP, IMPA) HTTP

Flat files ASCII reports HTML RPG ANSI LDAP

XML Standards

ebXML HL7 v3.0 ACORD (AL3, XML)

One platform for any data, any latency, for 24x7 operations

25

Any Time
Timely data to the command when you want it, how you want it

Batch Data Integration , Data Migration Analytical Data Integration Operational Data Integration Transactional Integration

nchronization to support [our] high performance requirements. PowerCenter and PowerExchange enabled us to imp
26

Any Source, Any Target


XML, Messaging, and Web Services

All Sources, Platforms, at any Latency


IBM MQSeries TIBCO webMethods SAP NetWeaver XI MSMQ SAP NetWeaver SAP NetWeaver BI SAS Essbase SalesForce.com Oracle DB2 UDB DB2/400 SQL Server Sybase ADABAS Datacom DB2 IDMS IMS Word, Excel PDF Industry Standards Web Services XML JMS JDBC Email Server Peoplesoft Oracle Apps Siebel JD Edwards LDAP PowerCenter
Relational and Flat Files

Packaged Applications

Batch

Informix Teradata Netezza ODBC Flat Files Web Logs VSAM C-ISAM Complex Files Tape Formats

Change

Mainframe and Midrange

Real time
Print Streams Unstructured

Unstructured Data

PowerExchange
27

Intro the Lab Image


1. Login to the local machine (if applicable) 2. Bring up VMware Image 3. Login to VMware hosted OS
Username: Administrator Password: infa

Helpful VMware Commands

Ctrl-Alt-Enter switch VMWare to full screen Ctrl-Alt-Insert (in VMware) same as Ctrl-Alt-Del Ctrl-Alt-Esc return to Desktop from VMware

28

Lab 1: Sources and Targets

29

What will we learn in this chapter?

How to:

1. Launch PowerCenter Designer to start your project 2. Connect to the PowerCenter Repository 3. Import Source and Target Structures
From Relational Tables and Flat Files

4. Create Target Structures


Define Tables and Create them in the Database

5. 6.
30

PowerCenter Client Tools


Designer Used to create mappings that logically define what is to be done and how. Mappings define the sources, the targets and the transformations that you want to perform on the data all through a graphical drag and drop environment. Workflow Manager Used to create, schedule and run workflows. A workflow is a set of instructions that describes how and when to run tasks related to extracting, transforming, and loading data. Workflow Monitor Used to graphically monitor the status of scheduled and running workflows for each PowerCenter server. You can view what tasks succeeded or failed and drill into the execution logs for each task to get run-time details. Repository Manager Used to create and administer the metadata repository. You can create users and groups and assign privileges and permissions to them and create folders to contain the metadata.

31

Informatica Platform
Single unified architecture
Provider

PowerCenter
Design Manage Workflow Manager Monitor Workflow Monitor

Consumer
Portals , Dashboards , and Reports XML , Messaging , and Web Services

Client
Administrat or

XML , Messaging , and Web Services

Designer

Packaged Applications

Services Framework

Repository Service

Packaged Application s

Relational and Flat Files

Repository
Relational and Flat Files

Mainframe and Midrange

Integration Service

Web Services

Mainframe and Midrange

32

Sub-Tools within Designer


Source Analyzer - Used to Import or create source definitions. Warehouse Designer - Used to Import or create target definitions. Transformation Designer - Used to create reusable transformations

Mapplet Designer - Used to create reusable groups of transformations

Mapping Designer - Used to create mappings to extract, transform and load data.

33

Source Analyzer
Integrated. Key component of PowerCenter Designer, Source Analyzer offers universal data access in a single unified platform Consistent. A single consistent method to access and manage any data source regardless of type or location Visual. Simple graphical interface for importing and creating source definitions for any of the data sources supported by PowerCenter

34

Target Designer
Integrated. Key component of PowerCenter Designer, Target Analyzer offers universal data access in a single unified platform Consistent. A single consistent method to access and manage any data target regardless of type or location Visual. Simple graphical interface for importing target definitions for any of the data types supported by PowerCenter Extensible. Can create target definitions, executable DDLs, and even create new tables in the warehouse

35

Lab 1: Step-by-step Overview


1. Launch the Designer 2. Log into the repository 3. Import relational source structure
CUSTOMERS table

4. Import flat file source structure


TRANSACTION.dat located in C:\Workshop\IPC\Sources

5. Import two relational target structures


CUSTOMER_NONAME GOOD CUSTOMERS

6. Cre ate a relational target structure and build it in the relational instance
CUSTOMER_DATES

36

Lab 1: Solution Guide

37

Using Designer

Double-Click to Launch Designer

38

Using Designer

1.Right-click the Workshop repository 2.Select Connect to open

39

Using Designer

1.Enter Username: Administrator 2.Enter Password: Administrator

40

Using Designer

1.Right-click the MappingLab folder 2.Select Open to open This is where most of our work will be done

41

Using Designer

We should now be in the Source Analyzer

1.Make sure you see Source Analyzer at the top left hand part of the gra

42

Using Designer

Import a relational source

1.From the menu bar select Sources Import from Database

43

Using Designer

In the Import Tables dialog, choose the ODBC connection for the data so 1.Click the ODBC data source drop-down box 2.Select the data source called source

Note Informatica only uses ODBC to import the metadata structures into PowerCenter.

44

Using Designer

1.Enter Username: source 2.The Owner name will self populate 3.Enter Password: source 4.Press Connect 5.
45

Using Designer

1.Open up the directory tree under Select tables 2.While holding the SHIFT key, select both the CUSTOMERS and GOOD_CUS 3.Press OK

46

Using Designer

structure for the CUSTOMERS and GOOD_CUST_STG tables

e source structure

47

Using Designer

1.From the menu bar and select Sources Import from Fil

48

Using Designer
Sources

1.Navigate to the C:\Workshop\IPC\Sources directory 2.Select the TRANSACTIONS.dat file


3.

49

Using Designer

ames from the first line check box this tells PowerCenter to start importing from ts (the flat file source Delimited not Fixed Width)

The flat file wizard is now displayed which allows us to parse through our flat file source.
50

Using Designer

1.Keep the defaults (the flat file is comma delimit 2.Press Next
Look around this page. Notice you can account for multiple delimiters, consecutive delimiters and quotes around data.

51

Using Designer
Earlier we told PowerCenter to use the first line of the original flat file for the column names. Note that the columns are now named for us. Review the other options on this page.

1.Press Finish

52

Using Designer

Congratulations!
You just successfully imported one flat file and two relational source structures.

53

Using Designer

Select the Target Designer to bring in our target structur 1.Select the second icon on the shortcut line

54

Using Designer

Notice when you select the Target designer, the menu options change. On 1.Select Targets and choose the Import from Database option

55

Using Designer

The target structures are in the target instance of the database 1.Select the target ODBC data source named target

56

Using Designer

1.Enter Username: target 2.The Owner name will self populate 3.Enter Password: target 4.Press Connect 5.
57

Using Designer

CUSTOMER_NONAME will capture all of our records that do not have an associated customer name. GOOD_CUSTOMERS will capture all clean records to be loaded into our Data Warehouse.

1.Expand the directory tree 2.Select CUSTOMER_NONAME and GOOD_CUSTOME 3.Select OK

58

Using Designer

Build a date table Select Targets Create


One of the objectives of our Data Warehouse is to allow end users to drill into a customer name and determine the date that the customer has purchased their items.

59

Using Designer

Select the database type 1.Click the drop-down box and choose Oracle for the database
2.

60

Using Designer

1.Enter CUSTOMER_DATES as the name for the target table 2.Press Create

61

Using Designer

A new table should appear in the workspace behind the pop u 1.Select Done to close the Create Target Table dialog

62

Using Designer
Edit the table - CUSTOMER_DATES 1.Double-click the CUSTOMER_DATES table

63

Using Designer

The properties for the CUSTOMER_DATES table is displayed

64

Using Designer

1.Select the Columns tab

65

Using Designer

Add columns to the table

1.Press the Add icon three times to add in three new column

66

Using Designer

1.Click NEWFIELD 2.Rename the column CUST_ID

67

Using Designer

1.Click in the Datatype column drop-down for CUST_I 2.Select number

68

Using Designer

1.Click in the Key Type drop-down for CUST_ID to make this field a Pri

69

Using Designer

e second Column Name to TRANSACTION_ID e Datatype of the TRANSACTION_ID to number. e third Column Name to Date_of_Purchase e Datatype of the Date_of_Purchase column to date

70

Using Designer

We now have a metadata target structure in the PowerCenter Metadata Repository. We will now build the table in the Oracle target instance.

71

Using Designer

Build the table in the Oracle target instance 1.Select Targets Generate/Execute SQL

72

Using Designer

Connect to the Oracle instance 1.Press Connect

73

Using Designer

1.Press the ODBC data source drop-down menu 2.Select the target database

74

Using Designer

1.Enter the Username target 2.Enter the Password target 3.Press Connect

75

Using Designer

The table has been successfully built 1.Close the Database Object Generation box
76

Using Designer

The table GOOD_CUST_STG is for staging good customer records prior to loading them into the data warehouse. It will be used as both a target (when we clean the data) and a source (when we load the clean data into the warehouse). We can reuse the source definition to create the target.

er Selected folder so that GOOD_CUST_STG is visible ST_STG object from the Sources directory tree in the navigation pane to the Targe

77

Using Designer
GOOD_CUST_STG is now setup to be used as both a source and a target in PowerCenter. However, while the table exists in PowerCenter, it does not yet exist in our target Oracle database. Lets build this table in our target Oracle database.

78

Using Designer

Build the table in the Oracle target instance 1.Select Targets Generate/Execute SQL

79

Using Designer

Connect to the Oracle instance 1.Press Connect

80

Using Designer

1.Press the ODBC data source drop-down menu 2.Select the target database

81

Using Designer

1.Enter the Username target 2.Enter the Password target 3.Press Connect

82

Using Designer

We are now connected to target

_STG table

es on the radio menu (we only want to build the GOOD_CUST_STG table) bove (We know the table doesnt exist but lets drop the table before we build the n execute

83

Using Designer

The table has been successfully built 1.Close the Database Object Generation box
84

Using Designer

If we look back at the directory tree in the Navigation Pane, we will see that TRANSACTIONS (flat file) CUSTOMERS (relational) GOOD_CUST_STG (relational) and four Targets (all relational) CUSTOMER_DATES CUSTOMER_NONAME GOOD_CUSTOMERS GOOD_CUST_STG

85

Lab 3: Building a Mapping


Data Integration Part 1

86

What will we learn in this chapter? What is a mapping? What are Transformation Objects? How do we build a mapping? How do we Join sources together? How do we separate out records with missing data?

87

PowerCenter Mapping Designer


A mapping is a logical definition of your Data Integration process it represents a set of source and target definitions that are linked by transformation objects. The mapping designer is a graphical drag and drop environment that lets you define the sources, define the targets and the transformations that you want to perform on the data An easy to use GUI environment for creating, organizing, and maintaining a series of mappings.

88

PowerCenter Transformations
Some examples

Transformations used in this mapping. For a detailed description of these Transformations and their function see the tables in Appendix A

Transaction Control Router Normalizer Custom Transformation Stored Procedure Lookup

XML Parser XML Generator Expression Joiner Mapplet Input Mapplet Output

Update Strategy Source Qualifier Sort Rank Sequence Generator Aggregator

Mapplet Filter JAVA Target Definition Union

89

PowerCenter Functions

Some Examples. A more complete reference can be found in the Appendix B at the end of this Guide

Summary view of all available functions Character manipulation (CONCAT, LTRIM, UPPER, ) Datatype Conversion (TO_CHAR, TO_DECIMAL, ) Data matching and parsing (Reg_Match, Soundex, ) Date manipulation (Date_Compare, Get_Date_Part, ) Encryption/Encoding (AES_Encrypt, Compress, MD5, ) Financial Functions (PV, FV, Pmt, Rate, ) Mathematical operations (LOG, POWER, SQRT, Abs, ) Trigonometric Functions (SIN, SINH, COS, TAN, ) Flow Control and Conditional (IIF, DECODE, ERROR, ) Test and Validation (ISNULL, IS_DATE, IS_NUMBER, ) Library of Reusable User Created Functions Variable Updates (SETVARIABLE, SETMINVARIABLE, ) Available Lookups that may be used

90

In this Scenario
We will learn how to build mappings with Designer. Mappings are a logical process that define the structure of data and how it is changed as it flows from one or more data sources to target locations. Mappings are the core of the Informatica data integration tool set. With Informatica transformations and mappings are reusable and can be used in multiple different scenarios.

For our first mapping we need to combine two sets of data for our data warehouse. We also need to separate good records from bad ones that are missing the customer name.

91

Lab 3: Step-by-step Overview


1. Create a new mapping: m_remove_missing_customers 2. Join data from two sources CUSTOMERS and TRANSACTIONS.dat 3. Check to see if the Customer Name is missing from any of the records 4. Store these records in the CUSTOMER_NONAME table 5. Write all good records to the staging table GOOD_CUSTOMERS_STG for loading into the warehouse

92

Lab 3: Solution Guide

93

How to build a Mapping

1.Select the Mapping Designer icon

94

How to build a Mapping

1.Validate that the Mapping Designer is active

95

How to build a Mapping

1.Select Mappings Create to start building a new mapping

96

How to build a Mapping

1.Rename the mapping m_remove_missing_customers 2.Press OK

97

How to build a Mapping

TRANSACTIONS to the mapping next to source and Flatfile so TRANSACTIONS and CUSTOMERS are visible NSACTIONS source into the work area

98

How to build a Mapping

The TRANSACTIONS source is added to the mapping.

99

How to build a Mapping

Add the source CUSTOMERS table to the mapping 1.Click and drag the CUSTOMERS source into the workspace
100

How to build a Mapping

Both TRANSACTIONS and CUSTOMERS are now added to the mapping.

101

How to build a Mapping

the target tables to the mapping. pand the Targets folder hile holding CTRL select the CUSTOMER_NONAME and GOOD_CUST_STG tabl ll holding CTRL, drag them onto the workspace

102

How to build a Mapping

103

How to build a Mapping

lapse the Navigation Pane for now to give us more work space (Single click-left ic lapse the Output Window at the bottom of our screen (Single Click-right icon)

104

How to build a Mapping

Add a joiner transformation to join the two source files together 1.Single click on the joiner transform 2.Single click in the workspace, the Joiner transformation should appear
105

How to build a Mapping

the TRANSACTION Source Qualifier transformation (holding SHIFT, click the firs e selection to the Joiner Transformation

106

How to build a Mapping

To join the two sources we need to add the Customer fields

1.Highlight the fields in the CUSTOMERS Source Qualifie 2.Drag them to the Joiner Next, we need to edit the Joiner properties 1.Double-click on the Joiner 2.

107

How to build a Mapping

1.Click Rename
Remember, all of this metadata will be captured in the PowerCenterMetadata Repository. Since we have the ability to report on the PowerCenter Metadata Repository, we want the names of our transformation objects to be meaningful.

108

How to build a Mapping

1.Rename the joiner jnr_many_to_one 2.Click OK

109

How to build a Mapping

Notice that once we have a field in each source named CUST_ID, it named the second instance of CUST_ID to CUST_ID1.

1.Click on the Ports tab

110

How to build a Mapping

Add a join condition 1.Click on the Condition tab 2.Click on the Add condition icon

111

How to build a Mapping

A default condition will be displayed. Since we have two fields with similar names, by default, the condition will use these to field names.

1.Press OK
2.

112

How to build a Mapping

h the data joined we need to separate good records from those with missing customer name

lick on the Router Transformation lick on the workspace to add a router to the mapping

113

How to build a Mapping

We want to keep all of the fields from the Joiner except CUST_ID1, which is the sam 1.Hold CTRL and select all fields except for CUST_ID1 2.Drag the selected fields to the Router We need to tell the Router what conditions to check for. 1. Double-click the Router to edit it.

114

How to build a Mapping

Rename the Router 1.Click Rename 2.Type Transformation Name rtr_check_customer_name 3.Click OK

115

How to build a Mapping

1. Select the Groups tab.

116

How to build a Mapping

The Router groups data based on user defined conditions. All records that meet the Group Filter Condition are included in the output for that group.

We need to create two groups. One for records with a customer name and one rec 1. Click the Add button twice.

117

How to build a Mapping

Rename the Groups 1.Click on the first Group Name 2.Rename the group GOOD_CUSTOMER 3.Click on the second Group Name 4.Rename the group CUSTOMER_NONAME Next we need to edit the Group Filter Condition 1. Click the arrow on the first condition to open editor

118

How to build a Mapping

e a NULL value for the customer name. If the record is not NULL then it is good.

ession: T ISNULL(CUST_NAME) to test your expression ose the message window. ose the Expression Editor

119

How to build a Mapping

1.Open the Expression Editor for CUSTOMER_NONA


2.

120

How to build a Mapping

1.Enter the expression: ISNULL(CUST_NAME) 2.Click OK

121

How to build a Mapping

1.Press OK

122

How to build a Mapping

The Routerappears. Expand the transformation and scroll down to see the two we created

123

How to build a Mapping


We need to connect the output groups to the appropriate table.

1.Expand the Router transform and scroll until the GOOD_CUSTO 2.Select all of the fields (or ports) under GOOD_CUSTOMER 3.Drag the selected fields to the CUST_ID field on the GOOD_CUS

Note: When you drag and release, Designer connects the first field in the set being dragged to the field under the cursor when the mouse is released, the second with the second and so on. If your fields are not in matching order you may need to connect them one at a time.
124

How to build a Mapping

1.Connect the CUSTOMER_NONAME group to the CUSTOMER_NON Both tables should now be connected

125

How to build a Mapping

Were almost done. A few final details before we finish.

1.Click the disk icon to Save the mapping 2.Click the Toggle Output Window icon to view save status and other me 3.Verify the mapping is VALID, if it is not check for Error messages 4.Finally clean up the workspace. Right-click and select Arrange All Icon

126

How to build a Mapping

Congratulations! You just built your first mapping.

127

Lab 4: Working with Data


Data Integration Part 2

28

128

What will we learn in this chapter? How to use a look-up to enrich records with data from another source? What is a reusable transformation? How to use expressions to format data? How to use aggregate functions to generate results from a data set?

129

In this Scenario
We will use Designer to build another mapping. Where the last lab focused on joining raw data and removing bad records, this lab focuses on using transformations to convert, enrich, and reformat the data and, finally, load it into the data warehouse.

Specifically, we will be working with the good records that the first mapping loaded into the staging table.

130

PowerCenter Transformations
Some examples

Transformations we will use in this lab

Transaction Control Router Normalizer Custom Transformation Stored Procedure Lookup

XML Parser XML Generator Expression Joiner Mapplet Input Mapplet Output

Update Strategy Source Qualifier Sort Rank Sequence Generator Aggregator

Mapplet Filter JAVA Target Definition Union

131

Lab 4: Step-by-step Overview


1. Create a new mapping called m_build_customer_DW 2. Get a product description from the PRODUCT table 3. Format customer names and product descriptions so the first letter is Upper Case 4. For the good data, perform a simple calculation to determine total revenue 5. Collapse any duplicates 6. Load transaction dates into a table so a reporting tool can get the date of a specific transaction

132

Lab 4: Solution Guide

33

133

How to build a Mapping

Starting from the Mapping Designer 1.Select Mappings Create to build a new mapping
134

How to build a Mapping

1.Rename the mapping m_build_customer_DW 2.Press OK

135

Working with Data


Note: This is the source view of the same staging table we wrote the good customer data to in the last lab.

Add the source GOOD_CUST_STG to the mapping 1.Drag the GOOD_CUST_STG source into the work are

136

Working with Data

The GOOD_CUST_STG source is added to the mapping

137

How to build a Mapping

e target tables to the mapping nd the Targets folder t and drag CUSTOMER_NONAME and GOOD_CUST_STG tables onto the works

138

How to build a Mapping

All sources and targets are now imported 1.Collapse the Navigation Pane for now to give us more s 2.Collapse the Output Window at the bottom of our scree

139

Working with Data

The Lookup Transformation will allow us to pull back the product description names from our PRODUCT table. This is required by the end user so they can see exactly what products were purchased by our customers.

ransformation

up Transformation icon once and single click in the workspace

140

Working with Data

Select the Lookup Table 1.Click on the Import tab 2.Select From Relational Table

141

Working with Data

We have to connect to the database instance that holds our lookup table. Note that PowerCenter will NEVER override database level security.

1.Click on ODBC data source the drop-down box 2.Select the source ODBC connection

142

Working with Data

1.Enter the Username source 2.Enter the Password source 3.Press Connect

143

Working with Data

1.Expand up TABLES folder 2.Select the PRODUCT table 3.Press OK

Working with Data

The Lookup Transformation appears in the workspace. We will use the Product_ID

1.Highlight the PRODUCT_ID field from the Source Qualifier and drag it onto the w

145

Working with Data

Open and configure the Lookup Transformation 1.Double-click on the Lookup

146

Working with Data

1.Press Rename 2.Rename the transformation lkp_product_description 3.Press OK

147

Working with Data

Much like the joiner, the lookup transformation requires a condition to be true for it to pass values. In this case, we want the product ID from the TRANSACTIONS file to match the product ID in the PRODUCTS table. Once there is a match, the lookup will return the proper product description value.

1.Select the Condition tab 2.Click the Add condition button


3.

148

Working with Data

matches the Product_IDwe passed in. Designer automatically identified the corre

149

Working with Data

Select the Return value 1.Check the box in the R column for PRODUCT_DESC 2.Press OK

150

Working with Data

We would like to do some formatting on our source data. We want the initial character of our customer names and product descriptions to be Upper Case

n Expression for formatting data

ect the Expression Transformation k on the workspace

151

Working with Data

he Source Qualifier to the Expression Transformation (skip the PRODUCT_ID

152

Working with Data


We need to add the Lookup output in with the other ports

1.Drag the PRODUCT_DESC port from Lookup to a blank line in the

153

Working with Data

Minimize completed transformations 1.Click on the minimize icon for each completed transformation 2.Next, double-click on the Expression Transformation to edit it

154

Working with Data

1.Press Rename 2.Enter exp_format_data 3.Press OK


4.

155

Working with Data

1.Select the Ports tab 2.Add field button twice to add two output ports 3.Select the first field and rename it CUST_NAME_OUT 4.Select the second field and rename it PRODUCT_DESC_OUT 5.
156

Working with Data

precision to 50 for each new port e O (output) ports for CUST_NAME and PRODUCT_DESC (they will be replaced by the n e I for the new fields (they originate here and have no input) en the O is selected the expression editor box on the right will become active

157

Working with Data

he Expression box area next to the first field CUST_NAME_OUT (an arrow will ap e arrow to open the Expression Editor

158

Working with Data

Notice the help!!! Press F1 for more

1.Edit the Expression 2.Expand the Character folder 3.Select the Initcap function 4.Double-click the function to add it to the Formula

159

Working with Data

This is a simple expression telling PowerCenter capitalize the first letter of the customer first and last name.

hat it matches the one above. Remember CUST_NAME is the input being modifie e editor

160

Working with Data

Repeat for PRODUCT_DESC_OUT 1.Press the down arrow to open the Expression Editor
161

Working with Data

1.Select the Initcap function 2.Edit the Formula so it matches the one above 3.Press OK

162

Working with Data


This is how the fields should look now. For housekeeping purposes, move the fields directly below the fields with which they correspond.

1.Click the row number at left and use the black arrows to move the row up or dow

163

Working with Data

1.Validate that the Ports are in the proper order 2.Press OK

164

Working with Data

Next we need to format our date. In our flat file, the date is an 8 character string. We need to convert that string to a date format so that it matches the format the target database (Oracle) is expecting

1.Validate the mapping it should look like this 2.Open the Navigation Pane

165

Working with Data

exp_formatted_date is a sharable, re-usable transformation

1.Select the Transformation Developer 2.Expand the Transformations folder in the left Navigation pane 3.Drag the exp_formatted_date transformation onto the workspa 4.Double-click the transformation to edit it

166

Working with Data

1.Select the Ports tab 2.Open the Expression Editor for the formatted_date port

167

Working with Data

1.Review the expression formula 2.Press OK 3.Press OK on the next screen to close the Edit Transformations
168

Working with Data


Because this is a reusable transformation, any changes we make will propagate to every mapping that uses the transformation. We may want to know what mappings include this transformation before we change it. To do this we run a dependency report.

1.Right click on the transformation 2.Select Dependencies


3.

169

Working with Data

1.Select any Object Types that should be included in the repo 2.Press OK
3.

170

Working with Data

1.Review the report content. In this case there are no depe 2.Close the report

171

Working with Data

1.Click and drag the exp_formatted_date expression to the workspa

172

Working with Data

DATEOFTRANSACTION port to the DATE_IN port on the new Expression Trans Aggregator to our mapping

173

Working with Data

We need to calculate the total revenue for each customer. The Aggregator transformation performs these types of functions on groups of data. It can also help collapse records based on a grouping criteria (CUST_ID in this case), eliminating duplicate sets of results
174

Working with Data

1.Map the output ports from the two expressions to the Aggregato 2.Minimize the Expressions now we are done with them 3.Double-click the Aggregator to edit the transformation properties 4.

175

Working with Data

Rename the Aggregator Transformation 1.Click Rename 2.Name the transformation agg_revenue 3.

176

Working with Data

Update port names and build the aggregate calculation

1.Select the Ports tab 2.Remove the _OUT from the CUST_NAME and PRODUCT_DESC 3.Click Add new port button once A new port is added to the Aggregator

177

Working with Data

1.Rename NEWFIELD to TOTAL_REVENUE 2.Change the Datatype to Double 3.De-select the I so the Expression Editor becomes available 4.Click the arrow to open the Expression Editor

178

Working with Data

1.Build the expression shown above 2.Press OK

179

Working with Data

r calculation computes the total revenue by customer. To accomplish this, data needs to be

heck the GroupBy box for the CUST_ID port ress OK

180

Working with Data

We are ready to map the fields from the aggregator to the GOOD_CUSTOMERS table

he relevant ports from the Aggregator e selected fields to the matching ports on the GOOD_CUSTOMERS target table

181

Working with Data

We want to map three of the fields in the Aggregator to our second target, CUSTOMER_DATES. The CUST_ID field will go to both targets.

1.Select the relevant ports from the Aggregator to map to CUSTOMER_DATES 2.Connect the selected fields to the matching ports on the target table

182

Working with Data

Almost done. Lets apply the finishing touches.

1.Save the mapping 2.Verify the mapping is VALID 3.Clean up. Right click anywhere in the workspace, select Arrange All
4.

183

Working with Data

Congratulations!
You are now ready to load your data into the Data Warehouse.

184

Lab 5: Workflow
Using Workflow Manager and Monitor

85

185

What will we learn in this chapter?


1. What is Workflow Manager? 2. How do we build a session task? 3. How do we sequence sessions? 4. How do we execute our mapping? 5. How do we monitor execution with Workflow Monitor?

186

Informatica Platform
Workflow Manager and Workflow Monitor
Provider

PowerCenter
Design Manage Workflow Manager Monitor Workflow Monitor

Consumer
Portals , Dashboards , and Reports XML , Messaging , and Web Services

Client
Administrat or

XML , Messaging , and Web Services

Designer

Packaged Applications

Services Framework

Repository Service

Packaged Application s

Relational and Flat Files

Repository
Relational and Flat Files

Mainframe and Midrange

Integration Service

Web Services

Mainframe and Midrange

187

Workflow Tasks
Workflow Tasks
Assignment Command Control Decision Email Event-Raise Event-Wait Session Timer

Description
Assigns a value to a workflow variable Specifies a shell command to run during the workflow. Stops or aborts the workflow. Specifies a condition to evaluate. Sends email during the workflow. Notifies the Event-Wait task that an event has occurred. Waits for an event to occur before executing the next task. Runs a mapping you create in the Designer. Waits for a timed event to trigger.

188

In this Scenario

We will use the Workflow Manager and Workflow Monitor to build a workflow to execute the mappings we just built. We will configure our workflow and then monitor the workflow in the Workflow Monitor. Along the way, we will investigate the various options in both tool sets.

189

Lab 5: Step-by-step Overview


1. Open the Workflow Manager through Designer 2. Create a session task. 3. Configure the session task to run the mappings we just built. 4. Investigate the options in the Workflow Manager. 5. Monitor the execution of the session in the Workflow Monitor. 6. View the run properties and session log in the Workflow Manager. 7.

190

Lab 5: Solution Guide

91

191

Working with Data

ch the Workflow Manager

ess the Orange W on the tool bar above to launch the Workflow Manager

192

Workflow Manager Tools

Create reusable tasks

Create worklets

Create workflows

193

Using the Workflow Manager

1.Select the Workflow Designer

194

Using the Workflow Manager

Select the Session

task and drop it in by clicking on the Workflow Designer w

195

Using the Workflow Manager

n and remove records with no customer name before we can load them into the Da

apping m_remove_missing_customers

196

Using the Workflow Manager

Keep all the defaults 1.Press OK

197

Using the Workflow Manager

We need to configure the Session to connect to the source and targe 1.Double-click the Session task to open and edit it

198

Using the Workflow Manager

1.Select the Mapping tab

2.Select SQ_TRANSACTIONS (under the Sources folder on the left)

199

Using the Workflow Manager

1.Scroll down under Properties until you see Source file directory 2.Enter the location C:\Workshop\IPC\Sources as the Source file directory 3.Enter TRANSACTIONS.dat as the Source filename

C:\Workshop\IPC\Sources

200

Using the Workflow Manager

1.Select SQ_CUSTOMERS under Sources on the left 2.Click the drop-down to select the correct Oracle instance that houses this sour

201

Using the Workflow Manager

al Connection Browser opens

ource connection under Objects (this is the Oracle instance where the CUSTOME

202

Using the Workflow Manager

Configure the target structures 1.Select CUSTOMER_NONAME from the Targets folder on the left 2.Click the drop-down box under Value to open the Relational Connction Browser

203

Using the Workflow Manager

1.Select Target 2.Press OK

204

Using the Workflow Manager


Since all of our target tables exist in the same place, lets take a shortcut.

click in the Value box Apply Connection Value To all Instances to assign this connection value to a

205

Using the Workflow Manager

1.Review the information for GOOD_CUST_STG 2.Notice Target is already filled in 3.Press OK to close the Session Editor

206

Using the Workflow Manager


The GOOD_CUST_STG staging table may have data in it from previous runs. We want to make sure the only data in the table is for the current run.

1.Under Properties, scroll down and select the Truncate target table o 2.Select OK to close the Session Editor 3.

207

Using the Workflow Manager


Loading the Data Warehouse is a two part process. The first mapping/session joins the source data, removes bad records and loads good data into a staging table. The data still needs to be refined and loaded into the Data Warehouse. The second mapping we built does this.

1.Add another Session task to the workspace

208

Using the Workflow Manager

1.Select the mapping m_build_customer_DW 2.Click OK

209

Using the Workflow Manager

w Session is added. We need to sequence the sessions so they execute in the pro

Link Tasks on the left session and drag to the session on the right, so the sessions are connec e-click the new Session (on right) task to edit it

210

Using the Workflow Manager

1.Select the Mapping tab

211

Using the Workflow Manager

1.Select SQ_GOOD_CUST_STG under Sources on the left 2.Click the arrow under Value to select the correct Oracle instance for this source

212

Using the Workflow Manager

In the Relational Connection Browser 1.Select the Target connection under Objects why ?? 2.Press OK

213

Using the Workflow Manager

Configure the target structures 1.Select CUSTOMER_DATES from the Targets folder on the left 2.Click the arrow under Value to open the Relational Connction Browser

214

Using the Workflow Manager

1.Select Target 2.Press OK

215

Using the Workflow Manager


Since all of our target tables exist in the same place, lets take a shortcut.

lick in the Value box Apply Connection Value To all Instances to assign this connection value to a

216

Using the Workflow Manager

1.Verify GOOD_CUSTOMERS now uses the Target Connection

217

Using the Workflow Manager


The Lookup Transformation also requires a Connection

he Transformations folder in the left navigation pane

the lkp_product_description Connection Value uses Source, if not click the arrow OK

218

Using the Workflow Manager

Take a moment to review the configuration options under the 1.Review Properties

Properties allow you to specify log options, recovery strategy, commit intervals for this session in the workflow and so forth. Note in this case the workflow will continue even if the mapping fails.

219

Using the Workflow Manager


1.Review Config Object

The Config Objectallows you to specify a variety of Advanced, Logging, Error Handling and Grid related options. Scroll down to view the range of options available.

220

Using the Workflow Manager


1.Review Components 2.Select OK to close the Session Editor

In the Components tab, you can configure presession shell commands, post-session commands, email messages if the session succeeds or fails, and variable assignments.

221

Using the Workflow Manager

Save the workflow 1.Click Save under the Repository menu

222

Using the Workflow Manager

1.Verify the workflow is VALID, if not scroll up to check for error 2.Select Workflows Start Workflow
223

Using the Workflow Monitor

Workflow Monitor provides a variety of views for monitoring workflows and sessions. This view shows the status of running jobs.

1.Notice that the Workflow Monitor is displayed when you start a 2.Let the task run to completion

224

Using the Workflow Monitor

1.Select the Task View tab


2. This view allows users to view the tasks associated with a specific workflow. Note that in this case our workflow has two sessions and has been successfully run several times. Your view may vary depending on when and how many times you have run your mapping

225

Using the Workflow Monitor

1.Select the Gantt Chart view 2.Right click on the first session in the workflow we just ran 3.Select Get Run Properties
4.

226

Using the Workflow Monitor

1.Review the Task Details 2.Note the session Status 3.Note the number of Source and Target rows Do the results make sense? Two tables were joined so we would expect a lower total writ 1.Click and expand Source/Target Statistics

227

Using the Workflow Monitor

Source/Target Statistics ere written to CUSTOMER_NONAME Table but 11 were rejected rows er and check the Last Error Message for that target

Looks like Writer execution failed for some reason with error 8425. Lets take a look at the session log and find out what the 8425 error is.

1.Select the Get Session Log tab (Hyperlink on top right)

228

Using the Workflow Monitor

1.Select Find. . . 2.Enter the Error Number 8425 3.Select the radio button for All fields 4.Select Find Next

229

Using the Workflow Monitor


It seems we have a unique constraint violation. Mostly likely there are duplicate primary keys in the data. Lets debug.

1.Close out the session


230

Using the Workflow Manager

In order to debug, lets override writing our data to the CUSTOMER_NONAME table.

1.Open up our Session Task again

231

Using the Workflow Manager

1.Select CUSTOMER_NONAME from the Mapping tab 2.Override the Relational Writer 3.Select the drop-down box

232

Using the Workflow Manager

1.Select File Writer


Notice we can override our target because PowerCenter separates logical design from physical bindings. Specifically mappings do not include connection information, while workflows do, actual binding occurs at runtime.

233

Using the Workflow Manager

1.Under properties Scroll down to Header Options 2.Click drop-down and select Output Field Names 3.Select Set File Properties

234

Using the Workflow Manager

1.Switch the radio button to Delimited 2.Press OK 3.Press OK to exit the Session Editor
4.

235

Using the Workflow Manager

1.Save the changes we made 2.Verify the workflow is VALID 3.Run the workflow again

236

Using the Workflow Monitor

We were now able to load all 19 rows. No rows were rejected.

1.Review the output file

237

Using the Workflow Monitor

In Windows Explorer navigate to C:\Informatica\9.0.1\server\infa_shared\TgtFiles Double-click on the customer_noname1.out file

238

Using the Workflow Monitor

As we suspected, we have duplicate Customer IDs and will have to deal with that in our mapping, but well save that for another day!
239

Using the Workflow Monitor


Before we finish, we want to verify that our data loaded into the Data Warehouse.

1.Go to Designer and open the Target Designer 2.Right click on the GOOD_CUSTOMERS target 3.Select Preview Data. . .

240

Using the Workflow Monitor

1.Verify the ODBC data source is target 2.Enter Username: target 3.Enter Password: target 4.Press Connect

241

Using the Workflow Monitor Congratulations!!


The Data was Successfully Loaded! You just completed building and loading the Data Warehouse!

242

Lab 6: Using the Debugger

43

243

What will we learn in this chapter?


What is the Debugger? How do we use the Debugger? What are the advantages of using the Debugger? What are some of the options in the Debugger?

244

In this Scenario
As a developer you want to test the mapping you built prior to running the data to ensure that the logic in the mapping will work. For this lab we will use a pre-built mapping to review the features of the Debugger

245

Lab 6: Step-by-step Overview


1. Open the Debugger lab folder 2. Run the Debugger 3. Configure the Session with the Debugger Wizard 4. Edit Breakpoints 5. Step through the mapping 6. Monitor results 7.

246

Lab 6: Solution Guide

47

247

Using the Debugger

Open the DebuggerLab 1.Right-click on DebuggerLab folder and select Open


248

Using the Debugger

1.Open the Mapping Designer 2.Expand the Mappings Folder 3.Drag M_DebuggerLab to the Mapping Designer workspace

249

Using the Debugger

Debugger Toolbar Start Debugger Stop the Debugger Next Instance Step to Instance Show Current Instance Continue Break Now Edit Breakpoints

250

Using the Debugger

1.Start the Debugger

251

Using the Debugger

1.Review the pre-requisites 2.Press Next

252

Using the Debugger

1.Select the Int_Workshop_Service as the Integration Service on which to r 2.Leave the defaults 3.Click Next

253

Using the Debugger

1.Choose the Source and Target database connectio 2.Leave the default values of Source and Target 3.Click Next

254

Using the Debugger

Configure Sessionparameters. No change. 1.Click Next

255

Using the Debugger

Configure Session parameters. No change 1.Click Next

256

Using the Debugger


Do we want to physically load the table or roll back the data before commit in the debug session? In this case we just want to test the mapping, not actually load the data.

Configure Session parameters 1.Check Discard target data 2.Click Finish to start the session

257

Using the Debugger

Lets adjust the tool bars so it is easier to work with the Debugger. 1.Right click on the tool bar and unselect the Advanced Transformations too 2.Repeat and select Debugger so the toolbar is visible

258

Using the Debugger

1.Select Edit Breakpoints to establish breakpoints to stop the debug session at

259

Using the Debugger

We want to establish a breakpoint at the Expression Transformati


1.Select the EXPTRANS object

260

Using the Debugger

Select the Add button to create a breakpoint at the expression transformation Under Condition, click the Add box to set the breakpoint rules Edit the rule so that it will stop when CUST_ID = 325 Click OK

261

Using the Debugger

1.Notice the Stop Sign Breakpoint set at EXPTRANS Transformatio

262

Using the Debugger

Debugger Menu

Breakpoint

Output Window Debugger or Session Log

Target Instance Window

Transformation Instance Data Window

263

Using the Debugger

Next Instance

From the Debugger Toolbar 1.Click Next Instance to step into the mapping 2.Review values and outputs in the debug panes 3.Continue to step through and monitor changes

See Output

Examine values

264

Using the Debugger

tance until 9 records have been processed. t below Debugger

265

Using the Debugger

When the Debugger closes, Designer returns to the normal de

1.Note the shutdown complete message in the output window

266

Lab 7: Web Services


Making Your Mapping SOA Ready

67

267

What we will learn in this chapter?


Web Service Architecture Web Service Consumer Web Service Provider

268

Informatica Platform
Workflow Manager and Workflow Monitor
Provider

PowerCenter
Design Manage Workflow Manager Monitor Workflow Monitor

Consumer
Portals , Dashboards , and Reports XML , Messaging , and Web Services

Client
Administrat or

XML , Messaging , and Web Services

Designer

Packaged Applications

Services Framework

Repository Service

Packaged Application s

Relational and Flat Files

Repository
Relational and Flat Files

Mainframe and Midrange

Integration Service

Web Services

Mainframe and Midrange

269

Web Service Hub (Provider) Capabilities


Real-Time Transformation Services
Allows PowerCenter transformations, workflows/sessions to be called by external web services Allows passing data to workflows for processing Can return results back to the web service caller

Data Integration Services


Web service interface to PowerCenter operations to get server status, start/stop/resume workflows/tasks, retrieve session stats/logs

Metadata Services
Allows retrieval of PowerCenter metadata via web services including metadata for Repositories, Servers, Folders, Workflows, and Tasks

All Provider functions require Web Services Hub


270

Web Services Hub (Provider)


How it works
Web Service Provider
SOAP Request
WSDL
Clients

Web Services Hub


G A T E W A Y
Metadata Services Data Integration Services Transformatio n Services
Repository Server

Repository 1

Repository 2

Web Servic es Client

Response

Data Servers
ETL Workflow

S 1

S 2

S 3 S 4

Web Service Consumer

External Web Service

271

Webservice Provider Hub Benefits


Concurrent and scalable web services execution Performance/ Scalability
Dynamic Scalability Support for multiple instances of Web Services Hub

Usability
Web Service Wizards Does not require WSDL knowledge

WSDL Workspace
Efficiently handles complex SOAP request/response

Built-in Web Services Testing tool Web Services Monitoring and Reports

272

Web Service Consumer Capabilities


Consumes external web services
Source Web Service Target Web Service Transformation Web Service (in-line)

Supports RPC/Encoded and Document/Literal web services Does not use the Web Service Hub

273

Web Service Consumer


How it Works Use Web Services as a:
Source Target Transformation
Credit Validation

SOAP Request SOAP Response With Data Web Service Source

Purchasing System

Web Service Transfor m

Web Service Target

SOAP Request With Data

Inventory System

PowerCenter Session

274

Web Service Consumer Example

275

In this Scenario
We have been asked to develop a reusable Web Service that will accept and Employee Number and return the Employees Name, Job, Manager Name, Hire Date and Salary, Commission, Department Name. The Web Service needs to be exposed via the Web Services Hub so it can be called by external systems that require this information.

276

Lab 7: Step-by-step Overview


1. Invoke the Web Service Wizard in Designer 2. Select the EMP table as the basis for both the input and output of the web service 3. Create a lookup transformation to retrieve the Employees record 4. Create a web service enabled workflow 5. Run the Web Service Hub to test the web service

277

Lab 7: Solution Guide

78

278

Open the WebServiceLab folder in Designer

1.Double-click on WebServiceLab to open the folder 2.Click on Mapping Designer icon 3.


279

Start the Web Service Wizard

he menu bar ct Mappings Create Web Service Mapping Use Source/Target definitio

280

Import Source Information

Under Source Ports 1.Click the Import from source/target icon

281

Import Source Information

1.Open Sources 2.Select EMP 3.Click OK


4.

282

Remove extra fields from source


We only need the EMPNO as an input field so we need to remove extra fields

1.Scroll to bottom of the Source Ports list 2.Click on 8 3.Click the Delete a port icon to remove fields 4.Repeat until only EMPNO remains

283

Import Target Information

Under Target Ports 1.Click the Import from source/target icon

284

Import Target Information

1.Open Sources 2.Click on EMP 3.Click on OK 4.


5.

285

Generate the mapping

1.Enter Web Service Name GetEmpInfoLab (the name will be used by PowerC 2.Check Create Mapping 3.Click OK PowerCenter will generate a mapping that returns all the fields in the EMP table

286

Open the Generated Mapping

1.Open the Mappings folder 2.Drag M_GetEmpInfoLab to the Mapping Designer

287

Add a Lookup Transformation

From the menu bar 1.Select Transformation Create

288

Add a Lookup Transformation

1.Select Lookup from the drop-down list 2.Name the transformation lkp_GetEMP 3.Press Create
4.

289

Add a Lookup Transformation


Select the database table where the lookup data is located

1.Select Source as the location of the Lookup Table 2.Navigate to the EMP table under WebServiceLab Sources Scott 1.Click OK
2.
290

Add a Lookup Transformation

1.Click Done to close the Create Transformation dialog box

291

Add a Lookup Transformation

1.Click and drag n_EMPNO in the source qualifier to the new Lookup transform 2.Double-click the Lookup to open the transformation editor 3.

292

Configure the Lookup Transformation

The default condition linked EMPNO with the input value of n_EMPNO this looks up the incoming value and see if it is found in the EMP table. This is the condition we want.

1.Click on the Condition Tab 2.Click Add a new condition 3.Click OK 4.

293

Link Lookup Fields with Target

Map the Lookup ports to the Web Services target 1.Select all Lookup ports except for the input n_EMPNO 2.Drag the fields to the n_EMPNO port in the target

294

Save the Mapping


From the menu bar 1.Select Repository Save
2.

In the Output Window you should see Mapping M_GetEmpInfoLab is VALID. We are now ready to create our Workflow

295

Create the workflow

1.Open Workflow Manager 2.Open WebServiceLab Folder 3.Click on Workflow Designer

296

Create the Workflow

1.From the menu bar select Workflows Create


2.

297

Create the Workflow

1.Name the Workflow wf_GetEmpInfoLab 2.Click Enabled to enable the Workflow as a Web Service 3.Click Config Service. . .
4.

298

Configure the Web Service

1.Enter GetEmpInfoLab as the Service Name 2.Set the Maximum Run Count Per Hub to 5 3.Click Visible and Runnable 4.Click the icon to configure Web Service Hubs

299

Configure the Web Service

1.Select Select from the list 2.Highlight PowerCenter WebServices Hub 3.Click OK

300

Configure the Web Service

1.Validate that the Config Service dialog looks like this 2.Click OK

301

Configure the Web Service

1.Validate that the Create Workflow dialog looks like this 2.Click OK to close

302

Add a Session

Add a Session to the Workflow 1.Click the Session icon 2.Click in the Workflow Designer workspace

303

Add a Session

1.Select the M_GetEmpInfoLab mapping 2.Click OK

304

Link Start Task with Session Task

1.Click the Link Tasks icon 2.Click on the Start task and drag to the s_MGetEmpInfoLab Session to link the tw 3.Double-click the s_M_GetEmpInfoLab task to open it for editing

305

Configure Session Task

1.Select the Mapping Tab to configure the mapping 2.Click lkp_GetEMP under the Transformations folder 3.Click the arrow under Connections to choose the correct database connec

306

Choose Database Connection for Lookup

1.Select Use object 2.Select Scott under Oracle 3.Click OK

307

Configure Session
1.Validate that the Session looks like this 2.Click OK

308

Saving the Workflow

From the menu bar 1.Select Repository Save

In the Output Window you should see Mapping wf_GetEmpInfoLab is VAL 1.

309

Testing the Web Service

Connect to the Web Services Hub 1.Open Internet Explorer 2.Click on the Web Services Hub link
3.

310

Testing the Web Service

Under the Web Services Hub navigation pane, Realtime Web Services 1.Select Valid WebService 2.In the Web Services pane, scroll and find GetEmpInfoLab 3.Click GetEmpInfoLab so that the row is selected (green) 4.Click Try-it

311

Testing the Web Service

Under Web Service Operations 1.Select GetEmpInfoLabOperation

312

Testing the Web Service

1.Enter 7844 for the EMPNO 2.Press Send Other valid EMPNOs are 7369, 7499, 7521
1.

313

Testing the Web Service

Success!

314

Additional Informatica Resources

15

315

Informatica Community
my.informatica.com

316

My.informatica.com Assets
Searchable knowledge base Online support and service request management Product documentation and demos Comprehensive partner sales, support and training tools Velocity Informaticas implementation methodology Educational services offerings Mapping Templates Link to devnet Many more

317

Developer Network
devnet.informatica.com

318

Lab 8: Putting it all together

19

319

Suggested Naming Conventions


Targets T_TargetName. Mappings m_MappingName. Sessions s_MappingName. Workflows wf_WorkflowName Transformations (in a mapping) two or three letter transformation abbreviation followed by name Expression = exp_ExpressionName

Some Examples. A more complete set of transformation naming conventions can be found in the Appendix C at the end of this Guide
320

In this Scenario
You are the regional manager for a series of car dealerships. Management has asked you to track the progress of your employees. Specifically, you need to capture:
Employee name Name of the dealership they work at What they have sold How much they have sold (net revenue)

321

Lab 8: Step-by-step Overview

In this lab, you will perform the following steps:

1. Create a new target definition to use in the mapping, and create a target table based on the new target definition. 2. Create a mapping using the new target definition. You will add the following transformations to the mapping:
Lookup transformation. Finds the name of the employees, dealerships they work at, and all products they have sold. Aggregator transformation. Calculates the net revenue that the employee has sold. Expression transformation. Format all employees names and product descriptions.

3. Create a workflow to run the mapping in the Workflow Manager 4. Monitor the workflow in the Workflow Monitor

322

Step 1: Sources and Targets


1. Open up the MappingLab folder 2. Use the mm_data user (user_id/password: mm_data/mm_data) to bring in the mm_transactions table 3. Create your own Oracle target in the Target Designer in the target instance in Oracle Target should be named T_Employee_Summary Columns should include: EMP_NAME (varchar2, length 50, primary key) PRODUCT_SOLD (varchar2, length 50) DEALERSHIP (varchar2, length 50) NET REVENUE (number)

323

Step 2: Mapping
1. Open up Mapping Designer 2. Create a new mapping call it whatever you like 3. Bring in mm_transaction source and T_Employee_Summary target 4. Find dealership name (hint: Use the mm_data user as all dealerships names are kept in the mm_dealership table) 5. Find product description (hint: Use mm_data user as all product descriptions are kept in the mm_product table) 6. Find employee name (hint: Use mm_data user as all employees names are kept in the mm_employees table) 7. Format the employee name and make sure the name is capitalized 8. Format the product description and make sure the initial letters are capitalized 9. Calculate net revenue (hint: keep it simple, net revenue is revenue cost) 10. Group by Employee_ID to collapse all unique employees 11. Map to target table

324

Step 3: Build the workflow


1. Open Workflow Manager 2. Create a new workflow 3. Use a session task to execute mapping 4. Configure session task 5. Execute mapping

325

Step 4: Monitor workflow


1. Open Workflow Monitor 2. Monitor workflow 3. Debug using session log as necessary 4. Preview data to be sure it worked properly Hint: To preview data, go to Designer open up Target Designer right click on T_Employee_Summary select Preview Data enter username and password (target/target)

326

Lab 9: Extra credit

27

327

Sorted input
1. For the mapping in lab 3 set the joiner property of sorted input on. 2. Do the same for the aggregator in the mapping of the lab 4.
Hints Sorted input will require the data coming in the transformation to be sorted. This can be achieved either by sorting in the source qualifier or adding sort transformation. In lab 3 one sources is flat file that will require adding sorter transformation. The second source is an oracle table and it can be sorted by oracle or you can choose the sorter tranformation.

328

Dynamic Partitionning
1. Your VM is set for 2 CPU)Cores 2. Partitioning is a powerful way of getting the performance 3. Informtica provides automated ways of Partitioning 4. Revising the sessions created in the lab 5 and set dynamic partitioning to them based on the CPU
Hint Look into ths session properties tab

329

Thank You!

30

330

Appendix A PowerCenter Transformations

31

331

Transformation Objects
Transformation
Aggregator Application Source Qualifier Custom Data Masking Expression External Procedure Filter HTTP Input Java Joiner Lookup Normalizer Output Rank

Description
Performs aggregate calculations. Represents the rows that the PowerCenter Server reads from an application, such as an ERP source, when it runs a session. Calls a procedure in a shared library or DLL. Replaces sensitive production data with realistic test data for non-production environments. Calculates a value. Calls a procedure in a shared library or in the COM layer of Windows. Filters data. Connects to an HTTP server to read or update data. Defines mapplet input rows. Available in the Mapplet Designer. Executes user logic coded in Java. The byte code for the user logic is stored in the repository. Joins data from different databases or flat file systems. Looks up values. Source qualifier for COBOL sources. Can also use in the pipeline to normalize data from relational or flat file sources. Defines mapplet output rows. Available in the Mapplet Designer. Limits records to a top or bottom range.

332

Transformation Objects
Transformation Router Sequence Generator Sorter Source Qualifier SQL Stored Procedure Transaction Control Union Unstructured Data Update Strategy XML Generator XML Parser XML Source Qualifier Description Routes data into multiple transformations based on group conditions. Generates primary keys. Sorts data based on a sort key. Represents the rows that the PowerCenter Server reads from a relational or flat file source when it runs a session. Executes SQL queries against a database. Calls a stored procedure. Defines commit and rollback transactions. Merges data from different databases or flat file systems. Transforms data in unstructured and semi-structured formats. Determines whether to insert, delete, update, or reject rows. Reads data from one or more input ports and outputs XML through a single output port. Reads XML from one input port and outputs data to one or more output ports. Represents the rows that the Integration Service reads from an XML source when it runs a session.

333

Appendix B PowerCenter Functions

34

334

Aggregate Functions
Function Description
AVG COUNT FIRST LAST MAX MEDIAN MIN PERCENTILE STDDEV SUM VARIANCE Returns the average of all values in a group. Returns the number of records with non-null value, in a group. Returns the first record in a group. Returns the last record in a group. Returns the maximum value, or latest date, found in a group. Returns the median of all values in a selected port. Returns the minimum value, or earliest date, found in a group. Calculates the value that falls at a given percentile in a group of numbers. Returns the standard deviation for a group. Returns the sum of all records in a group. Returns the variance of all records in a group.

335

Character Functions
Function ASCII Descriptionthe numeric ASCII value of the first character of the string In ASCII mode, returns
passed to the function. In Unicode mode, returns the numeric Unicode value of the first character of the string passed to the function. CHR Returns the ASCII or Unicode character corresponding to the specified numeric value.

CHRCODE

In ASCII mode, returns the numeric ASCII value of the first character of the string passed to the function. In Unicode mode, returns the numeric Unicode value of the first character of the string passed to the function. Concatenates two strings. Capitalizes the first letter in each word of a string and converts all other letters to lowercase. Returns the position of a character set in a string, counting from left to right.

CONCAT INITCAP INSTR

336

Character Functions (contd)


Function
LENGTH LOWER LPAD LTRIM METAPHONE

Description
Returns the number of characters in a string, including trailing blanks. Converts uppercase string characters to lowercase. Adds a set of blanks or characters to the beginning of a string, to set a string to a specified length. Removes blanks or characters from the beginning of a string. Encodes characters of the English language alphabet (A-Z). It encodes both uppercase and lowercase letters in uppercase. Replaces characters in a string with a single character or no character. Replaces characters in a string with a single character, multiple characters, or no character. Converts a string to a specified length by adding blanks or characters to the end of the string. Removes blanks or characters from the end of a string. Works for characters in the English alphabet (A-Z). It uses the first character of the input string as the first character in the return value and encodes the remaining three unique consonants as numbers. Returns a portion of a string. Converts lowercase string characters to uppercase.

REPLACECHR REPLACESTR RPAD RTRIM SOUNDEX

SUBSTR UPPER

337

Conversion Functions
Function
TO_BIGINT

Description
Converts a string or numeric value to a bigint value.

TO_CHAR

Converts numeric values and dates to text strings.

TO_DATE

Converts a character string to a date datatype in the same format as the character string. Converts any value (except binary) to a decimal.

TO_DECIMAL

TO_FLOAT

Converts any value (except binary) to a double-precision floating point number (the Double datatype).

TO_INTEGER

Converts any value (except binary) to an integer by rounding the decimal portion of a value.

338

Data Cleansing Functions


Function
GREATEST IN INSTR IS_DATE IS_NUMBER IS_SPACES ISNULL LEAST LTRIM METAPHONE

Description
Returns the greatest value from a list of input values Matches input data to a list of values Returns the position of a character set in a string, counting from left to right. Returns whether a value is a valid date. Returns whether a string is a valid number. Returns whether a value consists entirely of spaces. Returns whether a value is NULL. Returns the smallest value from a list of input values. Removes blanks or characters from the beginning of a string. Encodes characters of the English language alphabet (A-Z). It encodes both uppercase and lowercase letters in uppercase.

339

Data Cleansing Functions (contd)


Function
REG_EXTRACT REG_MATCH REG_REPLACE REPLACECHR REPLACESTR RTRIM SOUNDEX SUBSTR TO_BIGINT TO_CHAR TO_DATE TO_DECIMAL TO_FLOAT TO_INTEGER

Description
Extracts subpatterns of a regular expression within an input value Returns whether a value matches a regular expression pattern Replaces characters in a string with a another character pattern. Replaces characters in a string with a single character or no character Replaces characters in a string with a single character, multiple characters, or no character. Removes blanks or characters from the end of a string. Encodes a string value into a four-character string. Returns a portion of a string. Converts a string or numeric value to a bigint value. Converts numeric values and dates to text strings. Converts a character string to a date datatype in the same format as the character string. Converts any value (except binary) to a decimal. Converts any value (except binary) to a double-precision floating point number (the Double datatype). Converts any value (except binary) to an integer by rounding the decimal portion of a value.

340

Date Functions
Function ADD_TO_DATE Description Adds a specified amount to one part of a date/time value, and returns a date in the same format as the specified date.

DATE_COMPARE DATE_DIFF

Returns a value indicating the earlier of two dates. Returns the length of time between two dates, measured in the specified increment (years, months, days, hours, minutes, or seconds). Returns the specified part of a date as an integer value, based on the default date format of MM/DD/YYYY HH24:MI:SS. Returns whether a string value is a valid date. Returns the date of the last day of the month for each date in a port. Returns the date and time based on the input values Rounds one part of a date. Sets one part of a date/time value to a specified value. Date/Time datatype. Passes the date values you want to convert to character strings Truncates dates to a specific year, month, day, hour, or minute.

GET_DATE_PART IS_DATE LAST_DAY MAKE_DATE_TIME ROUND SET_DATE_PART TO_CHAR (DATE) TRUNC

341

Encoding Functions
Function AES_DECRYPT AES_ENCRYPT COMPRESS CRC32 DEC_BASE64 DECOMPRESS ENC_BASE64 Description Returns encrypted data to string format Returns data in encrypted format Compresses data using the zlib compression algorithm Returns a 32-bit Cyclic Redundancy Check (CRC32) value Decodes the value and returns a string with the binary data representation of the data Decompresses data using the zlib compression algorithm Encodes data by converting binary data to string data using Multipurpose Internet Mail Extensions (MIME) encoding Calculates the checksum of the input value. The function uses Message-Digest algorithm 5 (MD5)

MD5

342

Financial Functions
Function FV
NPER PMT PV RATE

Description of an investment, where you make periodic, constant payments Returns the future value
and the investment earns a constant interest rate Returns the number of periods for an investment based on a constant interest rate and periodic, constant payments Returns the payment for a loan based on constant payments and a constant interest rate Returns the present value of an investment Returns the interest rate earned per period by a security

343

Numeric Functions
Function ABS CEIL CONVERT_BASE CUME EXP FLOOR LN LOG MOD MOVINGAVG MOVINGSUM POWER RAND ROUND SIGN SQRT TRUNC Description Returns the absolute value of a numeric value. Returns the smallest integer greater than or equal to the specified numeric value. Converts a number from one base value to another base value Returns a running total of all numeric values. Returns e raised to the specified power (exponent), where e=2.71828183. Returns the largest integer less than or equal to the specified numeric value. Returns the natural logarithm of a numeric value. Returns the logarithm of a numeric value. Returns the remainder of a division calculation. Returns the average (record-by-record) of a specified set of records. Returns the sum (record-by-record) of a specified set of records. Returns a value raised to the specified exponent. Returns a random number between 0 and 1 Rounds numbers to a specified digit. Notes whether a numeric value is positive, negative, or 0. Returns the square root of a positive numeric value. Truncates numbers to a specific digit.

344

Scientific Functions
Function Description

COS

Returns the cosine of a numeric value (expressed in radians).

COSH

Returns the hyperbolic cosine of a numeric value (expressed in radians).

SIN

Returns the sin of a numeric value (expressed in radians).

SINH

Returns the hyperbolic sin of a numeric value (expressed in radians).

TAN

Returns the tangent of a numeric value (expressed in radians).

TANH

Returns the hyperbolic tangent of a numeric value (expressed in radians).

345

Special Functions
Function Description

ABORT

Stops the session and issues a specified error message.

DECODE

Searches a port for the specified value.

ERROR

Causes the PowerCenter Server to skip a record and issue the specified error message.

IIF

Returns one of two values you specify, based on the results of a condition.

LOOKUP

Searches for a value in a lookup source column. Informatica recommends using the Lookup transformation.

346

String Functions
Function Description

CHOOSE

Chooses a string from a list of strings based on a given position.

INDEXOF

Finds the index of a value among a list of values.

REVERSE

Reverses the input string.

347

Test Functions
Function
IS_DATE

Description
Returns whether a value is a valid date..

IS_NUMBER

Returns whether a string is a valid number.

IS_SPACES

Returns whether a value consists entirely of spaces.

ISNULL

Returns whether a value is NULL.

348

Variable Functions
Function
SETCOUNTVARIABLE

Description
Counts the rows evaluated by the function and increments the current value of a mapping based on the count. Sets the current value of a mapping variable to the higher of two values:thecurrent value of the variable or the value specified. Returns the new current value.

SETMAXVARIABLE

SETMINVARIABLE

Sets the current value of a mapping variable to the lower of two values: the current value of the variable or the value specified. Returns the new current value.

SETVARIABLE

Sets the current value of a mapping variable to a value you specify. Returns the specified value. Returns the current date and time of the node hosting the Integration Service with precision to the nanosecond.

SYSTIMESTAMP

349

Appendix C Transformation Naming Conventions

50

350

Transformation Naming
Each object in a PowerCenter repository is identified by a unique name. This allows PowerCenter to efficiently manage and track statistics all the way down to the object level.

When an object is created, PowerCenter automatically generates a unique name. These names, however, do not reflect project/repository specific context. As a best practice Informatica recommends the following convention for naming PowerCenter objects:

<Object Type Abbreviation>_<Descriptive Name>

Abbreviations are usually 1 3 letters, the minimum needed to easily identify the object type. For example:

agg_quarterly_total (an aggregator that computes a quarterly totals) m_load_dw (a mapping that loads the datawarehouse) exp_string_to_date (an expression that converts a string to a date)

351

Suggested Naming Conventions


Transformation Aggregator Application Source Qualifier Custom Expression External Procedure Filter Joiner Lookup MQ Source Qualifier Normalizer Rank Suggested Convention AGG_TransformationName ASQ_TransformationName CT_TransformationName EXP_TransformationName EXT_TransformationName FIL_TransformationName JNR_TransformationName LKP_TransformationName SQ_MQ_TransformationName NRM_TransformationName RNK_TransformationName
352

Suggested Naming Conventions


Transformation Router Sequence Generator Sorter Stored Procedure Source Qualifier Transaction Control Union Update Strategy XML Generator XML Parser XML Source Qualifier Suggested Convention RTR_TransformationName SEQ_TransformationName SRT_TransformationName SP_TransformationName SQ_TransformationName TC_TransformationName UN_TransformationName UPD_TransformationName XG_TransformationName XP_TransformationName XSQ_TransformationName
353

Das könnte Ihnen auch gefallen