Professional Documents
Culture Documents
Informatica Powercenter 8 Level Ii Developer Lab Guide: Version - Pc8Liid 20060910
Informatica Powercenter 8 Level Ii Developer Lab Guide: Version - Pc8Liid 20060910
Level II Developer
Lab Guide
Version - PC8LIID 20060910
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Other Informatica Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Obtaining Informatica Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Visiting Informatica Customer Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Visiting the Informatica Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Visiting the Informatica Developer Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Visiting the Informatica Knowledge Base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Obtaining Informatica Professional Certification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Providing Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Obtaining Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Table of Contents
Informatica PowerCenter 8 Level II Developer
iii
Table of Contents
Informatica PowerCenter 8 Level II Developer
Table of Contents
Informatica PowerCenter 8 Level II Developer
vi
Table of Contents
Informatica PowerCenter 8 Level II Developer
Preface
Welcome to PowerCenter, Informaticas software product that delivers an open, scalable data integration
solution addressing the complete life cycle for all data integration projects including data warehouses and
data marts, data migration, data synchronization, and information hubs. PowerCenter combines the latest
technology enhancements for reliably managing data repositories and delivering information resources in
a timely, usable, and efficient manner.
The PowerCenter metadata repository coordinates and drives a variety of core functions, including
extracting, transforming, loading, and managing data. The Integration Service can extract large volumes
of data from multiple platforms, handle complex transformations on the data, and support high-speed
loads. PowerCenter can simplify and accelerate the process of moving data warehouses from development
to test to production.
Preface
Informatica PowerCenter 8 Level II Developer
vii
Document Conventions
This guide uses the following formatting conventions:
If you see
It means
Example
>
viii
boldfaced text
UPPERCASE
T_ITEM_SUMMARY
italicized text
Note:
Tip:
Preface
Informatica PowerCenter 8 Level II Developer
Informatica Documentation
The site contains information on how to create, market, and support customer-oriented add-on solutions
based on interoperability interfaces for Informatica products.
ix
Providing Feedback
Email any comments on this guide to aconlan@informatica.com.
WebSupport requires a user name and password. You can request a user name and password at http://
my.informatica.com .
Asia / Australia
Informatica Corporation
Headquarters
100 Cardinal Way
Redwood City, California
94063
United States
Informatica Business
Solutions Pvt. Ltd.
301 & 302 Prestige Poseidon
139 Residency Road
Bangalore 560 025
India
Toll Free
877 463 2435
Toll Free
00 800 4632 4357
Toll Free
Australia: 00 11 800 4632 4357
Singapore: 001 800 4632 4357
Standard Rate
United States: 650 385 5800
Standard Rate
Belgium: +32 15 281 702
France: +33 1 41 38 92 26
Germany: +49 1805 702 702
Netherlands: +31 306 022 797
United Kingdom: +44 1628 511
445
Standard Rate
India: +91 80 5112 5738
Preface
Informatica PowerCenter 8 Level II Developer
Objectives
Use a dynamic lookup cache to update and insert rows in a customer table
Duration
45 minutes
Mapping Overview
Lab 1
Informatica PowerCenter 8 Level II Developer
m_DYN_update_customer_list_xx
Source System
Flat file
Target System
EDWxx
Initial Rows
Rows/Load
Short Description
Update the existing customer list with new and updated information.
Load Frequency
On demand
Preprocessing
None
Post Processing
None
Error Strategy
None
Reload Strategy
None
CUST_ID
Sources
Files
File Name
File Location
updated_customer_list.txt
Targets
Tables
Schema/Owner
EDWxx
Table Name
Update
Delete
CUSTOMER_LIST
Insert
Unique Keys
yes
PK_KEY
CUST_ID
Target Column
Source Column
PK_KEY
LKP_CUSTOMER_LIST
Sequence-ID
CUST_ID
updated_customer_list.txt
CUST_ID
FIRSTNAME
updated_customer_list.txt
FIRSTNAME
Yes
LASTNAME
updated_customer_list.txt
LASTNAME
Yes
ADDRESS
updated_customer_list.txt
ADDRESS
Yes
CITY
updated_customer_list.txt
CITY
Yes
Lab 1
Informatica PowerCenter 8 Level II Developer
Target Column
Source Column
STATE
updated_customer_list.txt
STATE
Yes
ZIP
updated_customer_list.txt
ZIP
Yes
Detailed Overview
Repository Object Name
Object Type
m_DYN_update_customer_list_xx
Mapping
m_DYN_update_customer_list_xx
Shortcut_to_updated_customer_list
Source Definition
SQ_Shortcut_to_updated_customer_list
Source Qualifier
LKP_CUSTOMER_LIST
Lookup
RTR_Insert_Update
Router
UPD_Insert_New
Update Strategy
UPD_Update_Existing
Update Strategy
CUSTOMER_LIST_Insert
Target Definition
CUSTOMER_LIST_Update
Target Definition
Lab 1
Informatica PowerCenter 8 Level II Developer
Instructions
Step 1: Create Mapping
1.
Connect to the PC8A_DEV repository using Developerxx as the user name and developerxx as the
password.
2.
In the m_DYN_update_customer_list_xx mapping, preview the target data to view the rows that
exist in the table.
Lab 1
Informatica PowerCenter 8 Level II Developer
2.
Use the ODBC_EDW ODBC connection to connect to the target database. Use EDWxx as the user
name and password.
Figure 1-2. Preview Target Data for CUSTOMER_LIST Table Before Session Run
CUST_ID
FIRSTNAME
LASTNAME
ADDRESS
CITY
STATE
ZIP
111001
55001
Melvin
Bradley
New York
NY
30349
111002
55002
Anish
Desai
New York
NY
30305
111003
55003
Anderson
1538 Chantilly Dr Ne
New York
NY
30324
111004
55004
Chris
Ernest
NY
30342
111005
55005
Rudolph
Gibiser
6917 Roswell Rd Ne
New York
NY
30328
111006
55006
Bianco
Lo
146 W 16th St
New York
NY
10011
111007
55007
Justina
Bradley
NY
30309
111008
55008
Monique
Freeman
260 King St
San Francisco
CA
94107
111009
55009
Jeffrey
Morton
San Francisco
CA
94118
Lab 1
Informatica PowerCenter 8 Level II Developer
2.
3.
Notice that the row for customer ID 55003 contains some NULL values. You do not want to insert
the NULL values into the target, you only want to update the other column values in the target.
4.
Notice that the file contains two rows with customer ID 67003. Because of this, you must use a
dynamic cache for the Lookup transformation.
5.
2.
3.
4.
5.
Verify that the Target load type is set to Normal and the Truncate target table option is not checked.
6.
Verify the specified source file name is updated_customer_list.txt and the specified location is
$PMSourceFileDir.
Lab 1
Informatica PowerCenter 8 Level II Developer
Preview the target data from the mapping to verify the results.
Figure 1-3 shows the Preview Data dialog box for the CUSTOMER_LIST table:
Figure 1-3. Preview Target Data for CUSTOMER_LIST Table After Session Run
Lab 1
Informatica PowerCenter 8 Level II Developer
CUST_ID
FIRSTNAME
LASTNAME
ADDRESS
CITY
STATE
ZIP
111001
55001
Melvin
Bradley
New York
NY
30349
111002
55002
Anish
Desai
Hackensack
NJ
07601
111003
55003
Janice
New York
NY
30324
111004
55004
Chris
Ernest
NY
30342
111005
55005
Rudolph
Gibiser
6917 Roswell Rd Ne
New York
NY
30328
111006
55006
Bianco
Lo
900 Seville Dr
Clarkston
GA
30021
111007
55007
Justina
Bradley
NY
30309
111008
55008
Monique
Freeman
260 King St
San Francisco
CA
94107
111009
55009
Jeffrey
Morton
San Francisco
CA
94118
111010
67001
Thao
Nguyen
Burlingame
CA
94010
111011
67002
Maria
Gomez
Cupertino
CA
95014
111012
67003
Jean
Carlson
120 Villa St
Mountain View
CA
94043
111013
67004
Chris
Park
Santa Clara
CA
95051
2.
3.
Look at customer ID 67003. It should contain data from the last row for customer ID 67003 in the
source file.
Lab 1
Informatica PowerCenter 8 Level II Developer
Technical Description
A Worklet will be created with a Worklet variable to define the time the Workflow started plus one hour.
A Timer Task will be created in the Worklet to wait for one hour before sending an email. If the session
runs for less than an hour a Control Task will be issued to stop the timer.
Objectives
Create a Workflow
Create a Worklet
Duration
30 minutes
Worklet Overview
Workflow Overview
Lab 2
Informatica PowerCenter 8 Level II Developer
Instructions
Step 1: Setup
Connect to the PC8A_DEV repository in the Designer and Workflow Manager.
m_DIM_CUSTOMER_ACCT_xx
m_DIM_CUSTOMER_ACCT_STATUS_xx
s_m_DIM_CUSTOMER_ACCT_xx
s_m_DIM_CUSTOMER_ACCT_STATUS_xx
2.
10
1.
2.
3.
Lab 2
Informatica PowerCenter 8 Level II Developer
4.
Select the Start after 1 Hour from the start time of this task.
2.
3.
4.
For the Email Subject type - session s_m_DIM_CUSTOMER_ACCT_xx ran an hour or longer.
5.
Lab 2
Informatica PowerCenter 8 Level II Developer
11
2.
3.
2.
Verify source connections are ODS and source file name is customer_type.txt.
3.
4.
Verify lookup connections are valid - DIM tables to EDWxx, ODS tables to ODS.
5.
6.
2.
3.
12
1.
2.
Verify source connections are ODS and source file name is customer_type.txt.
3.
4.
Verify lookup connections are valid - DIM tables to EDWxx, ODS tables to ODS.
5.
6.
2.
In the Workflow Monitor, click the Filter Tasks button in the toolbar, or select Filters > Tasks from
the menu.
2.
3.
When you run your workflow, the Task View should look as follows.
Lab 2
Informatica PowerCenter 8 Level II Developer
13
14
Lab 2
Informatica PowerCenter 8 Level II Developer
Technical Description
Use workflow variables to calculate when the session starts. The starting time of the session has to be at
the top of the hour on or after 6 a.m. and not on or after 6 p.m. To accomplish this, the workflow will run
continuously.
Objectives
Duration
30 minutes
Workflow Overview
Lab 3
Informatica PowerCenter 8 Level II Developer
15
Instructions
Step 1: Setup
Connect to PC8A_DEV Repository in the Designer and Workflow Manager.
m_SALES_DEPARTMENT_xx
s_m_SALES_DEPARTMENT_xx
2.
Click OK.
3.
Save.
16
1.
2.
3.
4.
5.
2.
3.
4.
Select the Use this workflow date-time variable to calculate the wait radio button.
5.
6.
7.
8.
Save.
2.
Note: The above functions could be nested together in one assignment expression if desired.
Lab 3
Informatica PowerCenter 8 Level II Developer
17
2.
3.
4.
18
1.
2.
3.
4.
5.
6.
7.
Click OK.
8.
Click OK.
9.
Lab 3
Informatica PowerCenter 8 Level II Developer
Note: Notice that assignment task as already executed and the timer task is running.
2.
3.
Verify the results of the Assignment expressions in the log file. Listed below are examples:
Variable [$$TRUNC_START_TIME], Value [05/23/2004 16:00:00].
Variable [$$HOUR_STARTED], Value [16].
Variable [$$NEXT_START_TIME], Value [05/23/2004 17:00:00].
4.
Verify the Load Manager message that tells when the timer task will complete. Listed below is an
example message:
INFO : LM_36606 [Sun May 23 16:05:02 2004] : (2288|2004) Timer task instance
[TM_SALES_DEPARTMENT_START]: The timer will complete at [Sun May 23 17:00:00 2004].
5.
6.
At or near the top of the hour, open the monitor to check the status of the session. Verify that it
starts(started) at the desired time. Below is an example:
7.
After the session completes, notice that the workflow automatically starts again.
8.
If the workflow starts after 5 p.m., the timer message in the workflow log will show that the timer will
end at 6 a.m. the following morning. Listed below is an example:
Lab 3
Informatica PowerCenter 8 Level II Developer
19
20
9.
Stop or abort the workflow at any time. Afterwards, edit the workflow scheduler and select RUN ON
DEMAND.
10.
Lab 3
Informatica PowerCenter 8 Level II Developer
Objectives
Duration
30 minutes
Lab 4
Informatica PowerCenter 8 Level II Developer
21
Instructions
Step 1: Copy the Workflow
1.
2.
3.
4.
5.
Rename the session in the workflow to replace xx with your student number.
6.
2.
Edit the workflow, and on the General tab, select Suspend on Error.
3.
4.
Scroll to the end of the General Options settings and select Resume from last checkpoint for the
Recovery Strategy.
5.
Click the Mapping tab and change the target load type to Normal.
Note: When you configure a session for bulk load, the session is not recoverable using the resume
recovery strategy. You must use normal load.
6.
22
7.
2.
3.
4.
In the Error Handling settings, configure the session to stop on one error.
5.
Step 4: Run the Workflow, Fix the Session, and Recover the Workflow
1.
Lab 4
Informatica PowerCenter 8 Level II Developer
23
3.
5.
6.
7.
In the Workflow Manager, right-click the workflow, and choose Recover Workflow.
The Workflow Monitor shows that the Integration Service is running the workflow and that the
session is running as a recovery run.
24
Lab 4
Informatica PowerCenter 8 Level II Developer
When the session and workflow complete, the Workflow Monitor shows that the session completed
successfully as a recovery run.
9.
Notice that the Integration Service continues to write log events to the same session log.
Lab 4
Informatica PowerCenter 8 Level II Developer
25
10.
26
Lab 4
Informatica PowerCenter 8 Level II Developer
Technical Description
A flag will be created to tell PowerCenter when a new set of Invoice numbers are found. A Transaction
Control Transformation will be created to tell the database when to issue a commit.
Objectives
Duration
45 minutes
Mapping Overview
Lab 5
Informatica PowerCenter 8 Level II Developer
27
m_DIM_LINE_ITEM_xx
Source System
ODS
Target System
Initial Rows
EDWxx
Rows/Load
Short Description
Load Frequency
On demand
Preprocessing
None
Post Processing
None
Error Strategy
None
Reload Strategy
None
LINE_ITEM_NO
Sources
Tables
Table Name
Schema/Owner
ODS_LINE_ITEM
ODS
Selection/Filter
Targets
Tables
Schema/Owner
EDWxx
Table Name
Update
Delete
DIM_LINE_ITEM
Insert
Unique Key
yes
LINE_ITEM_NO
Target Column
Source Table
Source Column
Expression
DIM_LINE_ITEM
LINE_ITEM_NO
ODS_LINE_ITEM
LINE_ITEM_NO
DIM_LINE_ITEM
INVOICE_NO
ODS_LINE_ITEM
INVOICE_NO
DIM_LINE_ITEM
PRODUCT_CODE
ODS_LINE_ITEM
PRODUCT_CODE
DIM_LINE_ITEM
QUANTITY
ODS_LINE_ITEM
QUANTITY
DIM_LINE_ITEM
PRICE
ODS_LINE_ITEM
PRICE
DIM_LINE_ITEM
COST
ODS_LINE_ITEM
COST
28
Lab 5
Informatica PowerCenter 8 Level II Developer
Detailed Overview
Transformation Name
Type
Description
Mapping
Mapping
m_DIM_LINE_ITEM_xx
ODS_LINE_ITEM
Source Definition
Shortcut_to_sq_ODS_LINE_ITEM
Source Qualifier
Send to srt_DIM_LINE_ITEM:
LINE_ITEM_NO, INVOICE_NO, PRODUCT_CODE, QUANTITY,
DISCOUNT, PRICE, COST
srt_DIM_LINE_ITEM
Sorter
Sort by INVOICE_NO
Send to exp_DIM_LINE_ITEM
INVOICE_NO
SEND to tc_DIM_LINE_ITEM:
LINE_ITEM_NO, INVOICE_NO, PRODUCT_CODE, QUANTITY,
DISCOUNT, PRICE, COST
exp_DIM_LINE_ITEM
Expression
tc_DIM_LINE_ITEM
Transaction Control
Shortcut_to_DIM_LINE_ITEM
Target Definition
Lab 5
Informatica PowerCenter 8 Level II Developer
29
Instructions
Step 1: Create Mapping
Create a mapping called m_DIM_LINE_ITEM_xx, where xx is your student number. Use the mapping
details described in the previous pages for guidelines.
2.
3.
4.
In the session, edit Mapping tab and expand the Sources node. Under Connections verify that the
Connection Value is ODS.
5.
Expand the Targets node and verify that the Connection value is correct, the Target load type is set to
Normal and the Truncate target table option is checked.
30
Lab 5
Informatica PowerCenter 8 Level II Developer
Lab 5
Informatica PowerCenter 8 Level II Developer
31
32
Lab 5
Informatica PowerCenter 8 Level II Developer
Technical Description
Records will be committed when a new group of VENDOR_IDs comes in. This will require a flag to be
set to determine whether a VENDOR_ID is new or not. Rows will need to be rolled back if an error
occurs. An error flag will be set when a business rule is violated.
Objectives
Use a Transaction Control Transformation to Commit based upon Vendor IDs and issue a rollback
based upon errors.
Duration
60 minutes
Mapping Overview
Lab 6
Informatica PowerCenter 8 Level II Developer
33
m_DIM_VENDOR_PRODUCT_TC_xx
Source System
Flat File
Initial Rows
Target System
EDWxx
Rows/Load
Short Description
Issue a commit based upon VENDOR_ID, but only if the PRODUCT_CODE is not null and the
CATEGORY is valid for all records in the group. A rollback of the entire group should occur if Informatica
comes across a null PRODUCT code or an invalid CATEGORY.
Load Frequency
On demand
Preprocessing
None
Post Processing
None
Error Strategy
None
Reload Strategy
None
None
Sources
Files
File Name
File Location
PRODUCT.txt
Targets
Tables
Schema/Owner
EDWxx
Table Name
Update
Delete
DIM_VENDOR_PRODUCT
Insert
Unique Key
yes
34
Lookup Name
lkp_ODS_VENDOR
ODS_VENDOR
Description
Match Condition(s)
ODS.VENDOR_ID = PRODUCT.VENDOR_ID
N/A
Return Value(s)
Location
ODS
Lab 6
Informatica PowerCenter 8 Level II Developer
Target Column
Source Table
Source Column
Expression
DIM_VENDOR_PRODUCT
PRODUCT_CODE
PRODUCT
PRODUCT_CODE
DIM_VENDOR_PRODUCT
VENDOR_ID
PRODUCT
VENDOR_ID
DIM_VENDOR_PRODUCT
VENDOR_NAME
PRODUCT
DIM_VENDOR_PRODUCT
VENDOR_STATE
PRODUCT
DIM_VENDOR_PRODUCT
PRODUCT_NAME
PRODUCT
PRODUCT_NAME
DIM_VENDOR_PRODUCT
CATEGORY
PRODUCT
CATEGORY
DIM_VENDOR_PRODUCT
MODEL
PRODUCT
MODEL
DIM_VENDOR_PRODUCT
PRICE
PRODUCT
PRICE
DIM_VENDOR_PRODUCT
FIRST_CONTACT
PRODUCT
Detailed Overview
Transformation Name
Type
Description
Mapping
Mapping
m_DIM_VENDOR_PRODUCT_TC_xx
PRODUCT.txt
Source Definition
Sq_Shortcut_To_ PRODUCT
Source Qualifier
exp_SET_ERROR_FLAG
Expression
srt_VENDOR_ID
Lab 6
Informatica PowerCenter 8 Level II Developer
Sorter
35
Transformation Name
Type
Description
exp_SET_TRANS_TYPE
Expression
lkp_ODS_VENDOR
Lookup
tc_DIM_VENDOR_PRODUCT
Transaction
Control
Expression:
DECODE(TRANSACTION_TYPE,
'COMMIT', TC_COMMIT_BEFORE,
'ROLLBACK', TC_ROLLBACK_AFTER,
'CONTINUE', TC_CONTINUE_TRANSACTION)
// If we're starting a new group, we need to COMMIT the
// prior group.
// If we hit an error, we need to ROLLBACK the current
// group including the current record.
PORTS to SEND to DIM_VENDOR_PRODUCT:
All ports except for TRANSACTION_TYPE
Shorcut_To_DIM_VENDOR_PROD
UCT
Target Table
36
Lab 6
Informatica PowerCenter 8 Level II Developer
Instructions
Step 1: Create Mapping
Create a mapping called m_DIM_VENDOR_PRODUCT_TC_xx, where xx is your student number.
Use the mapping details described in the previous pages for guidelines.
2.
3.
4.
Source file is found in the Source Files directory on the Integration Service machine
5.
6.
7.
8.
9.
Lab 6
Informatica PowerCenter 8 Level II Developer
37
38
Lab 6
Informatica PowerCenter 8 Level II Developer
Technical Description
Instead of using a Transaction Control Transformation, route the Fatal Errors off to a Fatal Error table
and route the Nonfatal Errors off to a Nonfatal table. All good data will be sent to the EDW.
Objectives
Trap all database errors and load them to a table called ERR_FATAL.
Trap the dirty data coming through from the CATEGORY field and write it to a table called
ERR_NONFATAL.
Duration
60 minutes
Lab 7
Informatica PowerCenter 8 Level II Developer
39
Mapping Overview
40
Lab 7
Informatica PowerCenter 8 Level II Developer
m_DIM_VENDOR_PRODUCT_xx
Source System
Flat File
Initial Rows
Target System
EDWxx
Rows/Load
Short Description
If a fatal error is found, route data to a fatal error table, If a nonfatal error is found route data to a
nonfatal table, If data is free of errors route it to DIM_VENDOR_PRODUCT.
Load Frequency
On demand
Preprocessing
None
Post Processing
None
Error Strategy
Create a flag for both fatal errors and nonfatal errors. Route bad data to its respective table.
Reload Strategy
None
None
Sources
Files
File Name
File Location
PRODUCT.txt
Targets
Tables
Schema/Owner
EDWxx
Table Name
Update
Delete
DIM_VENDOR_PRODUCT
Insert
Unique Key
yes
Schema/Owner
EDWxx
Table Name
Update
Delete
ERR_NONFATAL
Insert
Unique Key
yes
ERR_ID
Lab 7
Informatica PowerCenter 8 Level II Developer
41
Tables
Schema/Owner
EDWxx
Table Name
Update
Delete
ERR_FATAL
Insert
Unique Key
yes
ERR_ID
42
Lab 7
Informatica PowerCenter 8 Level II Developer
lkp_ODS_VENDOR
ODS_VENDOR
Description
Match Condition(s)
ODS.VENDOR_ID = PRODUCT.VENDOR_ID
N/A
Return Value(s)
Location
ODS
Target Column
Source Table
Source Column
Expression
ERR_NONFATAL
ERR_ID
PRODUCT
Derived Value
ERR_NONFATAL
REC_NBR
PRODUCT
REC_NUM
N/A
ERR_NONFATAL
ERR_RECORD
PRODUCT
Derived Value
ERR_NONFATAL
ERR_DESCRIPTION
PRODUCT
Derived Value
ERR_NONFATAL
LOAD_DATE
PRODUCT
Derived Value
ERR_FATAL
ERR_ID
PRODUCT
Derived Value
ERR_FATAL
REC_NBR
PRODUCT
REC_NUM
N/A
ERR_FATAL
ERR_RECORD
PRODUCT
Derived Value
ERR_FATAL
ERR_DESCRIPTION
PRODUCT
Derived Value
ERR_FATAL
LOAD_DATE
PRODUCT
Derived Value
DIM_VENDOR_PR
ODUCT
PRODUCT_CODE
PRODUCT
PRODUCT_CODE
DIM_VENDOR_PR
ODUCT
VENDOR_ID
PRODUCT
VENDOR_ID
Lab 7
Informatica PowerCenter 8 Level II Developer
43
Target Table
Target Column
Source Table
Source Column
Expression
DIM_VENDOR_PR
ODUCT
VENDOR_NAME
PRODUCT
DIM_VENDOR_PR
ODUCT
VENDOR_STATE
PRODUCT
DIM_VENDOR_PR
ODUCT
PRODUCT_NAME
PRODUCT
PRODUCT_NAME
DIM_VENDOR_PR
ODUCT
CATEGORY
PRODUCT
CATEGORY
DIM_VENDOR_PR
ODUCT
MODEL
PRODUCT
MODEL
DIM_VENDOR_PR
ODUCT
PRICE
PRODUCT
PRICE
DIM_VENDOR_PR
ODUCT
FIRST_CONTACT
PRODUCT
Detailed Overview
Transformation Name
Type
Description
Mapping
Mapping
m_DIM_VENDOR_PRODUCT_xx
PRODUCT.txt
Shortcut_To_sq_PRODUCT
Source Qualifier
exp_ERROR_TRAPPING
Expression
44
Lab 7
Informatica PowerCenter 8 Level II Developer
Transformation Name
Type
Description
lkp_ODS_VENDOR
Lookup
rtr_PRODUCT_DATA
Router
exp_ERR_FATAL
Expression
exp_ERR_NONFATAL
Expression
seq_ERR_FATAL
Sequence
Generator
seq_ERR_NONFATAL
Sequence
Generator
ERR_FATAL
Target
ERR_NONFATAL
Target
DIM_VENDOR_PRODUCT
Target
Lab 7
Informatica PowerCenter 8 Level II Developer
45
Instructions
Step 1: Create Mapping
Create a mapping called m_DIM_VENDOR_PRODUCT_xx, where xx is your student number. Use the
mapping details described in the previous pages for guidelines.
2.
3.
4.
Verify source file name is PRODUCT all Uppercase with an extension of .txt.
5.
6.
7.
Truncate DIM_VENDOR_PRODUCT.
8.
46
Lab 7
Informatica PowerCenter 8 Level II Developer
ERR_FATAL
DIM_VENDOR_PRODUCT
Lab 7
Informatica PowerCenter 8 Level II Developer
47
48
Lab 7
Informatica PowerCenter 8 Level II Developer
Objectives
Duration
15 minutes
Lab 8
Informatica PowerCenter 8 Level II Developer
49
Instructions
Step 1: Create a Query to Search for Targets with Customer
First, you will create a query that searches for target objects with the string customer in the target name.
1.
2.
3.
4.
5.
6.
7.
50
Lab 8
Informatica PowerCenter 8 Level II Developer
8.
Edit the new parameter to search for object names that contain the text customer.
The PowerCenter Client displays a dialog box stating if the query is valid or not. If the query is not
valid, fix the error and validate it again.
2.
Click Save.
The PowerCenter Client saves the query to the repository.
3.
Click Run.
The Query Results window shows the results of the query you created. Your query results might
include more objects than in the following results:
Some columns only apply to objects in a versioned repository, such as Version Comments, Label
Name, and Purged By User.
Lab 8
Informatica PowerCenter 8 Level II Developer
51
2.
3.
4.
Add another parameter, and choose Include Children and Parents for the parameter name.
Note: When you search for children and parents, you enter the following information in the value
columns:
Value 1. Object type(s) for dependent object(s), the children and parents.
Value 2. Object type(s) for the object(s) you are querying.
Value 3. Reusable status of the dependent object(s).
Click the arrow in the Value 1 column, select the following objects, and click OK:
6.
Mapplet
Source Definition
Target Definition
Transformation
7.
52
1.
2.
Lab 8
Informatica PowerCenter 8 Level II Developer
The query returned objects in all folders in the repository. Next, you will modify the query so it only
returns objects in your folder.
In the Query Editor, place the cursor somewhere in the last parameter and then add a new parameter.
2.
Modify the parameter so it searches for folders equal to the SOLUTIONS_ADVANCED folder.
3.
4.
Lab 8
Informatica PowerCenter 8 Level II Developer
53
Notice that the even though the query says to include parent and child objects, it does not display any
parent objects to the mapping. Parent objects of a mapping include sessions, worklets, and workflows.
When you run a query accessed by the Designer, the query results only display Designer objects.
Similarly, when you run a query accessed by the Workflow Manager, the query results only display
Workflow Manager objects.
In the next step, you will run the same query accessed by the Repository Manager.
54
1.
2.
Open the Query Browser. For details on how to do this, see Create a Query to Search for Targets
with Customer on page 50.
3.
Lab 8
Informatica PowerCenter 8 Level II Developer
Notice that the query results show all parent (and child) objects, including Workflow Manager
objects, such as workflows.
Lab 8
Informatica PowerCenter 8 Level II Developer
55
56
Lab 8
Informatica PowerCenter 8 Level II Developer
Technical Description
The session that needs to be optimized is wf_FACT_MKT_SEGMENT_ORDERS_xx.
This session runs a mapping that reads in a flat file of order data, finds the customer market segment
information, aggregates the orders and writes the values out to a relational table.
The support group needs to find the bottleneck(s), determine the cause of the bottleneck(s) and then
reduce the bottleneck(s). The reduction in run time must be at least 30%.
Objectives
Use learned techniques to determine and reduce the bottleneck(s) that exist.
Duration
120 minutes
Object Locations
ProjectX folder
Lab 9
Informatica PowerCenter 8 Level II Developer
57
Workshop Details
Overview
This workshop is designed to assist the developers with the task at hand. It does not give detailed
instructions on how to identify a bottleneck, determine the cause of a bottleneck or how to optimize the
session/mapping. The approach to take is left entirely up to the discretion of the developers. The
optimization techniques to use are also left up to the developers. The workshop will provide instructions
on establishing a typical read baseline and on running the original session.
The suggested steps to follow are:
1.
2.
3.
Target
Source
Mapping
Session
Important: For detailed information on identifying bottlenecks and reducing bottlenecks, see the
Performance Tuning Guide in the PowerCenter online help. To access the online help, press the F1 key in
any of the PowerCenter Client tools. In the online help, click the Contents tab and expand the section for
the Performance Tuning Guide.
Workshop Rules
The rules of the workshop are:
58
1.
In the Repository Manager, copy the wf_Source_Baseline_xx workflow from the ProjectX folder to
your folder.
2.
3.
Edit the session named s_m_Source_Baseline_xx, and click the Mapping tab:
a.
Edit the Sources node and ensure the database connection is ODS.
b.
Edit the Targets node and change the Writer from Relational Writer to File Writer.
c.
Change the Targets Properties for the Output and Reject filenames to include your assigned
student number.
4.
5.
Document the results in the table provided in Documented Results on page 65.
2.
3.
4.
a.
b.
b.
c.
5.
6.
Document the results in the table provided in Documented Results on page 65.
Lab 9
Informatica PowerCenter 8 Level II Developer
59
m_FACT_MKT_SEGMENT_ORDERS_xx
Source System
Target System
EDWxx
Initial Rows
4,015,335
Rows/Load
437,023
Short Description
Calculates totals for quantity, revenue and cost for market segments. Values are summarized by customer,
date, market segment, region and item.
Load Frequency
On demand
Preprocessing
None
Post Processing
None
Error Strategy
None
Unique Source
Fields
SOURCES
Tables
Table Name
Schema/Owner
Selection/Filter
daily_order_line_item
Flat File
ODS_INVOICE_SUMMARY
ODS
TARGETS
Tables
Schema Owner
EDWxx
Table Name
Update
Delete
FACT_MKT_SEGMENT_ORDERS
60
Insert
Unique Key
Yes
Lab 9
Informatica PowerCenter 8 Level II Developer
LOOKUPS
Lookup Name
lkp_ITEM_ID
Table
DIM_ITEM
Description
The FACT_MKT_SEGMENT_ORDERS fact table needs to have the ITEM_KEY stored on it as a Foreign
Key. The item id contained in the source will be matched with the item id in the DIM_ITEM table to retrieve
the ITEM_KEY.
The cost of each item needs to be obtained from this table and used in the calculation of item costs for
each row written to the target.
This table contains 27 rows.
Location
EDWxx
Match
Condition(s)
DIM_ITEM.ITEM_ID = ORDER_LINE_ITEM.ITEM_ID
Filter/SQL
Override
N/A
Return Value(s)
ITEM_KEY, COST
Lookup Name
lkp_CUSTOMER_INFO
Table
DIM_CUSTOMER_PT
Description
The FACT_MKT_SEGMENT_ORDERS fact table needs to have the customer key stored on it as a Foreign
Key. The CUSTOMER_ID contained in the source will be matched with the CUSTOMER_ID in the
DIM_CUSTOMER_PT table to retrieve the customer key (C_CUSTKEY).
The market segment of each customer is also retrieved and used in aggregate groupings.
This table contains 1,000,000 rows.
Location
EDWxx
Match
Condition(s)
DIM_CUSTOMER_PT.C_CUST_ID = ORDER_LINE_ITEM.CUSTOMER_ID
Filter/SQL
Override
N/A
Return Value(s)
Source Table
Source Column
Expression
ORDER_DATE
ORDER_LINE_ITEM
ORDER_DATE
N/A
ORDER_QUANTITY
ORDER_LINE_ITEM
QUANTITY
ORDER_REVENUE
ORDER_LINE_ITEM
REVENUE
PYMT_TYPE
ODS_INVOICE_SUMMARY
PYMT_TYPE
N/A
ORDER_KEY
Derived Value
CUSTOMER_KEY
Derived Value
Lab 9
Informatica PowerCenter 8 Level II Developer
61
Target Column
Source Column
Expression
MKTSEGMENT
Derived Value
REGION
Derived Value
ITEM_KEY
Derived Value
ORDER_COST
Derived Value
62
Source Table
Lab 9
Informatica PowerCenter 8 Level II Developer
DETAILED OVERVIEW
Transformation Name
Type
Description
Mapping
Mapping
m_FACT_MKT_SEGMENT_ORDERS_xx
Shortcut_to_ORDER_LINE_ITEM
Source Definition
Flat file containing daily order information for each customer. Contains
orders for August 29, 2003. This table contains 1,328,667 rows
Sq_Shortcut_to_ORDER_LINE_IT
EM
Source Qualifier
Shortcut_to_ODS_INVOICE_SUM
MARY
Source Qualifier
Sq_Shortcut_To_ODS_INVOICE_S
UMMARY
Source Qualifier
Jnr_PAYMENT_TYPE
Joiner
lkp_ITEM_ID
Lookup
Lab 9
Informatica PowerCenter 8 Level II Developer
63
Transformation Name
Type
Description
Lkp_CUSTOMER_INFO
Lookup
exp_SET_UNKNOWN_KEYS
Expression
agg_VALUES
Aggregator
64
Lab 9
Informatica PowerCenter 8 Level II Developer
Transformation Name
Type
Description
Seq_ORDER_KEY
Sequence
Generator
Shortcut_to_FACT_MKT_SEGMEN
T_ORDERS
Target Definition
Documented Results
Session Name
Rows
Processed
Rows Failed
Start Time
End Time
Elapsed Time
(Secs)
Rows Per
Second
Lab 9
Informatica PowerCenter 8 Level II Developer
65
66
Lab 9
Informatica PowerCenter 8 Level II Developer
Technical Description
The sessions/mappings that are in need of analysis are:
s_m_Target_Bottleneck_xx. This session reads in a relational source that contains customer account
balances for the year.
s_m_Items_Bottleneck_xx. This mapping reads a large flat file of item sold data, filters out last years
stock, applies some row level manipulation, performs a lookup to get cost information and then loads
the data into an Oracle table.
Note: The s_m_Items_Bottleneck_xx mapping is a hypothetical example. It does not exist in the
repository.
s_m_Source_Bottleneck_xx. This mapping reads in one relational source that contains customer
account balances and another relational source that contains customer demographic information. The
two tables are joined at the database side.
s_m_Mapping_Bottleneck_xx. This mapping reads in a flat file of order data, finds the customer
market segment information, filters out rows that haven't sold more than one item, aggregates the
orders and writes the values out to a relational table.
The support group needs to review each one of these sessions to if it makes sense to partition the session.
Objectives
Review the sessions and based on knowledge gained from the presentations determine what
partitioning, if any, should be done.
Duration
60 minutes
Object Locations
ProjectX folder
Lab 10
Informatica PowerCenter 8 Level II Developer
67
Workshop Scenarios
Scenario 1
The session in question is s_m_Target_Bottleneck_xx has been optimized already but it is felt that more
can be done. The machine that the session is running on has 32 Gig of Memory and 16 CPUs. The
mapping takes account data from a relational source, calculates various balances and then writes the data
out to the BalanceSummary table. The BalanceSummary table is an Oracle table that the DBA has
partitioned by the account_num column.
Answer the following questions:
Question
I.
II.
III.
IV.
V.
Answers
68
Lab 10
Informatica PowerCenter 8 Level II Developer
2.
Click the Mapping > Partitions tab to see the partition points.
3.
Select each Transformation and look at the window at the bottom of the screen to see what partition
type is being used for that particular partition point.
Partition Test
The purpose of this section is to implement partitioning on the s_m_Target_Bottleneck_xx session.
1.
2.
3.
Click the Mapping tab, and then click the Partitions tab
4.
On the Partitions tab, select the Shortcut_to_BalanceSummary transformation, click the Edit
Partition Point icon and add two new partitions
5.
Select Key Range from the drop down box and click OK
6.
7.
Click on Edit Keys - this allows the definition of the columns that are going to be in the key range
8.
9.
10.
Select the SQ_Shortcut_to_Source2 partition Point and edit the partition point
11.
Lab 10
Informatica PowerCenter 8 Level II Developer
69
12.
13.
14.
15.
Compare the results against the original session results and against the indexed session results. Is there
a performance gain?
Conclusion
The instructor will discuss the answers to the questions in the lab wrap-up.
Scenario 2
Note: The mapping shown in this scenario is a hypothetical example. It does not exist in the repository.
The session in question is s_m_Items_Bottleneck_xx has been running slowly and the Project manager
wants it optimized. The machine that this is running on has 8 Gig of Memory and 4 CPUs. The mapping
takes items sold data from a large flat file, transforms it and writes out to an Oracle table. The flat file
comes from one location and splitting it up is not an option. The second Expression transformation is
very complex and takes a long time to push the rows through.
Mapping Overview
70
I.
II.
III.
IV.
V.
Answers
Lab 10
Informatica PowerCenter 8 Level II Developer
Conclusion
The instructor will discuss the answers to the questions in the lab wrap-up.
Scenario 3
The session in question is s_m_Source_Bottleneck_xx has been running slowly and the Project manager
wants it optimized. The machine that this is running on has 2 Gig of Memory and 2 CPUs. The mapping
reads one relational source that contains customer account balances and another relational source that
contains customer demographic information. The tables are joined at the database side, the rows are then
pushed through an expression transformation and loaded into an Oracle table.
Mapping Overview
II.
III.
IV.
V.
Answers
Conclusion
The instructor will discuss the answers to the questions in the lab wrap-up.
Scenario 4
The session in question is s_m_Mapping_Bottleneck_Sorter_xx is still not running quite as fast as is
needed. The machine that this is running on has 24 Gig of Memory and 16 CPUs. The mapping reads a
flat file source that is really 3 region specific flat files being read from a file list. The rows are then passed
through two lookups to obtain item costs and customer information. It is then sorted and aggregated
before being loaded into an Oracle table. The customer is part of the sort key and the DBA has
Lab 10
Informatica PowerCenter 8 Level II Developer
71
partitioned the Oracle table by customer_key. What can be done to further optimize this session/
mapping?
Mapping Overview
II.
III.
IV.
V.
Answers
Conclusion
The instructor will discuss the answers to the questions in the lab wrap-up.
72
Lab 10
Informatica PowerCenter 8 Level II Developer
Answers
Scenario 1
Question
Answers
I.
II.
III.
Yes
IV.
V.
This will add multiple connections to the source and target which will
result in data being read concurrently. This will be faster.
Scenario 2
Question
Answers
I.
II.
III.
Yes
IV.
V.
This will add one more pipeline stage which in turn will give you an
additional buffer to move data.
Scenario 3
Question
Answers
I.
II.
III.
IV.
N/A
V.
N/A
Lab 10
Informatica PowerCenter 8 Level II Developer
73
Scenario 4
74
Question
Answers
I.
II.
III.
Yes
IV.
3 Partitions
- Key-Range at Target
- Split the source into the 3 regions specific files and read each one
into one of the partitions
- Hash Auto Keys an the Sorter Transformation. This will also allow
you to remove the partition point at the aggregator if you like.
V.
Lab 10
Informatica PowerCenter 8 Level II Developer