INFORMATICA
INFORMATICA POWER CENTER 8.6.0
An informatica power sector is a single, unified data integration
platform which allows the companies to access the data from multiple
source systems, transforming the data into a homogenous format and
delivers the data throughout the enterprise at any speed.
A mapping is a graphical representation of data flow from source to
destination.
A mapping logically defines extraction, transformation and loading.
A mapping is an ETL plan that is created with following types of
metadata
I.
Source Definition (E)
II.
Target Definition (L)
III.
Transformation Rule (T)
INFORMATICA
An informatica power center is a client server technology which
allows you to design, run, monitor and administrate the data acquisition
applications known as Mappings.
INFORMATICA PRODUCTS: The following are the various products from informatica cooperation.
I.
Informatica Power center
II.
Informatica Power Mart
III.
Informatica Power Exchange
IV.
Informatica Power Analyzer
V.
Informatica Metadata Reporter
VI.
Informatica Cloud
VII.
Informatica Data Quality
VIII.
Business to Business (B2B)
Note: - An informatica Co-operation was founded in the year 1993 Red
Wood City, Loss Angels, California. But Public Ltd Company happened in
the year 1997.
POWER CENTER 8.6 COMPONENTS: -
I.
Informatica Power Center Clients
II.
Power Center Repository
III.
Power Center Domain
IV.
Repository Service
V.
Integration Service
VI.
INFORMATICA
When we install Informatica Power Center the following components
gets install
Power Center Administration Console
Power Center Clients: There are four power center client components gets install
I.
Power Center Designer
II.
Power Center Work Flow Manager
III.
Power Center Work Flow Monitor
IV.
Power Center Repository Manager
Designer: The designer is a GUI based client component which allows you to
design the plan of ETL processor called Mapping.
A mapping is made up of following metadata definitions
I.
Source
II.
Transformation Rule
III.
Target
Work-Flow Manager: -
It is a GUI based client component which allows you to perform
following tasks
I.
Create session for each mapping
II.
Create work-flow to execute one (or) more sessions
III.
Start work-flow
Session: -
Work-flow: A work flow is a top object in the power center development hiarchery to start one (or) more sessions in sequence (or) parallel (or) both.
INFORMATICA
A session is a centre object that runs mapping on integration
service.
Work-flow Monitor: Its a GUI based client component which monitors the work-flows
and sessions running on integration service.
The work-flow sessions status is displayed as succeed (or) failed.
It allows you to fetch session log from repository.
Steps involving in build data acquisition
i.
Create Source definition
ii.
Create Target definition
iii.
Design a mapping with (or) without Transformation Rule
iv.
Create session for each mapping
v.
Create work-flow
vi.
Start work-flow
Repository Manager: Its a GUI based administrative client component which allows you to
define following tasks
i.
Create edit and delete folders
ii.
Assign permission and privileges to the user and user group
Folder: -
POWER CENTER REPOSITORY: The power center repository is a relational database that contains
metadata which is required to perform ETL process. There are two types of
repositories
I.
Local Repository
II.
Global Repository
INFORMATICA
A folder is repository object which allows you to organize the
metadata stored in repository.
Local Repository: The repository that supports to share the metadata within the
repository across multi users.
Global Repository: The metadata can be shared across multiple repositories.
The repository is the brain of ETL system that stores ETL code
(Metadata).
REPOSITORY SERVICE: The repository service manages connections to the power center
repository from client applications.
The repository service is a multi threaded process that inserts,
retrieves, update and delete metadata from repository.
The repository service ensures that there is a consistency of the
metadata stored in the repository.
An integration service is an ETL engine that performs extraction,
transformation and loading.
The integration service reads sessions and mapping from repository
through repository service.
INFORMATICA
INTEGRATION SERVICE: -
The integration service also stores the metadata such as session
and work-flow status, session log in the repository through repository
service.
An integration service is created with following components
i.
Reader
ii.
DTM (Data Transformation Manager)
iii.
Writer
READER: - It performs extraction from mapping sources.
DATA TRANSFORMATION MANAGER (DTM): - It allocates buffer to process
the data according to the transformation logic that you configure in
mapping.
WRITER: - It loads the data into the mapping targets.
POWER CENTER DOMAIN: -
The power center has a Service Oriented Architecture (SOA) that
provides the ability to scale the services and share resources across
multiple machines.
The power center domain is a collection of one (or) more nodes.
A node is a process unit. A node which hosts the domain is known as
master gate-way node (or) primary node.
INFORMATICA
The power center domain is a primary unit for managing and
administrating power center services.
A master gate-way node receives the request from the client and
distributes the request to the other nodes known as worker nodes.
If the master gate-way node fails the user request cannot be
processed.
In a really configurations we configure the domain with more than
one node as master node.
POWER CENTER ADMINISTRATION CONSOLE: It is a web application which allows you to manage power center
domain.
The following administrative tasks can be performed using
administration console
I.
Configure Existing nodes
II.
Enable (or) Disable nodes
III.
Add (or) Delete nodes
IV.
Create users and user groups
V.
Create power center services for each node
I.
Setup source and target database
II.
Create ODBC connections
III.
Start power center services
IV.
Create folder
INFORMATICA
The following are the pre-requests to build an ETL process
Setup Source and Target Database: -
Start Programs Oracle Application Development SQL Plus
Log ON to Oracle with the following details
User Name: - SYSTEM
Password: - NIPUNA
Host String: - ORCL
SQL > Create user Batch 10AM identified by Target;
User created.
SQL > Grant DBA to Batch 10AM;
Grant Succeeded.
SQL > CONN Batch 10AM/Target;
Connected
SQL > Create table DIM_EMPLOYEE (EMPNO Number (5) Primary
Key, ENAME Varchar2 (10);
Job Varchar2 (10), Sal Number (7, 2);
COMM Number (7, 2), Dept No Number (2);
SQL > Select * from DIM_EMPLOYEE;
No rows selected.
EX: - SQL > CONN SCOTT/TIGER;
Connected
INFORMATICA
Table created
SQL > Select COUNT (*) from EMP;
COUNT (*)
SQL > CONN BATCH 10AM/TARGET;
Connected
SQL > Select COUNT (*) from DIM_EMPLOYEE;
COUNT (*)
CREATION OF ODBC CONNECTIONS: Source ODBC Connection: Start Settings Control Panel Administrative Tools Data Source
(ODBC)
Select a SYSTEM DSN
Click on ADD
Select a driver Oracle in ORADBLOG_HIME
Click on FINISH
Enter the following details
Data Source Name: - SCOTT_ODBC
TNS Service Name: - ORCL
User ID: - SCOTT
Click on Test Connection
Enter the PASSWORD TIGER
Again Click OK
Target ODBC CONNECTION: Enter the following details
Data Source Name: - BATCH 10AM_ODBC
INFORMATICA
Click OK
TNS Service Name: - ORCL
User ID: - BATCH 10AM
Click on Test Connection
Enter the PASSWORD TARGET
Click OK
Power Center Services: Start Settings Control Panel Administrative Tools Services
Start the following Services
I.
Informatica Orchestration Server
II.
Informatica Services 8.6.0
Creation of Folder: Start Programs Informatica Power Center 8.6.0 Clients Power
Center Repository Manager
From repository navigator windows select the Repository Name
with NIPUNA_REP Right Click Click on CONNECT
Enter User Name: - ADMINISTRATOR
Password: - ADMINISTRATOR
Click on CONNECT
From FOLDER Menu select CREATE
Enter the folder name: - BATCH 10AM (own wish)
Click OK
POWER CENTER 8.6.0 INSTALLATION: Creation of Repository User Account: -
Log ON to the Oracle with the following details
User Name: -SYSTEM
Password: - NIPUNA
INFORMATICA
Start Programs Oracle Application Development SQL Plus
SQL > Create User NIPUNA (User Name) IDENTIFIED by REP;
Grant DBA to NIPUNA
SQL > CONN NIPUNA/REP;
Connected
Installing Server Software: Browse to the location of server folder
Click on OK
Click on NEXT
Click on NEXT
Click on browse to select License Key
Click on NEXT
Click on NEXT
Click on NEXT
Click on NEXT
Click on INSTALL
Select CREATE NEW DOMAIN
10
Click on NEXT
Enter the account information to store power center domain configure
metadata
Database Type: - ORACLE
Database URL: - NIPUNA: 1521 (Computer Name: Port No)
Database User ID: - NIPUNA
Database Password: - REP
Test connection passed Click on NEXT
Enter the DOMAIN PASSWORD and CONFIRM PASSWORD to create domain
Domain User Name: - Admin (Default)
Domain Password: - Admin
INFORMATICA
Database Service Name: - ORCL
Confirm Password: - Admin
Click on NEXT
Uncheck Run Informatica Services under Different User Account
Click on NEXT
Click on DONE
CREATION of POWER CENTER SERVICES: Start Programs Informatica Power Center 8.6.0 Services
Informatica Power Center Administration Console
Enter User Name: - Admin
Password: - Admin
Click on OK
Select Administration Console
CREATION of REPOSITORY SERVICE: From create Menu Select Repository Service
Enter the following details to create Repository Service
11
Service Name: - NIPUNA_REP (Our Wish)
Node: NODE01_NIPUNA
Database Type: - ORACLE
Connect String: - ORCL
Database User: - NIPUNA
Database Password: - REP
Click on CREATE
Click on CLOSE
INFORMATICA
Select create new repository content
CREATION of INTEGRATION SERVICE: From create Menu Select Integration Service
Enter the following details to create Integration Service
Service Name: - NIPUNA (Our Wish)
Assign: - NODE
Node: - NODE01_NIPUNA
Associated Repository Service: - NIPUNA_REP
Repository User Name: - Administrator
Repository Password: - Administrator
Data movement Mode: - UNICODE
Click on CREATE
Select Enable the Integration Service after creation
Click on OK
**
Click on CLOSE
12
From Toolbar Click on SIGNOFF
Start Settings Control Panel Administrative Tools Services
Informatica Services 8.6.0
Set the start type to MANUAL for the following details
i.
Informatica Orchestration Server
ii.
Informatica Services 8.6.0
Right Click and Select MANUAL for above each services
Log ON to Power Center Administration Console
Installing Power Center Client Software: -
INFORMATICA
Restart the above Services
Browse to the location of Client Folder
Click on INSTALL
Click on OK
Click on NEXT
Click on NEXT
Click on NEXT
Click on NEXT
Click on INSTALL
Click on NEXT
Select application Power Center Designer
Click on DONE
From Repository Navigator Window Select the REPOSITORIES and
from REPOSITORY Menu click on ADD
Enter the following details
Repository: - NIPUNA_REP
User Name: - Administrator
Select Repository Service NIPUNA_REP Right Click and Connect
From connection settings just select the DOMAIN: - DOMAIN_NIPUNA
13
Next Enter the Password: - Administrator
Click on CONNECT
STEPS INVOLVING IN IMPLIEMENTING DATA
ACQUISITON: Step1: - Creation of Source Definition
A Source definition is created using source analyzer in the
designer client component.
Open the Client Power Center Designer
Connect to the Repository Service with a valid User Name and
Password.
From Repository navigator window select the folder from Tools Menu
select Source Analyzer.
INFORMATICA
Procedure: -
From Sources Menu, click on Import from Database.
Connect to database with the following details
ODBC Data Source: - SCOTT_ODBC
User Name: - SCOTT
Owner Name: - SCOTT
Password: - TIGER
Click on Connect
Select the table (EMP)
Click on OK
From Repository Menu click on SAVE
Step2: - Creation of Target Definition
A Target definition is created using Target Designer Tool
Procedure: From Tools Menu Target Designer
From Target Menu select Import from Database
14
Connect to database with the following details
ODBC Data Source: - BATCH10AM_ODBC
User Name: - BATCH10AM
Owner Name: - BATCH10AM
Password: - TARGET
Click on connect
Select the table (DIM_EMPOLYEE)
From Repository Menu click on SAVE
Step3: - Design Mapping Without Transformation Rule
A pass through mapping is designed with source and target
definitions without transformation rule.
INFORMATICA
Click on OK
A mapping is design using Mapping Designer Tool
Procedure: From Tools Menu select Mapping Designer
From Mapping Menu select Create
Enter the Mapping Name: - M_Pass_Through
Click on OK
From Repository navigator window drop the Source and Target
definitions
From Source Qualifier map the columns to the Target Definition with
the simple drag and drop operations.
From Repository Menu click on SAVE
Note: - Every Source definition default associates with Source Qualifier to
define extraction.
Step4: - Creation of Session
A session is created using Task Developer Tool in a work-flow
manager client component.
15
A session is required to run the mapping on Integration
Service.
Procedure: Open the client Power Center Work-Flow Manager
Connect to Repository with a valid User Name and Password.
Select the Folder from the Repository navigator window.
From Tools Menu Task Developer
Select the task type Session
Enter the Name: - S_M_Pass_Through
Click on Create
Select the Mapping
INFORMATICA
From Tasks Menu select Create
Click on OK
Click on Done
Creation of Reader Connection: From Work-Flow Manager client and Select Connections
Click on Relational
Select the type Oracle
Click on New
Enter the following details
Name: - SCOTT_READER (or) READER_SCOTT (Our Wish)
User Name: - SCOTT
Password: - TIGER
Connect String: - ORCL
Click on OK
Creation of Writer Connection: Click on New
16
Enter the following details
Name: - BATCH10AM_WRITER (Our Wish)
User Name: - BATCH10AM
Password: - TARGET
Connect String: - ORCL
Click on OK
From left window select the Source: - SQ_EMP
From connection set Reader connection value
Type
Value
Relational
SCOTT_READER
INFORMATICA
Double click the Session Select the Mapping Tab
From left window select the Target DIM_EMPOLYEE
From connections set Writer connection value
Type
Value
Relational
BATCH10AM_WRITER
From properties set Target load to NORMAL
Click on Apply
Click on OK
From Repository Menu click on SAVE
Step5: - Creation of Work-Flow
A work-flow is created using Work-Flow Designer Tool.
Procedure: From Tools Menu select Work-Flow Designer
From Work-Flow Menu select Create
Enter the Work-Flow Name: - W_S_M_Pass_Through
Click on OK
17
From Session sub folder drop the Session beside the start task
(Work-Flow).
From Tasks Menu select Link Task
Drag the Link from start task and drop on Session
From Repository Menu click on SAVE
Step6: - Start Work-Flow
From Work-Flows click Start Work-Flow
Procedure: From Tools select Target Designer
From Sources sub folder drop the Source Definition (EMP) so the
Target Designer Work Space.
INFORMATICA
CREATION OF TARGET DEFINITION
Double click on Target Definition click on RENAME
Select the Column Tab
Add new column (or) Deleting existing column
Click on Apply
Click on OK
From Targets Menu click on Generate/Execute SQL
Click on CONNECT to the Target database using ODBC connection
Select Create Table
Click on Generate/Execute
Click on CLOSE
TRANSFORMATONS AND TYPES OF TRANSFORMATIONS:
A transformation is a power center object which allows you to build
the business logic to process the data. There are two types of
transformations
I.
Active Transformation
18
II.
Passive Transformation
ACTIVE TRANSFORMATION: A transformation which can affect the number of rows (or) change
the number of rows when the data is moving from source to target is
known as Active Transformation.
I.
Filter Transformation
II.
Aggregator Transformation
III.
Source Qualified Transformation
IV.
Joiner Transformation
V.
Union Transformation
VI.
Router Transformation
VII.
Rank Transformation
VIII.
Sorter Transformation
IX.
Update Strategy Transformation
X.
Transaction Control Transformation
XI.
Normalizer Transformation
XII.
SQL Transformation
INFORMATICA
The following are the list of Active Transformations used for
processing the data
PASSIVE TRANSFORMATION: A transformation which doesnt affect (or) change the number of
rows is known as Passive Transformation.
The following are the list of Passive Transformations used for
processing the data
I.
Expression Transformation
II.
Stored Procedure Transformation
III.
Sequence Generator Transformation
IV.
Look-up Transformation
19
V.
VI.
XML Source Qualifier Transformation
SQL Transformation
PORTS AND TYPES OF PORTS: A port represents column of the task (or) file. There are two types of
ports
Input Port: -
Output Port: A port which can provide the data is known as Output Port, which is
designated as O.
CONNECTED AND UNCONNECTED TRANSFORMATIONS:
-
INFORMATICA
A port which can receive the data is known as Input Port, which is
designated as I.
CONNECTED TRANSFORAMTION: A transformation which is a part of mapping data-flow is known as
Connected Transformations.
It is connected to the source and connected to the target.
A connected transformation can receive multiple ports and can
return multiple output ports.
All Active and Passive transformations can be defined as Connected
Transformations.
UNCONNECTED TRANSFORMATION: A transformation which is not part of mapping data-flow is known as
Unconnected Transformation.
It is neither connected to the source nor connected to the target.
An unconnected transformation can receive the multiple input ports
but returns a single output port.
The following Transformations can be defined as Unconnected
I.
Lookup Transformation
II.
Stored Procedure Transformation
20
POWER CENTER TRANSFORMATION LANGUAGE: The power center transformation language is a set of built-in
functions used to build transformation logic to process the data.
The Informatica function set is similar to SQL functions.
I.
String Function
II.
Numeric Function
III.
Date Function
IV.
Aggregate Function
V.
Conversion Function
VI.
Cleansing Function
VII.
Variable Function
VIII.
Scientific Function
IX.
Test Function
X.
Miscellaneous Function
INFORMATICA
The built-in functions are categorized as follows
FILTER TRANSFORMATION: This is of type an Active Transformation which filters the data
records based on given condition.
The integration service evaluates the condition in the filter
transformation, returns True (or) False.
The filter transformation returns True when the input record is
satisfied with given condition those records are allowed for further
processing are loading.
False indicates that the records are rejected from filter
transformation.
The rejected records cannot be captured (or) received.
The filter transformation supports to develop a single condition and
allows you to pass the data to the single target.
The filter transformation functions as WHERE Clause in SQL.
Define the filter transformation to perform data cleansing.
21
Business Rule: Calculate the Tax (Sal*0.17) for top three employees based on
salary, who belongs to sales department, the sales department ID is
30.
This is of type an Active Transformation which allows you to
calculate ranks to identify the top and bottom performs.
The rank transformation is created with following types of ports.
I.
Input Port (I)
II.
Output Port (O)
III.
Rank Port (R)
IV.
Variable Port (V)
INFORMATICA
RANK TRANSFORMATION: -
Rank Port: A port which is participated to determine the ranks is designated as
Rank Port.
Variable Port: A port which allows you to store the data temporarily, allows you to
develop expressions is known as Variable Port.
The following properties can be set to calculate the ranks
I.
Top/Bottom
II.
Number of Ranks
The Rank Transformation by default is created with Rank Index
output port.
The integration service uses the cache memory to process the Rank
Transformation.
22
Note: - ***
The following are the Cache based Transformations (or) Costly
Transformation
a. Rank Transformation
c. Joiner Transformation
d. Look-up Transformation
e. Aggregate Transformation
EXPRESSION TRANSFORMATION: -
INFORMATICA
b. Sorter Transformation
This is of type Passive Transformation which allows you to calculate
expressions for each record.
The expression transformation is created with the following types of
ports
I.
Input Port (I)
II.
Output Port (O)
III.
Variable Port (V)
The expression transformation supports to develop expressions
either in only output ports (or) variable ports.
Define the expression transformation to perform data scrubbing.
Procedure: Creation a source definition with the name EMP
Creation a target definition with the name EMP_TAX (Column EMP
NO, ENAME, JOB, SAL, TAX, DEPT NO)
23
Create a mapping with the name M_EMP_TAX_CALCULATION drop
source and target definitions.
From Transformation Menu select CREATE
Select the Transformation type FILTER
Enter the name FILTER_EMPOLYEES (Our Wish)
Click on CREATE
From source qualifier copy the required ports to the filter
transformation.
Double click on filter transformation select Properties Tab
Transform Attribute
Value
Filter Condition
Dept No: - 30
INFORMATICA
Click on DONE
Click on APPLY
Click on Ok
From Transformation Menu select CREATE
Select the Transformation type RANK
Enter the name RANK_EMPOLYEES (Our Wish)
Click on CREATE
Click on DONE
From Filter Transformation copy the ports to the Rank Transformation
Double click on Rank Transformation select Ports Tab
For a Port name Sal select Rank Port (R)
Select Properties Tab
Transformation Attribute
Value
Top/Bottom
Top
Number of Ranks
Click on APPLY
Click on OK
24
Create the Transformation type Expression
From Rank Transformation copy the Ports to the Expression
Transformation (Expect Rank Index)
Double click on Expression Transformation select Ports Tab
From Tool Bar click on ADD A NEW PORT
Data Type
Precision
Scale
Tax
decimal
I/P O/P
Var
-
O
-
Expression
Sal*0.17
Click on OK
From Expression Transformation connect the Ports to the Target.
Mapping Rule: i)
Filter the records when it contains Nulls
INFORMATICA
Port Name
Solution: Create a Filter Transformation with the following condition
ii)
Transformation Attribute
Value
Filter Condition
IIF (ISNULL (COMM), FALSE, TRUE)
Filter the records if anyone column contains Nulls
Solution: Create a Filter Transformation with the following condition
IIF ((ISNULL (EMPNO) OR
ISNULL (ENAME) OR
ISNULL (JOB) OR
ISNULL (MGR) OR
ISNULL (HIREDATE) OR
ISNULL (SAL) OR
25
ISNULL (COMM) OR
ISNULL (DEPTNO), FALSE, TRUE)
iii)
Migrate all records from Source to Target using Filter
Transformation
Solution: Create a Filter Transformation with the following condition
TRUE
iv)
Loading Employees whose name starts with S
Solution: Create the Filter Transformation with the following condition
SUBSTR (EMPNAME, 1, 1) = S
v)
INFORMATICA
Note: - The default Filter Condition is TRUE
Loading Employees whose number is Even
Solution: Create the Filter Transformation with the following condition
MOD (EMPNO, 2) = 0
vi)
Loading Employees whose Employee name is having more (or)
equal to 6 characters
Solution: Create the Filter Transformation with the following condition
LEN (ENAME) >= 6
vii)
Double the count in the target when the source having N records
Solution: Create Target definition as a multiple instants
26
EXPRESSION TRANSFORMATION Variable Port: A port which can store the data temporarily is known as Variable
Port (V).
A Variable Port is required to Simplify the Complex Expressions and
improves the efficiency of the calculation.
Variable Ports are not visible in normal view, but visible in edit view.
Mapping Rules: i)
INFORMATICA
Variable Ports are LOCAL to the transformation.
Calculate the TAX based on total SALARY.
Total salary is calculated as sum of salary and commission, where
commission column may having NULL values
If the total salary is greater than 2500 then calculate the tax as
(total sal*0.15), else calculate as (total sal*0.12).
Solution: Create the transformation type Expression
Double click on Expression Transformation and select the Ports Tab
Port
Name
Data
Type
Precision
Scale
V_Total
Sal
Decimal
Expression
IIF(ISNULL(COMM)S
AL, SAL+COMM)
V
Decimal
TAX
I O
V
2
O
IIF(V_TOTAL SAL >
2500,
V_TOTAL
SAL*0.15
V_TOTAL
SAL*0.12)
27
Click on APPLY
Click on OK
ii)
Reject the records which contains NULL values
Create the Transformation type Expression
Double click on Expression Transformation and select the Ports Tab
Data
Type
Precisio
n
Scale
Exception_F
lag
String
10
I O V
Expression
IIF((ISNULL(EMPNO
) OR
ISNULL(ENAME) OR
ISNULL(JOB) OR
ISNULL(SAL) OR
ISNULL(COMM) OR
INFORMATICA
Port Name
ISNULL(DEPTNO),
E,C)
Click on APPLY
Click on OK
Create the Transformation type Filter and develop the following
condition
Transformation Attribute
Value
Filter condition
Exception_flag=C
Click on APPLY
Click on OK
DATA ATTRIBUTES: Mapping Rules: i)
Derive the calendar attributes such as Year, Quarter, Month,
Week, Day, Day number in month, Day number in year.
Solution: -
28
Create the Transformation type Expression
Double click on Expression Transformation and select Ports Tab
From Toolbar click on Add a New Port
Port
Name
Data
Type
Expression
YOJ
Decimal
Quarter
Decimal
TO_DECIMAL(TO_CHAR(HIREDATE,
YYYY))
Month
Decimal
Month
Name
String
10
Decimal
Decimal
Decimal
Week
no. in
year
Day no.
in week
Day no.
in
month
Decimal
Decimal
TO_DECIMAL(TO_CHAR(HIREDATE,
MM))
TO_DECIMAL(TO_CHAR(HIREDATE,
MON))
INFORMATICA
Week
no. in
month
TO_DECIMAL(TO_CHAR(HIREDATE,
Q))
TO_DECIMAL(TO_CHAR(HIREDATE,
W))
TO_DECIMAL(TO_CHAR(HIREDATE,
WW))
TO_DECIMAL(TO_CHAR(HIREDATE,
D))
Day no.
in year
TO_DECIMAL(TO_CHAR(HIREDATE,
DD))
TO_DECIMAL(TO_CHAR(HIREDATE,
DDD))
29
ii)
Calculate the total salary for each employee Total SAL=
SAL+COMM, where COMM column having NULL values
Solution: Port
Name
Data
Type
Expression
COMM
Decimal
SAL+IIF(ISNULL(COMM),0,COMM
)
iii)
Decode the gender 0 as M, 1 as F and unknown as UNK
Create the Transformation type Expression
Develop the following conditions
IIF(GENDER=0, M, IIF(GENDER=1, F, UNK))
DECODE(GENDER, 0, M,
INFORMATICA
Solution: -
1, F,
UNK)
Note: - The power center supports following comments to ignore
expressions (or) any text messages while executing on Integration
Service.
--, ||
iv)
Concatenate two string fields such as first name and last name
Solution: Create the Transformation type Expression
Develop the following conditions
LTRIM(RTRIM(EFNAME)) || || LTRIM(RTRIM(ELNAME))
CONCAT(EFNAME, CONCAT( , ELNAME))
v)
Calculate the employee experience in number of years
Solution: Create the Transformation type Expression
Develop the following conditions
1. DATE_DIFF(SYSDATE, HIREDATE, YYYY)
30
vi)
Calculate the Tax(SAL*0.17) for top three employees of each
department
Solution: -
FILTER TRANSFORMATION PERFORMANCE
OPTIMIZATION: -
INFORMATICA
Keep the Filter Transformation as close to Source Qualifier as
possible to filter the data early in the data-flow so that, the number of
records are reduced for further processing.
EXPRESSION TRANSFORMATION PERFORMANCE
OPTIMIZATION: Create Variable ports to simplify the complex expressions.
Use DECODE function rather than using multiple IIF functions.
Use string operator || to concatenate two string fields rather than
using CONCAT function.
ROUTER TRANSFORMATION: This is a type an Active Transformation which allows you to develop
multiple conditions and allows you to pass the records to the multiple
targets.
The Router Transformation created with two types of groups
I.
Input group
II.
Output group
INPUT GROUP: An Input group receives the data from the source pipe line.
There should be only input group to receive the data.
31
OUTPUT GROUP: An Output group provides the data for further processing (or)
loading.
There are two types of Output groups
User Defined Output group: It allows you to develop condition
One row can pass multiple conditions.
Unlinked group Outputs are ignored.
Default group: The default group captures a row that fails all group conditions.
INFORMATICA
Each group has one condition all group conditions are evaluated for
each row.
PERFORMANCE CONSIDERATIONS: The Router Transformation has a performance advantage over
multiple Filter Transformation because a row is read once into the Input
group but evaluate multiple times based in the number of groups.
Whereas using multiple Transformations requires the same row data to be
duplicated for each Filter Transformation.
DIFFERENCES BETWEEN FILTER & ROUTER
TRANSFORMATIONS: FILTER
ROUTER
i)
Single condition
i)
Multiple conditions
ii)
Single target
ii)
Multiple targets
iii)
It does not capture the
rejected
iii)
The default group can
captures
records that fails to meet
the Filter
condition
rejected records that fails all
group
conditions
MAPPING RULES: 32
i)
Correct the data pass through one target and exception data
pass through another target if any record contains NULL value.
That is defined as Exception.
Solution: Create the Transformation type Expression and develop the
following Expression
IIF ((ISNULL (EMPNO) OR
ISNULL (ENAME) OR
INFORMATICA
ISNULL (JOB) OR
ISNULL (MGR) OR
ISNULL (HIREDATE) OR
ISNULL (SAL) OR
ISNULL (COMM) OR
ISNULL (DEPTNO), E, C)
Create the Transformation type Router
Double click on the Router Transformation and select groups Tab
From Toolbar Tab click on ADD a new group
Group Name
Group Filter Condition
Correct_Data
Exception_Flag= C
Exception_Data
Exception_Flag= E
Default ONE
Click on APPLY
Click on OK
Select * from EMP_EVEN;
i)
Even number Employees to one target and odd number
Employees to another table
Solution: Create the Transformation type Router
33
Double click on the Router Transformation and select the group Tab
ii)
Group Name
Group Filter Condition
EVEN
MOD(EMP,2)=O
Employee name start with A pass through one target and
Employee name start with S pass through another target
Solution: Create transformation type Router
From Toolbar click on ADD a new group
Group Name
Group Filter Condition
ENAME_A
TRUE
ENAME_S
TRUE
INFORMATICA
Double click on Router Tab
SUBSTR (ENAME, 1, 1) = A
SUBSTR (ENAME, 1, 1) = S
SORTER TRANSFORMATION: This is of type Active Transformation which allows you to sort the
data either in ascending order (or) descending order.
The port(s) which is participated in sorting the data is designated
Key Port.
Use the Sorter Transformation to eliminate duplicates hence it is
known as Active Transformation.
AGGREGATOR TRANSFORMATION: This is of type an Active Transformation which allows you to
calculate the summaries for groups of records.
An Aggregator Transformation is due to perform aggregator
calculations.
An Aggregator Transformation is created with following components
I.
Group By
II.
Aggregate Expressions
34
III.
Sorted Input
IV.
Aggregate Cache
Group By: It defines a group on a port(s) for which we calculate Aggregate
Expressions.
Aggregate Expressions: -
I.
Sum()
II.
Average()
III.
Max()
IV.
Min()
V.
Count()
VI.
First()
VII.
Last()
VIII.
Median()
IX.
Variance()
X.
Percentile()
INFORMATICA
The Aggregate expressions can be developed either in only output
ports (or) variable ports. The following Aggregate functions can be used to
define the standard Aggregation
The Aggregate functions can be used only in Aggregator
Transformation.
It calculates the single value for all records in a group.
**Only one Aggregate function can be nested with in an Aggregate
function.
Conditional statements can be used with Aggregate functions.
Sorted Input: It instructs the Aggregator to except the data to be sorted.
35
The Aggregator Transformation can handle sorted (or) unsorted
data.
The sorted data can be aggregated more efficiently decreasing total
processing time.
**The Integration Service will cache the data for each group and
releases the cached data upon reaching the first record of next group.
The cache size minimizes the load on the machine can be reduced.
The Group By ports are sorted using Sorter Transformation, keep the
Sorter Transformation prior to Aggregator Transformation.
Unsorted Aggregator: No rows are released from cache until all rows are aggregated.
The cache size requirements increases, there by load on the
machine increases.
INFORMATICA
**The data must be sorted according to the order of Aggregator
group by ports.
The Aggregator efficiency decreases.
Aggregator Cache: When the mapping contains an Aggregator Transformation the
Integration Service uses the cache memory to process the aggregator.
When the session completes the cache was erased.
Note: Nested Aggregation: SUM (AVG (SAL)) -- One level nesting
SUM (AVG (MAX (SAL))) -- Two level nesting
Mapping Rule: Calculate the total salary for each group for employees whose salary
is greater than 1500
36
This is of type an Active Transformation which allows you to lookup
on Relational tables, Flat Files, Synonyms and Views.
When the mapping contains a Lookup Transformation the Integration
Service queries the lookup data and compares is with transformation port
values (Source data)
The Lookup Transformation is created with the following type of
INFORMATICA
LOOKUP TRANSFORMATION: -
ports
I.
Input Port (I)
II.
Output Port (O)
III.
Lookup Port (L)
IV.
Return Port (R)
The Lookup Transformation is used to perform the following tasks
I.
Get a related value
II.
In implementing Slowly Changing Dimensions
There are two types of Lookups.
I.
Connected Lookup
II.
Unconnected Lookup
Connected Lookup: Its a part of mapping data-flow.
It can receive multiple Input ports and can provide multiple Output
ports (Single record)
37
Unconnected Lookup: It is not a part of mapping data-flow.
It is neither connected to the Source nor connected to the Target.
An Unconnected Lookup can receive multiple Input ports but it
returns a Single Output Port, which is designated as Return Port (R).
Lookup Transformation Cache: Caching can significantly impact the performance.
Lookup data is cached locally on server.
Source rows (or) records are looked-up against cache.
Only one SQL select is needed.
Un-Cached Lookup: -
INFORMATICA
Cached Lookup: -
For each Source row one SQL select is needed.
Source rows are looked-up against database (DB lookup).
Rule of Thumb: Cache the Lookup if the number of records in the lookup table is
small relative to number of records in the Source.
Un-Cached Lookup Performance Consideration: You have ten rows in the Source and one million records in the
Lookup table then the Power Center built the cache for the lookup table
then checks the ten Sources ros against the cache.
It takes more time to built cache of one million rows then going to
database ten times and lookup against the table directly.
Use the Un-cached Lookup instead of building the cache.
Note: By default the cache is enable to built Lookup cache.
Procedure: Create Source and Target definitions (DEPTNO, DNAME, LOC, and
SUMSAL)
Create a Mapping with the name M_Aggregation_Lookup
38
Drop the Source and Target definitions
Create the Transformation type Sorter and Aggregator
From Source Qualifier copy the following ports to the Sorter
Transformation
DEPTNO & SAL
Double click on Sorter Transformation and select Port Tab
For a Port Name: - DEPTNO select key
Click on APPLY & OK
Double click on Aggregator Transformation and select Ports Tab
For a Port Name: - DEPTNO select Group By
Uncheck the Output Port for a Port Name: - SAL
From Toolbar click on ADD a new port
Port Name
Data Type
Precisio
n
Scale
Expression
SUMSAL
Decimal
SUM (SAL)
INFORMATICA
From Sorter Transformation copy the ports to Aggregator
Select Properties Tab and select Sorted Input
Click on APPLY & OK
From Aggregation Transformation connect the Ports to Target
From Transformation Menu select CREATE
Select the Transformation type LOOKUP
Enter the Name
Click on CREATE
Select the SOURCE
Select the table DEPT
Click on OK
From Aggregator Transformation copy the port DEPTNO to the
LOOKUP
Double click the LOOKUP Transformation select the Condition Tab
From Toolbar click on ADD a new Condition
39
Lookup Table Column
Operator
Transformation Port
DEPTNO
DEPTNO1
Click on APPLY
Click on OK
INFORMATICA
From LOOKUP Transformation connect the Ports to Target
Note: Lookup Transformation supports Joins (Horizontal Merging).
Lookup Transformation also supports Inequality comparisons (<=,
>=, !=).
Lookup Transformation supports multiple Lookup conditions.
The Lookup Transformation supports only AND operator between
multiple Lookup conditions.
It does not supports OR operator.
JOINER TRANSFORMATION: This is of type an Active Transformation which allows you to combine
the data records horizontal from multiple sources based on join condition.
40
The Joiner Transformation supports only two Input Streams per
Joiner.
The Joiner Transformation supports multiple join conditions, the
conditions are combined using operator AND (does not supports OR).
The Inputs to the Joiner Transformation are designated as Master
and Detail Source.
The Integration Service creates the joiner cache for only Master
Source.
The Joiner Transformation is created with the following types of ports
I.
Input Port (I)
II.
Output Port (O)
III.
Master Port (M)
INFORMATICA
A Source which is having a lesser number of records is designated
as Master Source, which occupies the least amount of space in the cache.
A Master Source is defined with the master ports.
The Joiner Transformation supports Homogenous Data Sources and
Heterogeneous Data Sources to combine the records horizontally.
A join which is made on same data sources is known as
Homogeneous Joins.
Ex: ORACLE TABLE + ORACLE TABLE
SQL SERVER + SQL SERVER TABLE
A join which is made on two different data sources is known as
Heterogeneous Joins.
Ex: SQL SERVER TABLE + ORACLE TABLE
The Joiner Transformation also supports non-relational sources such
as Flat Files, XML Files etc.
The Joiner Transformation supports the following types of Joins
I)
Normal Join (Equi-Join (or) Inner Join)
II)
Master Outer Join
41
III)
Detail Outer Join
IV)
Full Outer Join
The default join type is Normal Join.
The Joiner Transformation does not supports non-equi joins ( <, >,
=<, >=, |=)
NORMAL JOIN: It combines the records from Master and Detail Sources based on
equality match.
It keeps all the records from the Detail Source and matching records
from Master Source.
DETAIL OUTER JOIN: It keeps all the records from the Master Source and matching
records from Detail Source.
INFORMATICA
MASTER OUTER JOIN: -
FULL OUTER JOIN: It keeps matching and non-matching records from both Master and
Detail Sources.
Performance Considerations: o Define the Master Source which can occupy the least amount of
space in cache.
o An Inner Join can improve the performance over an Outer Join
because an Inner Join can result lesser number of records than
Outer Join.
42
o User Sorted Input: - Keep the Sorter Transformation prior to
Joiner, sort the data on a port which is participate in Join
condition
Ex: - DEPTNO
JOIN TRANSFORMATION - ADVANTAGES: o Can Joiner heterogeneous sources
o Can Joiner non-relational sources
o Can Joiner partially transformed data
INFORMATICA
DISADVANTAGES: o Can only Join two input data streams per Joiner
o Only supports Equi-Join
o Does not supports OR condition
Procedure: Create two Source definitions with a name EMP, DEPT
Create a Target definition with a name EMP_DEPT (EMPNO, ENAME,
JOB, SAL, DEPTNO, DNAME, and LOC)
Create a Mapping with a name M_Homogeneous_Join
Drag both Source and Target into Mapping Work Space
Create Transformation type JOINER with a name JOIN_EMP_DEPT
Connect the required ports from SQ_EMP to the Joiner
Transformation
Connect the ports from SQ_DEPT to the Joiner Transformation
Double click on Joiner Transformation and click on Conditional Tab
From Toolbar click on ADD a new port
MASTER
OPERATOR
DETAIL
DEPTNO1
DEPTNO
Click on Properties and unselect the Sorted Input
Connect the ports from joiner transformation to corresponding port
in the Target
43
Create Session
Create Work-Flow
Start Work-Flow
UNION TRANSFORMATION: It is of type an Active Transformation used to combine multiple
sources into a single output.
All the inputs of a Union Transformation should have the same
structure (number of columns and datatypes should be same)
Union Transformation works like Union All in oracle.
Union Transformation is created with two types of groups
i)
Input group: - Which receives the data
ii)
Output group: - Which sends the data to either target (or) any
other down stream transformation for further processing.
INFORMATICA
It supports Homogeneous sources as well as Heterogeneous
sources.
Procedure: Create two Source definitions with the name EMP, EMP1 with the
same structure
Create a Target definition with the name EMP_UNION with the same
structure from EMP (or) EMP1
Create a Mapping with the name M_HOMOGENEOUS_UNION
Drag the Sources EMP and EMP1, drop on work space
Drag the Target EMP_UNION, drop on work space
Create a Transformation of type UNION with the name
UNION_EMP_EMP1
Double click on the header of UNION Transformation
Click on Groups Tab and click on ADD a new group (name the Group
as EMP & EMP1)
Click on Group Ports Tab and ADD the following Ports
44
DATATYPE
PRECISION
SCALE
EMPNO
Integer
10
ENAME
String
10
JOB
String
10
MGR
Integer
10
HIREDATE
Date/Time
29
SAL
Decimal
10
COMM
Decimal
10
DEPTNO
Integer
10
Click on APPLY
Click on OK
Connect the Ports from SQ_EMP to EMP group of Union
Transformation
INFORMATICA
PORTNAME
Connect the Ports from SQ_EMP1 to EMP1 group of Union
Transformation
Connect the Ports from the Output group of Union Transformation of
the Target
From Repository click on SAVE
Data-flow Diagram: -
Create a Session with name S_M_UNION
Create a Work-flow with name W_S_M_UNION
Start Work-flow
NOTE: - Union Transformation supports vertical merging.
HETEROGENEOUS JOINS: 45
A Join which is made on two different data sources is known as
Heterogeneous Joins.
Creation of SQL Server Database: START PROGRAMS MICROSOFT SQL SERVER ENTERPRISE
MANAGER
From left window expand CONSOLE ROOT
Select the DATABASES folder, Right click and click on NEW
DATABASE
INFORMATICA
Procedure: -
Enter the DATABASE NAME (Ex: - BATCH10AM)
Click on OK
Creation of Table in SQL Server Database: Procedure: START PROGRAMS MICROSOFT SQL SERVER QUERY
ANALYSER
Connect to SQL Server with the following details
SQL SERVER: - NIPUNA (computer name)
SQL Server Authentication
LOG NAME: - SA
PASSWORD: - SA
Click on OK
Commands: USE BATCH10AM
CREATE TABLE DEPT (DEPTNO INTEGER, DNAME VARCHAR (10), LOC
VARCHAR (10))
46
SP_HELP DEPT
INSERT INTO DEPT VALUES (10, SALES, HYD)
INSERT INTO DEPT VALUES (20, OPERATIONS, CHE)
INSERT INTO DEPT VALUES (30, ACCOUNTS, DEL)
SELECT * FROM DEPT
Creation of ODBC connections: -
Select the System DSN Tab and click on ADD
Select the driver SQL Server
Click on FINISH
INFORMATICA
START SETTINGS CONTROL PANEL ADMINSTRATIVE TOOLS
DATA SOURCES (ODBC)
Enter the following details
Name: - BATCH10AM_SQL_SERVER (our wish)
Server: - NIPUNA (computer name)
Click on NEXT
Select with SQL Server Authentication
Log ID: - SA
Password: - SA
Click on NEXT
Select change the default database to BATCH10AM
Click on NEXT
Click on FINISH
Click on Test Data Sources
Click on OK
Creation of Reader connection to Microsoft SQL Server:
Procedure: -
47
Open the Client Power Center Work-flow Manager
From Connections Menu, select Relational
Select the type Microsoft SQL Server
Click on NEW
Enter the following details to create connection object
Name: - SQL_SERVER_READER (our wish)
Password: - SA
Attribute
Value
Database Name
SCOTTDB
Password
NIPUNA (computer name)
INFORMATICA
User Name: - SA
Click on OK
Creation of Writer connection to Microsoft SQL Server: Procedure: Open the Client Power Center Work-flow Manager
From Connections Menu, select Relational
Select the type Microsoft SQL Server
Click on NEW
Enter the following details to create connection object
Name: - SQL_SERVER_READER (our wish)
User Name: - SA
Password: - SA
Attribute
Value
Database Name
BATCH10AMDB
Password
NIPUNA (computer name)
Click on OK
48
Creation of SQL definition Microsoft SQL Server: From Tools Menu select Source Analyzer
From Sources Menu click on Import from Database
Connect to the database with the following details
ODBC data Source: - BATCH10AM_SQL_SERVER
User Name: - SA
Owner Name: -SA
INFORMATICA
Password: - SA
Click on CONNECT
From Show Owners select ALL
Select the Table
Click on OK
From Repository Menu click on SAVE
Create a Target definition with a name EMP_DEPT (oracle)
Columns list (EMPNO, ENAME, JOB, SAL, DEPTNO, DNAME, LOC)
Create a Mapping with a name M_HETEROGENEOUS_JOIN
Drop the Sources definition on work space
Create the Transformation type JOINER
From SQ_EMP copy the required Ports to the Joiner Transformation
From SQ_DEPT copy the required Ports to the Joiner Transformation
Change the Datatype for a Port Name: - DEPTNO from Integer to
Decimal
Double click on Joiner Transformation and select the Condition Tab
From Toolbar click on ADD a new condition
MASTER
OPERATOR
DETAIL
DEPTNO1
DEPTNO
Click on APPLY
49
Click on OK
From Joiner Transformation connect the ports to the Target definition
From Repository Menu click on SAVE
Create a Session with a name S_M_HETEROGENEOUS_JOIN
Create a Work-flow with a name W_S_M_HETEROGENEOUS_JOIN
Start Work-flow
This is of type an Active Transformation which supports the users to
write SQL queries known as SQL Over Write.
The Source Qualifier Transformation supports SQL over write when
the source is database.
The Source Qualifier Transformation supports source filters, user
defined joins, sorting input data, eliminating duplicates using distinct etc.
INFORMATICA
SOURCE QUALIFIER TRANSFORMATION: -
The Source Qualifier Transformation supports to read the data from
tables and Flat files (Text files).
The Source Qualifier Transformation functions as SQL SELECT
statements.
Key Points: The following Transformations support SQL over Write
I.
Source Qualifier Transformation
II.
Lookup Transformation
SQL OVER WRITE VERTICAL MERGING: Procedure: Create Source definition EMP (Oracle) and Target definition
EMP_COUNT
Create a Mapping with the name M_SQLOVERWRITE_UNION
Drop the Source and Target definitions on Work Space
From Source Qualifier connect the ports to the Target and select the
Properties Tab
TRANSFORMATION ATTRIBUTE
VALUE
SQL query
SELECT * FROM EMP UNIONALL
50
SELECT * FROM EMP WHERE
ROWNUM < 7
Click on APPLY
Click on OK
SQL OVER WRITE SELF JOINS: The Source Qualifier Transformation supports only homogeneous
data sources to perform horizontal merging.
Source Qualifier supports SQL joins such as Inner Join (Equi Join),
Left Outer Join, Right Outer Join and Full Outer Join.
INFORMATICA
Advantages of Source Qualifier Join: o It can join any number of Tables.
o Full functionality of standard SQL available.
o May reduces volume of data on network.
Disadvantages of Source Qualifier Join: o It can only join homogeneous relation tables
o It can affect performances on the source database because source
database servers may not be tuned with required buffer sizes.
Procedure: Create Sources with the names EMP (Oracle) and DEPT (Oracle)
Create Target with the name EMP_SQL_JOIN (Oracle)
Column list (EMPNO, ENAME, JOB, SAL, DEPTNO, DNAME, LOC)
Create a Mapping with the name M_SQL_JOIN
Drop the Sources and Target definitions on work space
Select the SQ_DEPT click on DELETE
From DEPT Source definition copy the ports to SQ_EMP
Double click on Source qualifier Transformation and select the
Properties Tab
TRANSFORMATION ATTRIBUTE
VALUE
SQL Query
SELECT EMP.EMPNO, EMP.ENAME,
EMP.JOB, EMP.SAL, EMP.DEPTNO,
DEPT.DNAME, DEPT.LOC from EMP
51
INNER JOIN DEPT ON
EMP.DEPTNO=DEPT.DEPTNO;
Click on APPLY
Click on OK
From Source qualifier connect the Ports to the Target
PROPERTIES OF THE SOURCE QUALIFIER: Source filter supports to write conditions to filter the data.
Filter the data early in the data-flow by defining source filter to
reduce the number of records for further processing.
It improves the performance of data extraction.
II)
Keep the Filter Transformation as close to the Source qualifier as
possible to filter the data early in the data-flow.
INFORMATICA
I)
If possible move the same condition to Source Qualifier
Transformation.
III)
User defined joins: - It defines the join condition in the Where
Clause
Syntax: - EMP.DEPTNO=DEPT.DEPTNO
IV)
Number of Sorted Ports: - Number of input ports used for sorting
the data
It defines an Order by clause in SQL select statement.
Performance Considerations: Use Sorter Transformation to perform sort rather than using an
order by clause in SQL over ride because the Source database may
not be clowned with required buffer sizes.
V)
Select distinct: - It eliminates duplicates from Sources
Pre Sort: Integration Service executes SQL statements using Source database
connection before it starts extraction.
Post Sort: Integration Service executes SQL statements using Source database
connection after starts extraction.
52
Note: - We can write multiple SQL statements which are separated by
Semi-colon.
VI)
Session Over ride: - Its a process of changing the business logic
at Session level. The Integration Service executes the Session
level logic
High priority than mapping over ride.
Double click on the Session and select the Mapping Tab
From left window select SQ_EMP
From Properties Tab select the Attribute SQL query
INFORMATICA
Procedure: -
Click on BROWSE to open SQL editor
Change the Business Logic
Click on OK
Click on APPLY
Click on OK
Design a Mapping without Importing the Source definition from
database
STORED PROCEDURE TRANSFORMATION: It is of type a Passive Transformation used to call the Procedures
written at database level.
Stored Procedures are reusable.
A Stored Procedure is nothing but a set of SQL statements.
Properties of Stored Procedure Transformation: Normal Property: - (default property)
Use Normal property to perform Row-by-Row calculations.
Source Pre-Load: -
53
Integration Service executes a stored procedure before extracting
the data from source.
Source Post-Load: Integration Service executes a stored procedure after extracting the
data from source.
Target Pre-Load: Integration Service executes a stored procedure before loading the
data into target.
Integration Service executes a stored procedure after loading the
data into target.
Connect to the Target and Create the following procedure: SQL> SHOW USER
INFORMATICA
Target Post-Load: -
USER IS BATCH 10AM
SQL> CREATE OR REPLACE PROCEDURE TAXCAL_PROC (SAL IN
NUMBER, TAX OUT NUMBER)
IS
BEGIN
TAX: = SAL*0.2;
END;
/ (ENTER)
Procedure created
SQL>
Procedure: Create a Target definition with the name EMP_TAX_SP
(EMPNO, ENAME, JOB, SAL, DEPTNO, TAX, DNAME, LOC)
Create a Mapping with the name M_TAXCAL_SP
Drag the Source EMP and Target EMP_TAXCAL_SP definitions on work
space
54
Connect the Ports from Source qualifier to the corresponding Ports in
the Target
Create Transformation type Stored Procedure with name SP_TAXCAL
Click on CREATE
Enter the following database information
ODBC Source: - BATCH10AM_ODBC (Oracle in Oarcle10g_home1)
Username: - BATCH10AM
INFORMATICA
Owner name: - BATCH10AM
Password: - TARGET
Click on CONNECT
Expand the Procedures
Select the SP_TAXSAL (Target Table)
Click on DONE
Connect the Port SAL from Source qualifier to Port SAL in the Stored
Procedure Transformation
Connect the Port TAX from Stored Procedure Transformation to Port
TAX in the Target
From Repository Menu click on SAVE
Create a Session with the name S_M_TAXCAL_SP
Double click on Session and select Mapping Tab
Specify the Source and Target connections
From Transformations select Stored Procedure (SP_TAXCAL)
Set the following Property
ATTRIBUTE
VALUE
CONNECTION INFORMATION
Default is Target but Select
55
BATCH10AM
Click on APPLY
Click on OK
Create a Work-flow with the name W_ S_M_TAXCAL_SP
Start Work-flow
A flat file is a ASCII character text file which is saved with an
expression .txt, .csv (comma separated value), .dat.
There are two types of flat files
I.
Delimited Flat File
II.
Fixed Width Flat File
INFORMATICA
FLAT FILES: -
Delimited Flat File: Each column (or) field is separated by some special characters such
as Comma, Tab, Space, Semi-colon, pipe etc.
Ex: - Customer_East.txt
Step: -1) Creation of Source definition
Procedure: From Tools Menu select Source Analyzer
From Sources Menu click on Import from File
Select the location of the File (C:\Flat File)
Select the File
Click on OK
Select the Flat File type Delimited
Select Import Field names from first line
Click on NEXT
Select the Delimiter Comma
56
Click on NEXT
Click on FINISH
From Repository Menu click on SAVE
Step: -2) Creation of Target definition
Create a Target definition with the name CUSTOMER (Oracle)
Step: -3) Creation of Mapping
Drop Source and Target definition on Work Space
Step: -4) Creation of Session
Create a Session with the name S_M_FLAT_FILE
Double click on Session and select the Mapping Tab
INFORMATICA
Create a Pass through Mapping with the name M_FLAT_FILE
From left window select SQ_CUSTOMER_EAST
From Properties set the following attributes
Attribute
Value
Source File type
Direct
Source File directory
C:\Flat File
Source File name
Customer_East.txt
From left window select the Target (Customer)
Set the Writer connection with the load type Normal
Click on APPLY
Click on OK
From Repository Menu click on SAVE
Note: o Source qualifier does not support to write SQL statement in Files, it
supports only in databases
o Power Center supports Flat Files but as per definition DWH does not
supports Files.
File List: 57
A Flat file is a ASCII character text file which is solved with an
extension .txt, .CSV, (comma separated value), .dat.
There are two types of flat files
I.
Delimited Flat File (variable length flat file)
II.
Fixed Width Flat File
Delimited Flat file: -
Ex: - CUSTOMER_EAST.txt
Step: -1) Creation of Source definition
Procedure: From Tools Menu select Source definition
INFORMATICA
Each column (or) filed is separated by some special characters as
Comma, Tab, Space, semi colon, Pipe etc.
From Sources Menu click on Import from File
Select the location of the File (C:\Flai File)
Select the File
Click on OK
Select the Flat File type Delimited
Select Imported Field names from first line
Click on NEXT
Click on FINISH
From Repository Menu click on SAVE
Step: -2) Creation of Target definition
Create a Target definition with the name CUSTOMER (Oracle)
Step: -3) Creation of Mapping
Create a Pass through Mapping with the name M_Flat_File
Drop the Source and Target definitions on Work Space
58
Note: Source qualifier does not supports to write SQL query in Files,
it supports only in databases
Step: -4) Creation of Session
Create a Session with the name S_M_Flat_file
Double click on the session and select Mapping Tab
From Left window select SQ_CUSTOMER_EAST
Attributes
Value
Source File type
Direct
Source File directory
C:\Flat File
Source file name
CUSTOMER_EAST.txt
From Left window select the Target (Customer)
INFORMATICA
From Properties set the following attributes
Set the Writer connection with the load type Normal
Click on APPLY
Click on OK
From Repository Menu click on SAVE
Note: Power Center supports Flat Files but as per definition DWH does not
supports Files.
**FILE LIST: A File list is a collection of multiple text files with the same
Delimiter, Metadata that can be merged with the Source File type as
Indirect.
Creation of Flat File: Open the text editor Notepad provide the path of each source file
C:\Flat File\CUSTOMER_EAST.txt
C:\Flat File\CUSTOMER_SOUTH.txt
C:\Flat File\CUSTOMER_WEST.txt
59
SAVE the File with the name List.txt.
Sources Files: CUSTOMER_SOUTH.txt
CNO, CNAME, AMOUNT CNO, CNAME, AMOUNT
AMOUNT
CNO, CNAME,
100, Arun,
2000
Sandy, 2000
102, Chandu, 2000
104,
101, Anil,
1000
Dusty,
2000
103,
105,
chitti,
2000
Procedure: Create a Target definition with the name CUSTOMER_LIST (oracle)
Create a Pass through Mapping with the name M_File_List
INFORMATICA
CUSTOMER_EAST.txt
CUSTOMER_WEST.txt
Drop the Source and Target definitions on work Space
Create a session with the name S_M_File_List
Double click the Session and select the Mapping tab
From Left window select the Source qualifier (SQ_CUSTOMER_EAST)
From Properties set the following attributes
Attributes
Value
Source File type
Indirect
Source File directory
C:\List
Source File name
LIST.txt
From Left window select the Target
Set the Writer connection with the load type Normal
Click on APPLY
Click on OK
From Repository Menu click on SAVE
**Rejected Truncated/Over Flow Rows: From Mapping double click on Target definition and select Properties
Tab
60
Transformation Attribute
Value
Reject Truncate /Over Flow rows
Click on APPLY
Click on OK
When you Run the Session the Integration Service rejects the
truncated records, it can view by the following directory.
Fixed Width Flat Files: Every record is having a same length.
The record has to be split at a given break point using break lines.
INFORMATICA
C:\Informatica\Power Center 8.6.0\ Server\ Infa_Shared\Bad Files
EX: - EMPLOYEE.txt
7001VSSNAAYANA450020
7002SIVA
500010
7003SURYA
550030
Note: Fixed Width files improve the performance over Delimited files.
Comma, Tab, Space, Pipe are column character
/n is a record Delimiter character
Step: -1) Creation of Source definition
Procedure: From Tools Menu click on source Analyzer
From sources Menu click on Import from File
Select the location of the File
Select the File
Click on OK
Select the Flat File type Fixed Width
61
Click on NEXT
Provide the column names for each field
Click on FINISH
Right click on the Source definition and click on Edit
Click on Advance
Set number of bytes to skip between the record : 2
Click on OK
Click on OK
From Repository Menu click on SAVE
From Target to start Work Flow same procedure as Delimited Flat File
XML Source Qualifier Transformation: -
INFORMATICA
Click on APPLY
The XML Source qualifier transformation reads the data from XML
files, which are saved with an extension .xml.
Every XML source definition by default associates with XML source
qualifier transformation.
EX: - EMP.xml
<EMP_DETAIL>
<EMP>
<EMPNO> 7001 </EMPNO>
<ENAME> SMITH </ENAME>
<JOB> MANAGER </JOB>
<SAL> 5000 </SAL>
<DEPTNO> 10 </DEPTNO>
</EMP>
<EMP>
<EMPNO> 7002 </EMPNO>
62
<ENAME> WARD </ENAME>
<JOB> CLERK </JOB>
<SAL> 3000 </SAL>
<DEPTNO> 20 </DEPTNO>
</EMP>
</EMP_DETAIL>
Step: -1) Creation of Source definition
From Sources Menu click on Import XML definition
Select the location of an XML file with the files of type .xml
Select the file EMP.xml
INFORMATICA
From Tools Menu click on Source Analyzer
Click on OPEN
Click on YES
Click on OK
Click on NEXT
Select Hierarchy relationships
Select Denormalized XML views
Click on FINISH
From Repository Menu click on SAVE
Step: -2) Creation of Target definition
By default we get XPK_EMP, delete that by double click on Target
definition
From Mapping to start Work flow procedure is same as above
Transaction Controlled Transformation: This is of type an Active transformation which controls the
transactions bounded by Commit and Rollback.
The transaction controlled transformation functions as TCL
commands (commit, Rollback) in SQL.
63
Power Center supports to control the transactions at two different
levels
i)
At mapping level using transaction controlled transformation
ii)
At session level using commit interval
The conditional transaction control expressions can be developed using
transaction controlled transformation at mapping level.
EX: -IIF (SAL > 3000, Commit, Rollback)
i)
TC_COMMIT_AFTER
ii)
TC_COMMIT_BEFORE
iii)
TC_ROLLBACK_AFTER
iv)
TC_ROLLBACk_BEFORE
INFORMATICA
The following are the constant can be used to write condition based
commits
The Transaction Controlled transformation is use to perform
condition based commits (or) User defined Commits.
The transactions can be controlled using commit interval property
which is defined as Session level.
A commit interval is a number of rows at which the Integration
Service applies a commit to the Target.
The default commit interval is 10,000 rows.
The following are the commits defined at session level
i)
Target based commit
ii)
User defined commit
iii)
Source based commit
The default commit type is Target based commit.
Target Based Commit: During Target Based commit Session the Integration Service
commits the Target based on the following factors
i)
Commit Interval: - It defines the number of rows at which
Integration Service applies the commit.
64
ii)
Writer Wait Timeout: The amount of time writer waits before it issues a commit.
Configure the write wait timeout in the Integration Service.
iii)
Buffer Blocks: Blocks of memory that holds rows of data during Session.
The Integration Service uses the following process to issue the
commit
i)
When the Integration service reaches a commit interval it
continues to fill the writer buffer block.
INFORMATICA
When you run the Target based commit session the Integration
Service may issue a commit BEFORE, ON and AFTER the given
commit interval.
When the writer buffer block fills the Integration Service issues
a commit.
ii)
If the writer buffer fills before the commit interval the
Integration Service writes the data to the Target but waits
to issue a commit.
The Integration Service issues the commit using writer wait
timeout.
Source Based Commit: The Integration Service commits the data to Target Based on
number of rows from Active Source (i.e., Source Qualifier)
Case: -1)
You have a Source Based commit session that passes 10,000
records from active source.
When the 10,000 records reach the Target the Integration Service
issues a commit.
If the Session completes successfully then Integration Service issues
a commit at 10,000, 20,000, and 30,000, so on.
Case: -2)
65
You have a Source Based commit session that passes 10,000
records from active source but 3,000 rows are dropped due to
Transformation Logic.
The Integration Service issues a commit to the Target when 7,000
remaining rows reach the Target.
Procedure: Create Source and Target definitions
Drop the source and Target definitions on work Space
Create the Transformation type Transaction Control
From Source qualifier copy the ports to Transaction controlled
transformation.
Transaction Attribute
Value
Transaction Control Condition
IIF (SAL>1500, TC_COMMIT_AFTER,
TC_ROLLBACK_AFTER)
INFORMATICA
Create a Mapping with the name M_USERDEFINED_COMMIT
Click on APPLY
Click on OK
From Transaction Controlled transformation connect the ports to the
Target
Create a Session with the name S_M_USERDEFINED_COMMIT
Set Writer and Reader connections
Create the Work Flow with the name W_S_M_USERDEFINED_COMMIT
Start Work Flow
Note: Target Based Commit session improves the session performance
then Source Based Commit Session.
66
Certification level Question: -
When you run the Source Based Commit Session the Integration
Service identifies the two Active Sources to issues the Commit.
For T1 Active Source is SQ_EMP and for T2 Active Source is
Aggregator transformation.
Normalizer transformation: -
INFORMATICA
Here we have two commit points, since T1 based on Active Source
SQ_EMP and T2 based on the Aggregator transformation.
This is of an Active Transformation which allows you to read the data
from Cobol Sources.
The Cobol Source definition associates with Normalizer
Transformation like Source Qualifier.
Use the Normalizer Transformation to perform Horizontal data pivot.
The data pivot is a process of converting a single input record into
multiple output records.
EX: - Pivoting data (setting a single record into multiple records)
Procedure: -
Creation of Source definition: Accounts.txt
67
Creation of Target definition: Create a Target definition with the name T_ACCOUNT
(YEAR, ACCOUNT, MONTH, AMOUNT)
Create a Mapping with the name M_DATE_POINT
Create the Transformation type Normalizer transformation
Double click on the Normalizer transformation and select Normalizer
Tab
COLUMN
NAME
OCCURS
DATA TYPE
PRECISION
SCALE
Year
Number
Account
String
10
Amount
Number
10
INFORMATICA
Drop the Source and Target definitions on Work Space
Click on APPLY
Click on OK
From Source qualifier connect the Ports to Normalizer transformation
From Normalizer transformation connect the Ports to Target
[GCID_AMOUNT Month]
GCID generated column ID
GK generated key
SEQUENCE GENERATOR TRANSFORMATION: This is of type a Passive transformation which generates Numeric
values.
The Numeric values are defined as Primary keys.
68
The Sequence generator transformation is created with the default
output ports
i)
NEXTVAL
ii)
CURRVAL
This Transformation does not support to edit the existing output
ports and does not support to create the new ports.
The Sequence generator transformation is used to implement ting
Slowly Changing Dimensions.
** Use the Nextval port to generate the sequence numbers by
connecting it to downstream Target (or) Target.
You connect the Nextval port to generate the sequence based on
current balance and Increment by properties.
INFORMATICA
Use the Sequence generator transformation to generate unique
primary keys that are used as Surrogate keys.
** Currval is NEXTVAL + INCREMANT BY Value
The following properties can be set to define the Sequence
generator
Current Value: It defines the current value of the sequence.
The Integration Service uses the current value as the basis to
generate the sequence values for each Session.
At the end of the each session the Integration Service updates the
current value to the current value to the last value generated for the
session +1.
End Value: The End value is the maximum value you want the Integration
Service generate.
If the Integration Service reaches the end value and Sequence
generator is not configure to cycle then session fails with an error
message (Over flow error).
Increment By: Difference between two consecutive values from Nextval port.
69
INFORMATICA
The Integration Service generates the sequence (Nextval) based on
current value and Increment by properties.
Cycle: Use cycle to generate repeating sequence such as numbers 1
through 12 to correspond months in a year.
If selected the Sequence generator returns to the start value when
the end value is required otherwise it stops.
Start Value: Start value after the generated sequence if you select cycle.
Reset: If reset is enable the Integration Service generates the values based
on original current values for each session.
Otherwise Integration Service updates the current value to the last
value generated +1.
Note: - The default value for a standard Sequence generator is zero for
number of cache values.
Cyclic Loading (Round Robin Loading): Exercise: First record to first Target, second record to second Target, third
record to third Target and fourth record to fourth Target and so on.
70
Procedure: Create Source definition and Target definitions
Create Transformation type Sequence generator
Transformation Value
Value
Start Value
Increment Value
Cyclic
Create the Transformation type Router
From Source qualifier copy the ports to the Router
INFORMATICA
Double click on Sequence generator and select the Properties Tab
From Sequence generator copy the Nextval port to the Router
Transformation
Double click on the Router Transformation and select the Groups Tab
Group Name
Group Filter Condition
T1
Nextval=1
T2
Nextval=2
T3
Nextval=3
Click on APPLY
Click on OK
From Repository Menu click on SAVE
Sequence Generation Blocks:
71
In Integration Service generates numbers in blocks (number of links
from sequence = number of blocks)
INFORMATICA
Integration Service generates the Single block which is copied to the
multiple targets using expression.
Design a Mapping which can pass Even number rows to one Target and
Odd number rows to one Target
72
Data flow diagram for generating sequence numbers without using
Sequence generator.
It is best to configure the Sequence generator transformation as
close to the Target as possible in a mapping otherwise a mapping will be
carrying sequence numbers through the transformation process which will
not be transformed.
UPDATE STRATEGY TRANSFORMATION: This is of type an Active transformation which flags the source
records for INSERT, UPDATE, DELETE and REJECT the rows to define data
driven operations.
INFORMATICA
Sequence Generator Transformation Performance
Optimization: -
An Update Strategy transformation functions as DML commands.
The Informatica Power Center supports two different ways to
implement an Update Strategy.
i)
Using Update Strategy transformation in mapping level.
ii)
Using Target treat source rows as property in Session level.
An Update Strategy transformation operator on Target database
account.
The Target table definition should required primary key to Update
and Delete records from Target.
An Update Strategy transformation is used in updating Slowly
Changing Dimensions.
Update Strategy in Mapping Level: When you want the Integration Service to perform multiple database
operations on Target then we use an Update Strategy transformation at
mapping level.
73
When we use a Update Strategy transformation in mapping the
Integration Servie follows the instructions coded in mapping.
When we use an Update Strategy transformation in mapping the
treat sources rows as property set as date driven as session level.
The conditional Update Strategy expressions can be developed
using an Update Strategy transformation with the following constraint.
DD_INSERT 0
ii.
DD_UPDATE 1
iii.
DD_DELETE 2
iv.
DD_REJECT 3
[DD Data Driven]
The default Update Strategy expression is DD_INSERT
Update Strategy in Session Level: -
INFORMATICA
i.
When you want the Integration Service to perform single database
operations only then we use treat sources rows as property to define
Update Strategy at Session Level.
Treat Source Rows As: INSERT: The Integration Service performs only insert operation in the Target
table.
Treat Source Rows As: UPDATE: The Integration Service performs only update to the target based on
primary key constraint.
Treat Source Rows As: DELETE: The Integration Service performs only delete operations on the
target based on key constraint.
Treat Source Rows As: DATA DRIVEN: The Integration Service follows the instructions coded in update
strategy transformation in mapping.
SLOWLY CHANGING DIMESION TYPE-1 IMPLIMENTATION:
74
A type-1 dimension captures only current changes.
INFORMATICA
It does not store any historical data.
Procedure: Create a Source definition with the name EMP
Create a Target definition with the name DIM_EMPOLYEE_TYPE1
(EMPKEY, EMPNO, ENAME, JOB, SAL, DEPTNO)
EMPKEY is the primary key (Alternate Key)
Create a Mapping with the name M_EMPLOYEE_TYPE1_DIM
Drop the Source definition on Work Space
Drop the Target definition with the two instances on Work Space
(DIM_EMPOLYEE_TYPE1 for Insert and DIM_EMPOLYEE_TYPE11 for
update)
Create Transformation type Lookup with the name LKP_Trgt
From Target select the table DIM_EMPOLYEE_TYPE1
Click on OK
75
From Source qualifier copy the port EMPNO to the Lookup
transformation
Double click on Lookup transformation and select Conditions Tab
Lookup Table column
Operator
Transformation Port
EMPNO
EMPNO1
Select Properties Tab
Transformation Attribute
Value
Connection Information
BATCH 10AM
INFORMATICA
From Toolbar click on ADD a new condition
Click on APPLY
Click on OK
Create Transformation type Expression
From Source qualifier copy the required ports to the Expression
transformation
From Lookup transformation copy the port EMPKEY to Expression
transformation
Double click on Expression transformation and select the Ports Tab
From Toolbar click on ADD a new port
Port Name
Data type
Expression
Insert_Flag
String
10
IIF (ISNULL (EMPKEY), TRUE,
FALSE)
Create the Transformation type Router
From Expression transformation copy all the ports to the Router
transformation
76
Double click on Router transformation and select the Groups Tab
From Toolbar click on ADD a new group
Group Name
Group Filter Condition
Insert_Flag
Insert_Flag = TRUE
Update_Flag
Update_Flag = FALSE
Click on OK
Insert Flow: Create Transformation type Sequence generator and Update
Strategy
INFORMATICA
Click on APPLY
From Router transformation, from Insert group copy the following to
Update Strategy (EMPNO1, ENAME1, JOB1, SAL1, and DEPTNO1)
Double click on Update Strategy transformation and select the
Properties Tab
Transformation Attribute
Value
Update Strategy Expression
DD_INSERT (or) 0
From Update Strategy transformation connect the Nextval port to
the Target
Update Flow: Create Transformation type Update Strategy
From Router transformation, from update group copy the following
to Update Strategy (EMPKEY3, EMPNO3, ENAME3, JOB3, SAL3, DEPTNO3)
Double click on Update Strategy transformation and select the
Properties Tab
Transformation Attribute
Value
77
Update Strategy Expression
DD_INSERT (or) 1
From Update Strategy transformation connect the Nextval port to
the Target
From Repository Menu click on SAVE
Create Session with the name S_M_EMPLOYEE_TYPE1_DIM
Create Work Flow with the name W_ S_M_EMPLOYEE_TYPE1_DIM
Mapping Logic: -
INFORMATICA
Start Work Flow
IMPLEMENTATION OF TYPE2: A type2 dimension stores historical changes in the Target.
For each update in the OLTP Source system is inserts a new record
in the Target.
The Informatica Power Center supports three different methods to
maintain history
i)
Keeping Primary Version number in a separate column
ii)
Mark the correct dimension record with the flag
iii)
Use an effective dates (Start date and end date)
78
Version Based History: Source definition: EMP
Target definition: DIM_EMPLOYEE_TYPE2
(EMPKEY, EMPNO, ENAME, JOB, SAL, DEPTNO, VERSION)
Create a Mapping with the name M_EMPLOYEE_TYPE2_DATA
Drop the Source definition on Work Space
Create Transformation type Lookup with the name LKP_TRG
Select the Target table DIM_EMPLOYEE_TYPE2
Click on OK
From Source Qualifier copy the Port EMPNO to the Lookup
transformation
INFORMATICA
Drop the Target definition with the two instances
Double click on Lookup transformation and select the Condition Tab
From Toolbar click on ADD a new Condition
Lookup Table Column
Operator
Transformation Port
EMPNO
EMPNO1
From Properties Tab
Transformation
Attribute
Lookup SQL
Override
Value
SELECT
OUT.EMPKEY AS EMPKEY,
OUT.EMPNO AS EMPNO,
OUT.ENAME AS ENAME,
OUT.JOB AS JOB,
OUT.SAL AS SAL,
OUT.DEPTNO AS DEPTNO,
79
OUT.VERSION AS VERSION
FROM DIM_EMPLOYEE_TYPE2 OUTWHERE
OUT.EMPKEY=
(SELECT MAX (INN.EMPKEY) FROM
DIM_EMPLOYEE_TYPE2
INN WHERE INN.EMPNO=OUT.EMPNO
BATCH10AMDB
INFORMATICA
Connection
Information
Click on APPLY
Click on OK
Create the Transformation type Expression
From Source Qualifier copy the required Ports to Expression
transformation
From Lookup transformation copy the following Ports to the
Expression transformation [EMPKEY, SAL, and VERSION]
Double click on Expression transformation
Select Ports Tab click on ADD a new Port
Port Name
Dataty
pe
Expression
INSERT_FLA
G
String
10
String
10
IIF (ISNULL (EMPKEY), TRUE,
FALSE)
UPDATE_FL
AG
IIF (NOT ISNULL (EMPKEY)
AND
(SAL!=SAL1), TRUE, FALSE)
Create the Transformation type Router
From Expression transformation copy the following Ports to the
Router transformation [EMPNO, ENAME, JOB, SAL, DEPTNO, VERSION,
INSERT_FLAG, UPDATE_FLAG]
Double click on Router transformation and select the Groups Tab
80
From Toolbar click on ADD a new Group
Group Name
Group Filter Condition
INSERT_FLAG
INSERT_FLAG=TRUE
UPDATE_FLAG
UPDATE_FLAG=TRUE
Insert Flag: -
From Router transformation, from Insert group copy the following
Ports to Expression transformation [EMPNO1, ENAME1, JOB1, SAL1, and
DEPTNO1]
Double click on Expression transformation select Ports Tab
From Toolbar click on ADD a new Port
Port Name
Dataty
pe
Expression
Version
Decim
al
INFORMATICA
Create the Transformation type Expression, Update Strategy and
Sequence Generator
Click on APPLY
Click on OK
From Expression transformation copy the Ports to Update Strategy
transformation and develop the following expression DD_INSERT
From Update Strategy transformation connect the Ports to the Target
definition
From Sequence Generator transformation connect the Nextval Port
to the Target definition (EMPKEY)
Update Flag as Insert: Create the Transformation type Expression, Update Strategy
From Router transformation, from Update group copy the following
Ports to Expression transformation [EMPNO3, ENAME3, JOB3, SAL3,
DEPTNO1 and VERSION3]
Double click on Expression transformation select Ports Tab
Uncheck the Output Port for a port name VERSION3
81
From Toolbar click on ADD a new Port
Port Name
Dataty
pe
Expression
Version
Decim
al
VERSION3+1
Click on APPLY
Click on OK
From Update Strategy transformation connect the Ports to the Target
definition
From Sequence Generator transformation connect the Nextval Port
to the Target definition (EMPKEY)
INFORMATICA
From Expression transformation copy the Ports to Update Strategy
transformation and develop the following expression DD_INSERT
Type2 SCD Version Based at Mapping Level: -
Type2 SCD Version Based at Session Level: -
SLOWLY CHANGING DIMENSION TYPE2 IMPLIEMENTION
USING START DATE and END DATE: Procedure: Create a Source definition with the name EMP
Create a Target definition with the name DIM_EMPLOYEE_TYPE2 with
the Ports
82
[EMPKEY, EMPNO, ENAME, JOB, SAL, DEPTNO, START_DATE,
END_DATE]
Create a Mapping with the name M_Type2_Data
Drop the Source definition on Work Space
Drop the Target definition with three instances on Work Space
o Employee_Type2 (New record to Insert)
o Employee_Type2 (1) (Updated record to Insert)
o Employee_Type2 (2) (Update End_Date)
INFORMATICA
Create the Transformation type Lookup
Enter the name LKP_TRG and click on CREATE
Select the Target table EMPLOYEE_TYPE2
Click on OK
Click on DONE
From Source Qualifier copy the Port EMPNO to the Lookup
transformation
Double click on Lookup transformation and select Conditions Tab
LOOKUP TABLE
COLUMN
OPERATOR
TRANSFORMATION
PORT
EMPNO
EMPNO1
Unwanted Ports can be deleted for best performance
Select the Properties Tab
TRANSFORMATION ATTRIBUTE
Lookup SQL Override
VALUE
SELECT
OUT.EMPKEY AS EMPKEY,
OUT.EMPNO AS EMPNO,
OUT.ENAME AS ENAME,
OUT.JOB AS JOB,
OUT.SAL AS SAL,
OUT.DEPTNO AS DEPTNO,
83
OUT.START_DATE AS START_DATE,
OUT.END_DATE AS END_DATE
FROM EMPLOYEE_TYPE2 OUTWHERE
OUT.EMPKEY=
(SELECT MAX (INN.EMPKEY) FROM
EMPLOYEE_TYPE2
Connection Information
BATCH10AMDB
Click on APPLY
Click on OK
INFORMATICA
INN WHERE
INN.EMPNO=OUT.EMPNO
Create the Transformation type Expression
From Source Qualifier copy the following Ports to the Expression
transformation
[EMPNO, ENAME, JOB, SAL, DEPTNO]
From Lookup transformation copy the following Ports to the
Expression transformation [EMPKEY and SAL]
Double click on Expression transformation and select the Ports Tab
From Toolbar click on ADD a new Port
Port Name
Dataty
pe
Expression
INSERT_FLA
G
String
10
String
10
IIF (ISNULL (EMPKEY), TRUE,
FALSE)
UPDATE_FL
AG
IIF (NOT ISNULL (EMPKEY)
AND
(SAL!=SAL1), TRUE, FALSE)
Click on APPLY
Click on OK
Create the Transformation type Router
84
From Expression transformation copy the following Ports to the
Router transformation [EMPNO, ENAME, JOB, SAL, DEPTNO, VERSION,
INSERT_FLAG, UPDATE_FLAG]
Double click on Router transformation and select the Groups Tab
Group Name
Group Filter Condition
INSERT_FLAG
INSERT_FLAG=TRUE
UPDATE_FLAG
UPDATE_FLAG=TRUE
Insert Flow for New Record: Create the Transformation type Expression, Update Strategy and
Sequence Generator
From Router transformation, from Insert group copy the following
Ports to Expression transformation [EMPNO1, ENAME1, JOB1, SAL1, and
DEPTNO1]
INFORMATICA
From Toolbar click on ADD a new Group
Double click on Expression transformation select Ports Tab
From Toolbar click on ADD a new Port
Port Name
Datatyp
e
Expression
Start_Date
Date/Ti
me
29
SYSDATE
Click on APPLY
Click on OK
From Expression transformation copy the Ports to Update Strategy
transformation
From Update Strategy transformation connect the Ports to the Target
definition
From Sequence Generator transformation connect the Nextval Port
to the Target definition (EMPKEY)
Update as Insert Flow: Create the Transformation type Expression, Update Strategy
85
From Router transformation, from Update group copy the following
Ports to Expression transformation [EMPNO3, ENAME3, JOB3, SAL3,
DEPTNO1 and VERSION3]
Double click on Expression transformation select Ports Tab
Port Name
Datatyp
e
Expression
Start_Date
Date/Ti
me
29
SYSDATE
Click on APPLY
Click on OK
From Expression transformation copy the Ports to Update Strategy
transformation
INFORMATICA
From Toolbar click on ADD a new Port
From Update Strategy transformation connect the Ports to the Target
definition
From Sequence Generator transformation connect the Nextval Port
to the Target definition (EMPKEY)
Updating End_Date: Create the Transformation type Expression, Update Strategy
From Router transformation, from Update group copy Port EMPKEY
to Expression transformation
Double click on Expression transformation select Ports Tab
From Toolbar click on ADD a new Port
Port Name
Datatyp
e
Expression
End_Date
Date/Ti
me
29
ADD_TO_DATE (SYSDATE, DD,
-1)
Click on APPLY
Click on OK
From Expression transformation copy the Ports to Update Strategy
transformation
86
Double click on Update Strategy transformation and select
Properties Tab
TRANSFORMATION ATTRIBUTE
VALUE
Update Strategy Expression
DD_UPDATE (or) 1
From Update Strategy transformation connect the Ports to the Target
definition
INFORMATICA
Data Flow Diagram: -
POWER CENTER ADVANCE: 1. Unconnected Stored Procedure
2. Unconnected Lookup
3. Maplets and Types of Maplets
4. Reusable Transformations
5. User Defined Functions
6. Constraint Based Load Order (CBL)
7. Target Load Plan
8. Task and Types of Tasks
9. Worklet and Types of Worklets
10.
Types of Batch Processings
11.
Define Link Conditions
12.
Scheduling Workflow
13.
Importing and Exporting a Reporting Objects
14.
PMCMD Utility
87
PMREP Utility
16.
Defining Mapping Parameters
17.
Mapping Variables to Perform Incremental Extraction
18.
Define Session Parameters
19.
Difference between Normal and Bulk Loading
20.
Session Recovery
21.
Push Down Optimization
22.
Aggregate Cache Incremental Aggregation
23.
Types of Lookup Caches
a. Static Lookup Cache
b. Dynamic Lookup Cache
INFORMATICA
15.
c. Persistence Lookup Cache
i.
Named Cache
ii.
Unnamed Cache
24.
Implementing Dynamic Lookup Cache SCD Type1
25.
Mapping Debugger
26.
ETL Unit Testing
27.
ETL Performance Optimization Techniques
28.
ETL Performance Testing
29.
Difference between Stop and Abort
30.
Difference between Shortcut and Copy
31.
Session Partitioning
32.
Metadata Versioning [Check In and Check Out]
UNCONNECTED STORED PROCEDURE: An Unconnected Stored Procedure is not part of mapping data flow
It is neither connected to the Source nor connected to the Target
88
An Unconnected Stored Procedure can receive the multiple inputs
ports but it returns a single output port
An Unconnected Stored Procedure can be used in any
transformation that supports to write Expressions
Here Integration Service will send records by creating an address to
Target but firstly it will load to Index table
INFORMATICA
An Expression can be developed using : SP identifier
Procedure: Create a Source definition with the name
Creation of Target definition: Open SQL PLUS, LOGON to user account BATCH10AM/TARGET
SQL> Create table EMP_TRGT as select * from SCOTT.EMP WHERE
1=2;
SQL> Select INDEX_NAME from USER_INDEXES WHERE TABLE_NAME
= EMP_TRGT;
SQL> Create Index EMP_IDX on EMP_TRGT (EMPNO);
Index Created;
Import the Target table using target designer tool
Create the following Stored Procedure in the account BATCH10AM
i)
Create (or) Replace procedure EMP_DROP_INEDEX
(
V_INEDX_NAME in Varchar2
)
AS
89
BEGIN
EXECUTE IMMEDIATE
Drop Index ||V_INDEX_NAME;
END;
/ (PRESS ENTER)
ii)
Create (or) Replace procedure EMP_CREATE_INEDEX
V_TABLE_NAME in Varchar2,
V_COL_NAME in Varchar2,
V_TABLE_NAME in Varchar2
)
INFORMATICA
AS
BEGIN
EXECUTE IMMEDIATE
Create Index ||V_INDEX_NAME|| ON ||V_TABLE_NAME||(||
V_COL_NAME||);
END;
/ (PRESS ENTER)
Create a Mapping with the name
M_EMPLOYEE_DROP_CREATE_INDEX
Drop the Source and Target definitions on Work Space
Create Transformation type Stored Procedure
Enter the name SP_DROP_INDEX which call the Procedure with the
name EMP_DROP_INDEX
Click on CREATE
Connect the database with the following details
90
ODBC Data Source: -BATCH10AM_ODBC (Oracle in
oracdblog_home1)
User name: - BATCH10AM
Owner name: - BATCH10AM
Password: - Target
Select the Procedure EMP_DROP_INDEX
Click on OK
Similarly create a Stored Procedure transformation with the name
SP_CREATE_INDEX which call the Procedure with the name EMP_
CREATE_INDEX
Double click on Stored Procedure transformation with the name
SP_DROP_INDEX
INFORMATICA
Click on DONE
Select the Properties Tab
TRANSFORMATION ATTRIBUTE
VALUE
Stored Procedure Type
Target Pre Load
Call Text
EMP_DROP_INDEX (EMP_IDX)
Connection Information
BATCH10AMDB
Click on APPLY
Click on OK
Double click on Stored Procedure Transformation with the name
SP_CREATE_INDEX
Select the Properties Tab
TRANSFORMATION
ATTRIBUTE
VALUE
Stored Procedure
Type
Target Post Load
Call Text
EMP_CREATE_INDEX (EMP_TRGT, EMPNO,
EMP_IDX)
91
Connection
Information
BATCH10AMDB
Click on APPLY
Click on OK
From Repository Menu click on SAVE
Create Session with the name S_M_
EMPLOYEE_DROP_CREATE_INDEX
Create Workflow with the name W_S_M_
EMPLOYEE_DROP_CREATE_INDEX
Start the Workflow
Unconnected Stored Procedure to Written Multiple
Output Ports: -
INFORMATICA
Set the Reader and Writer connections
Create the following Procedure in the user account SCOTT
Create (or) Replace procedure EMP_SP
(
V_EMPNO IN NUMBER,
TOTSAL OUT NUMBER,
TAX OUT NUMBER,
HRA OUT NUMBER
)
IS
BEGIN
SELECT SAL+NVL (COMM,0).SAL*0.1, SAL*0.4
INTO
TOTSAL, TAX, HRA
FROM EMP
WHERE EMPNO=V_EMPNO;
END;
92
/ (PRESS ENTER)
Create a Source definition with the name EMP
Create a Target definition with the name EMP_USP
[TOTSAL, TAX, HRA, EMPNO, ENAME, JOB, SAL, DEPTNO]
Create a Mapping with the name M_UNCONNECTED_PROC
Drop the Source and Target definitions on Work Space
Create the Transformation type Stored Procedure and Expression
Double click on Expression transformation, select the Ports Tab
From Toolbar click on ADD a new Port
PORT
NAME
DATA TYPE
EXPRESION
V_TAX
Decimal
V_TAX
V_HRA
Decimal
V_HRA
TOTAL SAL
Decimal
TAX
Decimal
:SP.USP (EMPNO,PROC_RESULT,
V_TAX, V_HRA)
HRA
Decimal
INFORMATICA
From Source Qualifier copy the required ports to Expression
transformation
V_TAX
V_HRA
Click on APPLY
Click on OK
From Expression transformation connect the required Ports to the
Target
From Repository Menu click on SAVE
UNCONNECTED LOOKUP: An Unconnected Lookup is not part of mapping dataflow
It is neither connected to the Source nor connected to the Target
An Unconnected Lookup can receive multiple Input Ports but it
returns a single output port which is designated as Return Port (R)
*An Unconnected Lookup is commonly used when the Lookup is not
need for every record
93
The Lookup function can be set within any Transformation that
supports Expression
The Unconnected Lookup Transformation is called using following
Expression
: LKP.LOOKUP_NAME
Use the Lookup function within a conditional statement (IIF)
The condition is evaluated for each row but the Lookup function is
only called if the condition evaluate to TRUE
Connected Lookup
i)
Part of Mapping data
flow
ii)
Returns multiple
values (by linking
output ports to
another
transformation)
iii)
Executed for every
record passing
through the
transformation
iv)
v)
More visible, shows
where the lookup
values are used
Unconnected Lookup
i)
ii)
iii)
Separate from Mapping
data flow
Returns one value by
checking the Return (R)
Port option for the out Port
that provides the return
value
INFORMATICA
Differences between Connected and Unconnected Lookup: -
Only executed when the
Lookup function is called
iv)
Less visible, as the lookup
is called from an
expression within another
transformation
v)
Default values are ignored
Default values are
used
BUSINESS PURPOSE: A Source table (or) File may have a percentage of records with
incomplete data. The holes in the data can be filled by performing a
lookup to another table (or) tables. As only a percentage of the rows are
affected it is better to perform the lookup on only those rows that need it
and not the entire data set.
LOOKUP TRANSFORMATION- KEY POINTS: **Connected Lookup: -
94
When there is no match in the Lookup then the Integration Service
returns the default value provided, if there is no default value then it
returns a NULL value.
Unconnected Lookup: When there is no match in the Lookup then the Integration Service
returns a NULL values (Ignores default value)
Procedure: Create a Source definition with the name EMP
[EMPNO, ENAME, JOB, SAL, COMM, DEPTNO]
Create a Mapping with the name M_EMPLOYEE_UNCONNECTED_LKP
Drop the Source and Target definitions on Work Space
INFORMATICA
Create a Target definition with the name EMP_LKP
Create Transformation type Lookup with the name LKP_EMP
Select the Source table EMP
Click on OK
Double click on Lookup Transformation and select Ports Tab
Delete the following Ports
[ENAME, JOB, MGR, HIREDATE, COMM, DEPTNO]
From Toolbar click on ADD a new Port
PORT NAME
DATA TYPE
IN_EMPNO
Decimal
For a Port name SAL select Return Port (R)
Select Condition Tab and click on ADD a new condition
LOOKUP TABLE
CONDITION
OPERATOR
TRANSFORMATION
PORT
EMPNO
IN_EMP
Select Properties Tab
TRANSFORMATION ATTRIBUTE
VALUE
95
Connection Information
SCOTTDB
Click on APPLY
Click on OK
Create the Transformation type Expression
From Source Qualifier copy the following Ports to the Expression
Transformation
[EMPNO, ENAME, JOB, SAL, COMM, DEPTNO]
Uncheck the Output Port for a Port name COMM
From Toolbar click on ADD a new Port
Port Name
Dataty
pe
Expression
O_COMM
Decim
al
IIF (ISNULL (COMM), :
LKP.LKP_EMP (EMPNO), COMM)
INFORMATICA
Double click on Expression Transformation and select Ports Tab
Click on APPLY
Click on OK
From Expression Transformation connect Ports to the Target
From Repository Menu click on SAVE
MAPPLET AND TYPES OF MAPPLETS: A Mapplet is a reusable object create with business logic using set of
transformations
A Mapplet is created using mapplet designer tool in the designer
client component
There are two types of Mapplets
i)
Active Mapplet: A Mapplet which is created with at least one active
transformation is known as Active Mapplet
ii)
Passive Mapplet: -
96
A Mapplet which is created with only passive transformation is
known as Passive Mapplet
Mapplet Limitations: -
i)
When you want to use the Stored Procedure transformation you
should use the Stored Procedure transformation with the type
Normal
ii)
When you want to use the Sequence Generator transformation
you should use reusable Sequence Generator transformation
iii)
The following objects cannot be used while creating Mapplets
1) Normalizer transformation
2) XML Source Qualifier transformation
3) Pre (or) Post Stored Procedure transformation
INFORMATICA
Keep the following instructions while creating the mapplet
4) Mapplet [Nested mapplet cannot be created]
Mapplet Creation: From Tools menu select Mapplet designer
From Mapplets menu select CREATE
Enter the Mapplet name MT_TAX_CALCULATION
Click on OK
From Transformation Menu select CREATE
Select the Transformation type Mapplet Input
Enter the name
Click on CREATE
Click on DONE
Similarly create Mapplet Output Transformation
Create the Transformation type Filter, Expression and Sorter
Double click on Mapplet Input transformation, select Ports Tab
From Toolbar click on ADD a new Port
97
Port Name
EMPNO
ENAME
JOB
SAL
COMM
DEPTNO
Click on APPLY
From Mapplet Input connect the Ports to the Filter transformation
and develop the following Filter transformation
Double click on Filter transformation, select Properties Tab
ATTRIBUTE
VALUE
Filter Condition
IIF (ISNULL (COMM), TRUE, FALSE)
INFORMATICA
Click on OK
From Filter transformation copy the required ports to the Expression
transformation
Double click on Expression transformation, select the Properties Tab
PORT
NAME
TOTALSAL
TAX
DATA
TYPE
Decimal
Decimal
EXPRESSION
7
7
2
2
V
-
SAL+ COMM
IIF (TOTAL SAL>3000,
TOTAL SAL*0.25, TOTAL
SAL*0.15)
Click on APPLY
Click on OK
From Expression transformation copy the Ports to the Sorter
transformation
Define the KEY on Port name TAX
From Sorter transformation copy the port to Mapplet Output
Mapping with Mapplet: Create Source and Target definitions
Create a Mapping with the name M_Mapplet
98
Drop the Source and Target definitions on Work Space
From Mapplet sub folder drop the Mapplet on Work Space
From Source Qualifier connect Ports to Mapplet Input
From Mapplet Output connect the Ports to the Target
From Repository Menu click on SAVE
REUSABLE TRANSFORMATION: -
There are two ways to create a Reusable transformation
i)
Converting a Non-reusable transformation into a Reusable
transformation
ii)
Using transformation developer tool
INFORMATICA
A Reusable transformation is a reusable object created with
business logic using Single Transformation
Limitation: The Source Qualifier transformation can be defined as Reusable
transformation
Method-1: Converting Non-reusable transformation into Reusable
transformation
Procedure: In Mapping select the Transformation which you want to reuse
Double click on that Transformation
From Transformation Tab select make Reusable
Click on YES
Click on APPLY
Click on OK
From Repository Menu click on SAVE
NOTE: -
99
The default value for number of cached values property is zero for a
Standard Sequence Generator Transformation
For a Reusable Sequence Generator the default value for number of
cached value property is 1,000
Method-2: USING TRANSFORMATION DEVELOPER TOOL: From Tools Menu select Transformation developer
Select the Transformation type Sequence Generator, Enter the NAME
Click on CREATE
Click on DONE
INFORMATICA
From Transformation Menu select CREATE
100