Datawarehouse Interview Quesion and Answers
Datawarehouse Interview Quesion and Answers
Datawarehouse Interview Quesion and Answers
Data warehouse is a Subject oriented, Integrated, Time variant, Non volatile collection of
data in support of management's decision making process.
Subject Oriented This means a data warehouse has a defined scope and it only stores data
under that scope. So for example, if the sales team of your company is creating a data warehouse
- the data warehouse by definition is required to contain data related to sales (and not the data
related to production management for example)
Non-volatile This means that data once stored in the data warehouse are not removed or deleted
from it and always stay there no matter what.
Integrated This means that the data stored in a data warehouse make sense. Fact and figures are
related to each other and they are integrable and projects a single point of truth.
Time variant This means that data is not constant, as new and new data gets loaded in the
warehouse, data warehouse also grows in size.
Data mining
Data mining is sorting through data to identify patterns and establish relationships.
Data mining parameters include:
Association - looking for patterns where one event is connected to another event
Sequence or path analysis - looking for patterns where one event leads to another later
event
Classification - looking for new patterns (May result in a change in the way the data is
organized but that's ok)
Clustering - finding and visually documenting groups of facts not previously known
Forecasting - discovering patterns in data that can lead to reasonable predictions about the
future (This area of data mining is known as predictive analytics.)
Data mining techniques are used in a many research areas, including mathematics, cybernetics,
genetics and marketing. Web mining, a type of data mining used in customer relationship
management (CRM), takes advantage of the huge amount of information gathered by a Web site
to look for patterns in user behavior.
Datamart
Data marts are generally designed for a single subject area
Dimension
conformed dimensions - a dimension that has exactly the same meaning and content when
Subject Oriented
Data warehouses are designed to help you analyze data. For example, to learn more about
your company's sales data, you can build a warehouse that concentrates on sales. Using this
warehouse, you can answer questions like "Who was our best customer for this item last year?"
This ability to define a data warehouse by subject matter, sales in this case makes the data
warehouse subject oriented.
Integrated
Integration is closely related to subject orientation. Data warehouses must put data from
disparate sources into a consistent format. They must resolve such problems as naming
conflicts and inconsistencies among units of measure. When they achieve this, they are said to be
integrated.
Nonvolatile
Nonvolatile means that, once entered into the warehouse, data should not change. This
is logical because the purpose of a warehouse is to enable you to analyze what has occurred.
Time Variant
In order to discover trends in business, analysts need large amounts of data. This is very
much in contrast to online transaction processing (OLTP) systems, where performance
requirements demand that historical data be moved to an archive. A data warehouse's focus on
change over time is what is meant by the term time variant.
How many stages in Datawarehousing?
Data warehouse generally includes two stages
ETL
Report Generation
ETL
Short for extract, transform, load, three database functions that are combined into one tool
Extract -- the process of reading data from a source database.
Transform -- the process of converting the extracted data from its previous form into required
form
Load -- the process of writing the data into the target database.
ETL is used to migrate data from one database to another, to form data marts and data
warehouses and also to convert databases from one format to another format.
It is used to retrieve the data from various operational databases and is transformed into useful
information and finally loaded into Datawarehousing system.
1
2
3
4
5
INFORMATICA
ABINITO
DATASTAGE
BODI
ORACLE WAREHOUSE BUILDERS
Report generation
In report generation, OLAP is used (i.e.) online analytical processing. It is a set of specification
which allows the client applications in retrieving the data for analytical processing.
It is a specialized tool that sits between a database and user in order to provide various analyses
of the data stored in the database.
OLAP Tool is a reporting tool which generates the reports that are useful for Decision support for
top level management.
Business Objects
Cognos
Micro strategy
Hyperion
Oracle Express
Microsoft Analysis Services
OLTP
Application Oriented (e.g., purchase order it
is functionality of an application)
OLAP
Subject Oriented (subject in the sense
customer, product, item, time)
Detailed data
Summarized data
Repetitive access
Ad-hoc access
simple query
Small database
Large Database
Current data
Historical data
Clerical User
Knowledge User
Bulk Loading
10
Time invariant
Time variant
11
Normalized data
De-normalized data
12
E R schema
Star schema
ETL
Data mart
ETL
DWH
DWH
OLAP
Top down
OLTP
Data mart
OLAP
Top down
Cost of initial planning & design is high
Takes longer duration of more than an year
Bottom up
Planning & Designing the Data Marts without waiting for the Global warehouse design
Immediate results from the data marts
Tends to take less time to implement
Errors in critical modules are detected earlier.
Benefits are realized in the early phases.
It is a Best Approach
Data
Modeling Types:
Conceptual Data Modeling
Logical Data Modeling
Physical Data Modeling
Dimensional Data Modeling
Entity
Table
Attribute
Column
Primary Key
Alternate Key
Rule
Relationship
Foreign Key
Definition
Comment
of Dimensional modeling
Star schema
Snow flake schema
Star flake schema (or) Hybrid schema
Multi star schema
Data
Staging area needs to clean operational data before loading into data warehouse.
Cleaning in the sense your merging data which comes from different source.
Its the area where most of the ETL is done
Cleansing
It is used to remove duplications
It is used to correct wrong email addresses
It is used to identify missing data
It used to convert the data types
It is used to capitalize name & addresses.
Types of Dimensions:
Confirmed Dimensions
Junk Dimensions Garbage Dimension
Degenerative Dimensions
Slowly changing Dimensions
Confirmed is something which can be shared by multiple Fact Tables or multiple Data Marts.
Junk Dimensions is grouping flagged values
Degenerative Dimension is something dimensional in nature but exist fact table.(Invoice
No).Which is neither fact nor strictly dimension attributes. These are useful for some kind
of analysis. These are kept as attributes in fact table called degenerated dimension
For ex, we have a fact table with customer_id, product_id, branch_id, employee_id, bill_no, and
date in key section and price, quantity, amount in measure section. In this fact table, bill_no from
key section is a single value; it has no associated dimension table. Instead of creating a Separate
dimension table for that single value, we can Include it in fact table to improve performance. SO
here the column, bill_no is a degenerate dimension or line item dimension.
Informatica Architecture
Q. How can you define a transformation? What are different types of transformations
available in Informatica?
A. A transformation is a repository object that generates, modifies, or passes data. The Designer
provides a set of transformations that perform specific functions. For example, an Aggregator
transformation performs calculations on groups of data. Below are the various transformations
available in Informatica:
Aggregator
Custom
Expression
External Procedure
Filter
Input
Joiner
Lookup
Normalizer
Rank
Router
Sequence Generator
Sorter
Source Qualifier
Stored Procedure
Transaction Control
Union
Update Strategy
XML Generator
XML Parser
XML Source Qualifier
Q. What is a source qualifier? What is meant by Query Override?
A. Source Qualifier represents the rows that the PowerCenter Server reads from a relational or flat
file source when it runs a session. When a relational or a flat file source definition is added to a
mapping, it is connected to a Source Qualifier transformation.
PowerCenter Server generates a query for each Source Qualifier Transformation whenever it runs
the session. The default query is SELET statement containing all the source columns. Source
Qualifier has capability to override this default query by changing the default settings of the
transformation properties. The list of selected ports or the order they appear in the default query
should not be changed in overridden query.
Q. What is aggregator transformation?
A. The Aggregator transformation allows performing aggregate calculations, such as averages and
sums. Unlike Expression Transformation, the Aggregator transformation can only be used to
perform calculations on groups. The Expression transformation permits calculations on a rowbyrow basis only.
Aggregator Transformation contains group by ports that indicate how to group the data. While
grouping the data, the aggregator transformation outputs the last row of each group unless
Q. What is update strategy and what are the options for update strategy?
A. Informatica processes the source data row-by-row. By default every row is marked to be inserted
in the target table. If the row has to be updated/inserted based on some logic Update Strategy
transformation is used. The condition can be specified in Update Strategy to mark the processed
row for update or insert.
Following options are available for update strategy:
DD_INSERT: If this is used the Update Strategy flags the row for insertion. Equivalent numeric
value of DD_INSERT is 0.
DD_UPDATE: If this is used the Update Strategy flags the row for update. Equivalent numeric
value of DD_UPDATE is 1.
DD_DELETE: If this is used the Update Strategy flags the row for deletion. Equivalent numeric
value of DD_DELETE is 2.
DD_REJECT: If this is used the Update Strategy flags the row for rejection. Equivalent numeric
value of DD_REJECT is 3.
Local Repository: Local repository is within a domain and its not a global repository. Local
repository can connect to a global repository using global shortcuts and can use objects in its
shared folders.
Versioned Repository: This can either be local or global repository but it allows version control
for the repository. A versioned repository can store multiple copies, or versions of an object. This
feature allows efficiently developing, testing and deploying metadata in the production
environment.
Q. What is a code page?
A. A code page contains encoding to specify characters in a set of one or more languages. The
code page is selected based on source of the data. For example if source contains Japanese text
then the code page should be selected to support Japanese text.
When a code page is chosen, the program or application for which the code page is set, refers to a
specific set of data that describes the characters the application recognizes. This influences the
way that application stores, receives, and sends character data.
Q. Which all databases PowerCenter Server on Windows can connect to?
A. PowerCenter Server on Windows can connect to following databases:
IBM DB2
Informix
Microsoft Access
Microsoft Excel
Microsoft SQL Server
Oracle
Sybase
Teradata
Q. Which all databases PowerCenter Server on UNIX can connect to?
A. PowerCenter Server on UNIX can connect to following databases:
IBM DB2
Informix
Oracle
Sybase
Teradata
Q. How to execute PL/SQL script from Informatica mapping?
A. Stored Procedure (SP) transformation can be used to execute PL/SQL Scripts. In SP
Transformation PL/SQL procedure name can be specified. Whenever the session is executed, the
session will call the pl/sql procedure.
Batches - It Provides A Way to Group Sessions For Either Serial Or Parallel Execution By The
Informatica Server. There Are Two Types Of Batches:
1. Sequential - Run Session One after the Other.
2. Concurrent - Run Session At The Same Time.
Q. How many ways you can update a relational source definition and what
are they?
A. Two ways
1. Edit the definition
2. Reimport the definition
Q. What is a transformation?
A. It is a repository object that generates, modifies or passes data.
Q. What are the designer tools for creating transformations?
A. Mapping designer
Transformation developer
Mapplet designer
Q. In how many ways can you create ports?
A. Two ways
1. Drag the port from another transformation
2. Click the add button on the ports tab.
Q. What are reusable transformations?
A. A transformation that can be reused is called a reusable transformation
They can be created using two methods:
1. Using transformation developer
2. Create normal one and promote it to reusable
Q. Is aggregate cache in aggregator transformation?
A. The aggregator stores data in the aggregate cache until it completes aggregate calculations.
When u run a session that uses an aggregator transformation, the Informatica server creates index
and data caches in memory to process the transformation. If the Informatica server requires more
space, it stores overflow values in cache files.
Q. What r the settings that u use to configure the joiner transformation?
Type of join
4. Verbose Data: Along with verbose initialization records each and every record processed by
the informatica server.
Q. Types of Dimensions?
A dimension table consists of the attributes about the facts. Dimensions store the textual
descriptions of the business.
Conformed Dimension:
Conformed dimensions mean the exact same thing with every possible fact table to which they are
joined.
Eg: The date dimension table connected to the sales facts is identical to the date dimension
connected to the inventory facts.
Junk Dimension:
A junk dimension is a collection of random transactional codes flags and/or text attributes that are
unrelated to any particular dimension. The junk dimension is simply a structure that provides a
convenient place to store the junk attributes.
Eg: Assume that we have a gender dimension and marital status dimension. In the fact table we
need to maintain two keys referring to these dimensions. Instead of that create a junk dimension
which has all the combinations of gender and marital status (cross join gender and marital status
table and create a junk table). Now we can maintain only one key in the fact table.
Degenerated Dimension:
A degenerate dimension is a dimension which is derived from the fact table and doesnt have its
own dimension table.
Eg: A transactional code in a fact table.
Slowly changing dimension:
Slowly changing dimensions are dimension tables that have slowly increasing
data as well as updates to existing data.
Q. What are the output files that the Informatica server creates during the
session running?
Informatica server log: Informatica server (on UNIX) creates a log for all status and
error messages (default name: pm.server.log). It also creates an error log for error
messages. These files will be created in Informatica home directory
Session log file: Informatica server creates session log file for each session. It writes
information about session into log files such as initialization process, creation of sql
commands for reader and writer threads, errors encountered and load summary. The
amount of detail in session log file depends on the tracing level that you set.
Session detail file: This file contains load statistics for each target in mapping.
Session detail includes information such as table name, number of rows written or
rejected. You can view this file by double clicking on the session in monitor window.
Performance detail file: This file contains information known as session performance
details which helps you where performance can be improved. To generate this file
select the performance detail option in the session property sheet.
Reject file: This file contains the rows of data that the writer does not write to
targets.
Control file: Informatica server creates control file and a target file when you run a
session that uses the external loader. The control file contains the information about
the target flat file such as data format and loading instructions for the external
loader.
Post session email: Post session email allows you to automatically communicate
information about a session run to designated recipients. You can create two
different messages. One if the session completed successfully the other if the session
fails.
Indicator file: If you use the flat file as a target, you can configure the Informatica
server to create indicator file. For each target row, the indicator file contains a
number to indicate whether the row was marked for insert, update, delete or reject.
Output file: If session writes to a target file, the Informatica server creates the
target file based on file properties entered in the session property sheet.
Cache files: When the Informatica server creates memory cache it also creates cache
files.
For the following circumstances Informatica server creates index and data cache
files:
Aggregator transformation
Joiner transformation
Rank transformation
Lookup transformation
Q. What is meant by lookup caches?
A. The Informatica server builds a cache in memory when it processes the first row
of a data in a cached look up transformation. It allocates memory for the cache
based on the amount you configure in the transformation or session properties. The
Informatica server stores condition values in the index cache and output values in
the data cache.
Q. How do you identify existing rows of data in the target table using lookup
transformation?
A. There are two ways to lookup the target table to verify a row exists or not :
1. Use connect dynamic cache lookup and then check the values of NewLookuprow
Output port to decide whether the incoming record already exists in the table / cache
or not.
2. Use Unconnected lookup and call it from an expression transformation and check
the Lookup condition port value (Null/ Not Null) to decide whether the incoming
record already exists in the table or not.
Q. What are Aggregate tables?
Aggregate table contains the summary of existing warehouse data which is grouped to certain
levels of dimensions. Retrieving the required data from the actual table, which have millions of
records will take more time and also affects the server performance. To avoid this we can
aggregate the table to certain required level and can use it. This tables reduces the load in the
database server and increases the performance of the query and can retrieve the result very
fastly.
Q. What is a level of Granularity of a fact table?
Level of granularity means level of detail that you put into the fact table in a data warehouse. For
example: Based on design you can decide to put the sales data in each transaction. Now, level of
granularity would mean what detail you are willing to put for each transactional fact. Product sales
with respect to each minute or you want to aggregate it upto minute and put that data.
Q. What is session?
A session is a set of instructions to move data from sources to targets.
Q. What is worklet?
Worklet are objects that represent a set of workflow tasks that allow to reuse a set of workflow
logic in several window.
Use of Worklet: You can bind many of the tasks in one place so that they can easily get identified
and also they can be of a specific purpose.
Q. What is workflow?
A workflow is a set of instructions that tells the Informatica server how to execute the tasks.
Q. Why cannot we use sorted input option for incremental aggregation?
In incremental aggregation, the aggregate calculations are stored in historical cache on the server.
In this historical cache the data need not be in sorted order. If you give sorted input, the records
come as presorted for that particular run but in the historical cache the data may not be in the
sorted order. That is why this option is not allowed.
Q. What is target load order plan?
You specify the target loadorder based on source qualifiers in a mapping. If you have the multiple
source qualifiers connected to the multiple targets, you can designate the order in which
informatica server loads data into the targets.
The Target load Plan defines the order in which data extract from source qualifier transformation.
In Mappings (tab) Target Load Order Plan
Q. What is constraint based loading?
Constraint based load order defines the order of loading the data into the multiple targets based
on primary and foreign keys constraints.
Set the option is: Double click the session
Configure Object > check the Constraint Based Loading
Q. What is the status code in stored procedure transformation?
Status code provides error handling for the informatica server during the session. The stored
procedure issues a status code that notifies whether or not stored procedure completed
successfully. This value cannot see by the user. It only used by the informatica server to determine
whether to continue running the session or stop.
Q. Define Informatica Repository?
The Informatica repository is a relational database that stores information, or metadata, used by
the Informatica Server and Client tools. Metadata can include information such as mappings
describing how to transform source data, sessions indicating when you want the Informatica
Server to perform the transformations, and connect strings for sources and targets.
The repository also stores administrative information such as usernames and passwords,
permissions and privileges, and product version.
Use repository manager to create the repository. The Repository Manager connects to the
repository database and runs the code needed to create the repository tables. These tables stores
metadata in specific format the informatica server, client tools use.
Q. What is a metadata?
Designing a data mart involves writing and storing a complex set of instructions. You need to know
where to get data (sources), how to change it, and where to write the information (targets).
PowerMart and PowerCenter call this set of instructions metadata. Each piece of metadata (for
example, the description of a source table in an operational database) can contain comments
about it.
In summary, Metadata can include information such as mappings describing how to transform
source data, sessions indicating when you want the Informatica Server to perform the
transformations, and connect strings for sources and targets.
Database Connections
Global Objects
Multidimensional Metadata
Reusable Transformations
Short cuts
Transformations
Q. How can we store previous session logs?
WKFL_RUN_ID
WKFL_NME
START_TMST
END_TMST
ROW_INSERT_CNT
ROW_UPDATE_CNT
ROW_DELETE_CNT
ROW_REJECT_CNT
Q. If session fails after loading 10000 records in the target, how can we load 10001th
record when we run the session in the next time?
Select the Recovery Strategy in session properties as Resume from the last check point.
Note Set this property before running the session
Q. Informatica Reject File How to identify rejection reason
D - Valid data or Good Data. Writer passes it to the target database. The target accepts it
unless a database error occurs, such as finding a duplicate key while inserting.
O - Overflowed Numeric Data. Numeric data exceeded the specified precision or scale for the
column. Bad data, if you configured the mapping target to reject overflow or truncated data.
N - Null Value. The column contains a null value. Good data. Writer passes it to the target, which
rejects it if the target database does not accept null values.
T - Truncated String Data. String data exceeded a specified precision for the column, so the
Integration Service truncated it. Bad data, if you configured the mapping target to reject overflow
or truncated data.
Also to be noted that the second column contains column indicator flag value D which signifies
that the Row Indicator is valid.
Now let us see how Data in a Bad File looks like:
0,D,7,D,John,D,5000.375,O,,N,BrickLand Road Singapore,T
Q. What is Insert Else Update and Update Else Insert?
These options are used when dynamic cache is enabled.
Insert Else Update option applies to rows entering the lookup transformation with the row
type of insert. When this option is enabled the integration service inserts new rows in the cache
and updates existing rows. When disabled, the Integration Service does not update existing rows.
Update Else Insert option applies to rows entering the lookup transformation with the row
type of update. When this option is enabled, the Integration Service updates existing rows, and
inserts a new row if it is new. When disabled, the Integration Service does not insert new rows.
Source-based commit. The Informatica Server commits data based on the number of
source rows. The commit point is the commit interval you configure in the session properties.
Target-based commit. The Informatica Server commits data based on the number of
target rows and the key constraints on the target table. The commit point also depends on the
buffer block size and the commit interval.
Q. How to add source flat file header into target file?
Edit Task-->Mapping-->Target-->Header Options--> Output field names
Q. How to load name of the file into relation target?
Source Definition-->Properties-->Add currently processed file name port
Q. What is Factless fact table? In which purpose we are using this in our DWH projects?
Plz give me the proper answer?
It is a fact table which does not contain any measurable data.
EX: Student attendance fact (it contains only Boolean values, whether student attended class or
not ? Yes or No.)
A Factless fact table contains only the keys but there is no measures or in other way we can say
that it contains no facts. Generally it is used to integrate the fact tables
Factless fact table contains only foreign keys. We can have two kinds of aggregate functions from
the factless fact one is count and other is distinct count.
Q. What is use of batch file in informatica? How many types of batch file in informatica?
With the batch file, we can run sessions either in sequential or in concurrently.
Grouping of Sessions is known as Batch.
Two types of batches:
1)Sequential: Runs Sessions one after another.
If u have sessions with source-target dependencies u have to go for sequential batch to start the
sessions one after another. If u have several independent sessions u can use concurrent batches
Which run all the sessions at the same time
Q. What is joiner cache?
When we use the joiner transformation an integration service maintains the cache, all the records
are stored in joiner cache. Joiner caches have 2 types of cache 1.Index cache 2. Joiner cache.
Index cache stores all the port values which are participated in the join condition and data cache
have stored all ports which are not participated in the join condition.
Q. What is the location of parameter file in Informatica?
$PMBWPARAM
Q. How can you display only hidden files in UNIX
$ ls -la
total 16
8 drwxrwxrwx 2 zzz yyy 4096 Apr 26 12:00 ./
8 drwxrwxrwx 9 zzz yyy 4096 Jul 31 16:59 ../
Correct answer is
ls -a|grep "^\."
$ls -a
Q. How to delete the data in the target table after loaded.
SQ---> Properties tab-->Post SQL
delete from target_tablename
SQL statements executed using the source database connection, after a pipeline is run write post
sql in target table as truncate table name. we have the property in session truncate option.
Q. What is polling in informatica?
It displays the updated information about the session in the monitor window. The monitor window
displays the status of each session when you poll the Informatica server.
Q. How i will stop my workflow after 10 errors
Session level property error handling mention condition stop on errors: 10
--->Config object > Error Handling > Stop on errors
Q. How can we calculate fact table size?
A joiner Transformation is used to join data from hertogenous database ie (Sql database and flat
file) where has Union transformation is used to join data from
the same relational sources.....(oracle table and another Oracle table)
Join Transformation combines data record horizontally based on join condition.
And combine data from two different sources having different metadata.
Join transformation supports heterogeneous, homogeneous data source.
Union Transformation combines data record vertically from multiple sources, having same
metadata.
Union transformation also support heterogeneous data source.
Union transformation functions as UNION ALL set operator.
Q. What is constraint based loading exactly? And how to do this? I think it is when we
have primary key-foreign key relationship. Is it correct?
Constraint Based Load order defines load the data into multiple targets depend on the primary key
foreign key relation.
set the option is: Double click the session
Configure Object check the Constraint Based Loading
Q. Difference between top down(w.h inmon)and bottom up(ralph kimball)approach?
Top Down approach:As per W.H.INWON, first we need to build the Data warehouse after that we need to build up the
DataMart but this is so what difficult to maintain the DWH.
Bottom up approach;As per Ralph Kimbal, first we need to build up the Data Marts then we need to build up the
Datawarehouse..
this approach is most useful in real time while creating the Data warehouse.
Q. What are the different caches used in informatica?
Static cache
Dynamic cache
Shared cache
Persistent cache
Q. What is the command to get the list of files in a directory in unix?
$ls -lrt
Q. How to import multiple flat files in to single target where there is no common
column in the flat files
in workflow session properties in Mapping tab in properties choose Source filetype - Indirect
Give the Source filename : <file_path>
This <file_path> file should contain all the multiple files which you want to Load
Q. How to connect two or more table with single source qualifier?
Create a Oracle source with how much ever column you want and write the join query in SQL
query override. But the column order and data type should be same as in the SQL query.
4. Session
5. System
Q. What is incremental aggregation?
When the aggregator transformation executes all the output data will get stored in the temporary
location called aggregator cache. When the next time the mapping runs the aggregator
transformation runs for the new records loaded after the first run. These output values will get
incremented with the values in the aggregator cache. This is called incremental aggregation. By
this way we can improve performance...
--------------------------Incremental aggregation means applying only the captured changes in the source to aggregate
calculations in a session.
When the source changes only incrementally and if we can capture those changes, then we can
configure the session to process only those changes. This allows informatica server to update
target table incrementally, rather than forcing it to process the entire source and recalculate the
same calculations each time you run the session. By doing this obviously the session performance
increases.
Q. How can i explain my project architecture in interview..? Tell me your project flow
from source to target..?
Normalizer transformation
XML sources
Target definitions
Other mapplets
Post SQL means integration service runs SQL commands against target database after it writes to
the target.
if the source table contain multiple records .if the record specified in the associated port to insert
into lookup cache. it does not find a record in the lookup cache when it is used find the particular
record & change the data in the associated port.
---------------------We set this property when the lookup TRFM uses dynamic cache and the session property TREAT
SOURCE ROWS AS "Insert" has been set.
-------------------This option we use when we want to maintain the history.
If records are not available in target table then it inserts the records in to target and records are
available in target table then it updates the records.
Q. What is an incremental loading? in which situations we will use incremental loading?
Incremental Loading is an approach. Let suppose you a mapping for load the data from employee
table to a employee_target table on the hire date basis. Again let suppose you already move the
employee data from source to target up to the employees hire date 31-12-2009.Your organization
now want to load data on employee_target today. Your target already have the data of that
employees having hire date up to 31-12-2009.so you now pickup the source data which are hiring
from 1-1-2010 to till date. That's why you needn't take the data before than that date, if you do
that wrongly it is overhead for loading data again in target which is already exists. So in source
qualifier you filter the records as per hire date and you can also parameterized the hire date that
help from which date you want to load data upon target.
This is the concept of Incremental loading.
Mapping variable: Mapping variable is represent a value that can be change during the mapping
run that can be stored in repository the integration service retrieve that value from repository and
incremental value for next run.
Q. What is rank and dense rank in informatica with any examples and give sql query for
this both ranks
for eg: the file contains the records with column
100
200(repeated rows)
200
300
400
500
the rank function gives output as
1
2
2
4
5
6
and dense rank gives
1
2
2
3
4
5
for eg: the file contains the records with column
empno sal
100 1000
200(repeated rows) 2000
200 3000
300 4000
400 5000
500 6000
Rank :
select rank() over (partition by empno order by sal) from emp
1
2
2
4
5
6
Dense Rank
select dense_rank() over (partition by empno order by sal) from emp
and dense rank gives
1
2
2
3
4
5
Q. What is the incremental aggregation?
The first time you run an upgraded session using incremental aggregation, the Integration Service
upgrades the index and data cache files. If you want to partition a session using a mapping with
incremental aggregation, the Integration Service realigns the index and data cache files.
Mapping parameters
Mapping variables
Session parameters
Service, web service, Domain, node, grid ( if we have licensed version),In 8.6.1 the Informatica
Admin console we can manage both Domain page and security page. Domain Page means all the
above like creation of IS and repository Service, web service, Domain, node, grid ( if we have
licensed version) etc. Security page means creation of users, privileges, LDAP configuration,
Export Import user and Privileges etc.
These are created to pass values those can be changed for Mapping Parameter and Session
Parameter during mapping run.
Mapping Parameters:
A Parameter is defined in a parameter file for which a Parameter is create already in the Mapping
with Data Type , Precision and scale.
After that we have to select the properties Tab of Session and Set Parameter file name including
physical path of this xxxx.prm file.
Session Parameters:
The Session Parameter files syntax (yyyy.prm).
[FolderName.SessionName]
$InputFileValue1=Path of the source Flat file
After that we have to select the properties Tab of Session and Set Parameter file name including
physical path of this yyyy.prm file.
values
--------> $InputFileValue1
Q. SO many times i saw "$PM parser error ". What is meant by PM?
PM: POWER MART
1) Parsing error will come for the input parameter to the lookup.
2) Informatica is not able to resolve the input parameter CLASS for your lookup.
3) Check the Port CLASS exists as either input port or a variable port in your expression.
4) Check data type of CLASS and the data type of input parameter for your lookup.
You can find this option in workflow monitor. Right click on session choose properties and
Source/Target Statictics tab you can find thoughtput details for each instance of source and
target.
Q. How i can Schedule the Informatica job in "Unix Cron scheduling tool"?
Crontab
The crontab (cron derives from chronos, Greek for time; tab stands for table) command, found in
Unix and Unix-like operating systems, is used to schedule commands to be executed periodically.
To see what crontabs are currently running on your system, you can open a terminal and run:
sudo crontab -l
To edit the list of cronjobs you can run:
sudo crontab -e
This will open a the default editor (could be vi or pico, if you want you can change the default
editor) to let us manipulate the crontab. If you save and exit the editor, all your cronjobs are saved
into crontab. Cronjobs are written in the following format:
* * * * * /bin/execute/this/script.sh
Scheduling explained
As you can see there are 5 stars. The stars represent different date parts in the following order:
1.
2.
3.
4.
5.
every minute
2.
of every hour
3.
4.
of every month
5.
minute: 0
2.
of hour: 1
3.
4.
5.
minute: 0
2.
of hour: 1
3.
4.
5.
Q. Can anyone tell me the difference between persistence and dynamic caches? On
which conditions we are using these caches?
Dynamic:-1)When you use a dynamic cache, the Informatica Server updates the lookup cache as it passes
rows to the target.
2)In Dynamic, we can update catch will New data also.
3) Dynamic cache, Not Reusable
(when we need Updated cache data, That only we need Dynamic Cache)
Persistent:-1)a Lookup transformation to use a non-persistent or persistent cache. The PowerCenter Server
saves or deletes lookup cache files after a successful session based on the Lookup Cache
Persistent property.
2) Persistent, we are not able to update the catch with New data.
3) Persistent catch is Reusable.
(When we need Previous Cache data, That only we need Persistent Cache)
---------------------------------few more additions to the above answer.....
1. Dynamic lookup allows modifying cache where as Persistent lookup does not allow us to modify
cache.
2. Dynamic lookup use 'newlookup row', a default port in the cache but persistent does use any
default ports in cache.
3.As session completes dynamic cache removed but the persistent cache saved in informatica
power centre server.
Active Transformation - An active transformation changes the number of rows that pass through
the mapping.
Source Qualifier Transformation
Sorter Transformations
Aggregator Transformations
Filter Transformation
Union Transformation
Joiner Transformation
Normalizer Transformation
Rank Transformation
Router Transformation
Update Strategy Transformation
Advanced External Procedure Transformation
Passive Transformation - Passive transformations do not change the number of rows that pass
through the mapping.
Expression Transformation
Sequence Generator Transformation
Lookup Transformation
Stored Procedure Transformation
XML Source Qualifier Transformation
External Procedure Transformation
Q. Eliminating of duplicate records without using dynamic lookups?
Hi U can eliminate duplicate records by an simple one line SQL Query.
Select id, count (*) from seq1 group by id having count (*)>1;
Below are the ways to eliminate the duplicate records:
1. By enabling the option in Source Qualifier transformation as select distinct.
2. By enabling the option in sorter transformation as select distinct.
3. By enabling all the values as group by in Aggregator transformation.
Q. Can anyone give idea on how do we perform test load in informatica? What do we
test as part of test load in informatica?
With a test load, the Informatica Server reads and transforms data without writing to targets. The
Informatica Server does everything, as if running the full session. The Informatica Server writes
data to relational targets, but rolls back the data when the session completes. So, you can enable
collect performance details property and analyze the how efficient your mapping is. If the session
is running for a long time, you may like to find out the bottlenecks that are existing. It may be
bottleneck of type target, source, mapping etc.
The basic idea behind test load is to see the behavior of Informatica Server with your session.
Q. What is ODS (Operational Data Store)?
A collection of operation or bases data that is extracted from operation databases and
standardized, cleansed, consolidated, transformed, and loaded into enterprise data architecture.
An ODS is used to support data mining of operational data, or as the store for base data that is
summarized for a data warehouse.
The ODS may also be used to audit the data warehouse to assure summarized and derived data is
calculated properly. The ODS may further become the enterprise shared operational database,
allowing operational systems that are being reengineered to use the ODS as there operation
databases.
Q. How many tasks are there in informatica?
Session Task
Email Task
Command Task
Assignment Task
Control Task
Decision Task
Event-Raise
Event- Wait
Timer Task
Link Task
Q. What are business components in Informatica?
Domains
Nodes
Services
Q. What is versioning?
Its used to keep history of changes done on the mappings and workflows
1. Check in: You check in when you are done with your changes so that everyone can see those
changes.
2. Check out: You check out from the main stream when you want to make any change to the
mapping/workflow.
3. Version history: It will show you all the changes made and who made it.
Q. How do you handle error logic in Informatica? What are the transformations that you
used while handling errors? How did you reload those error records in target?
Row indicator: It generally happens when working with update strategy transformation. The
An inline view is term given to sub query in FROM clause of query which can be used as table.
Inline view effectively is a named sub query
Ex : Select Tab1.col1,Tab1.col.2,Inview.col1,Inview.Col2
From Tab1, (Select statement) Inview
Where Tab1.col1=Inview.col1
SELECT DNAME, ENAME, SAL FROM EMP ,
(SELECT DNAME, DEPTNO FROM DEPT) D
WHERE A.DEPTNO = B.DEPTNO
In the above query (SELECT DNAME, DEPTNO FROM DEPT) D is the inline view.
Inline views are determined at runtime, and in contrast to normal view they are not stored in the
data dictionary,
The integration service increments the generated key (GK) sequence number each time it
process a source row. When the source row contains a multiple-occurring column or a multipleoccurring group of columns, the normalizer transformation returns a row for each occurrence. Each
row contains the same generated key value.
The normalizer transformation has a generated column ID (GCID) port for each multiple-
occurring column. The GCID is an index for the instance of the multiple-occurring data. For
example, if a column occurs 3 times in a source record, the normalizer returns a value of 1, 2 or 3
in the generated column ID.
Q. What is difference between SUBSTR and INSTR?
INSTR function search string for sub-string and returns an integer indicating the position of the
character in string that is the first character of this occurrence.
TABLES
VIEWS
INDEXES
SYNONYMS
SEQUENCES
TABLESPACES
Q. What is @@ERROR?
The @@ERROR automatic variable returns the error code of the last Transact-SQL statement. If
there was no error, @@ERROR returns zero. Because @@ERROR is reset after each Transact-SQL
statement, it must be saved to a variable if it is needed to process it further after checking it.
Q. What is difference between co-related sub query and nested sub query?
Correlated subquery runs once for each row selected by the outer query. It contains a reference
to a value from the row selected by the outer query.
Nested subquery runs only once for the entire nesting (outer) query. It does not contain any
reference to the outer query row.
For example,
Correlated Subquery:
Select e1.empname, e1.basicsal, e1.deptno from emp e1 where e1.basicsal = (select
max(basicsal) from emp e2 where e2.deptno = e1.deptno)
Nested Subquery:
Select empname, basicsal, deptno from emp where (deptno, basicsal) in (select deptno,
max(basicsal) from emp group by deptno)
Q. How does one escape special characters when building SQL queries?
The LIKE keyword allows for string searches. The _ wild card character is used to match exactly
one character, % is used to match zero or more occurrences of any characters. These characters
can be escaped in SQL. Example:
SELECT name FROM emp WHERE id LIKE %\_% ESCAPE \;
Use two quotes for every one displayed. Example:
SELECT Frankss Oracle site FROM DUAL;
Primary key:
1. Query processing is slow
2. Can be alpha numeric
3. Source system gives the primary key.
4. Eg: C10999
Method 1:
DELETE from table_name A
where rowid > (select min(rowid) from table_name B where A.key_values = B.key_values);
Method 2:
Create table table_name2 as select distinct * from table_name1;
drop table table_name1;
rename table table_name2 as table_name1;
In this method, all the indexes,constraints,triggers etc have to be re-created.
Method 3:
DELETE from table_name t1
where exists (select x from table_name t2 where t1.key_value=t2.key_value and t1.rowid >
t2.rowid)
Method 4:
DELETE from table_name where rowid not in (select max(rowid) from my_table group by
key_value )
Q. How does the server recognize the source and target databases?
If it is relational - By using ODBC connection
FTP connection - By using flat file
Q. What are the different types of indexes supported by Oracle?
1. B-tree index
2. B-tree cluster index
3. Hash cluster index
4. Reverse key index
5. Bitmap index
6. Function Based index
XML Parser
XML Generator
change for this row. This is the default value of the expression.
transaction, and writes the current row to the target. The current row is in the new transaction.
TC_COMMIT_AFTER: The Integration Service writes the current row to the target, commits
the transaction, and begins a new transaction. The current row is in the committed transaction.
TC_ROLLBACK_BEFORE: The Integration Service rolls back the current transaction, begins
a new transaction, and writes the current row to the target. The current row is in the new
transaction.
TC_ROLLBACK_AFTER: The Integration Service writes the current row to the target, rolls
back the transaction, and begins a new transaction. The current row is in the rolled back
transaction.
Q. What is difference between grep and find?
Q. What are the difference between DDL, DML and DCL commands?
TRUNCATE remove all records from a table, including all spaces allocated for the records
are removed
DELETE deletes all records from a table, the space for the records remain
SAVEPOINT identify a point in a transaction to which you can later roll back
SET TRANSACTION Change transaction options like what rollback segment to use
Present the data in a different perspective from that of the base table
Q. What is Trigger?
A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE)
occurs. Triggers are stored in and managed by the DBMS. Triggers are used to maintain the
referential integrity of data by changing the data in a systematic fashion. A trigger cannot be
called or executed; the DBMS automatically fires the trigger as a result of a data modification to
the associated table. Triggers can be viewed as similar to stored procedures in that both consist of
procedural logic that is stored at the database level. Stored procedures, however, are not eventdrive and are not attached to a specific table as triggers are. Stored procedures are explicitly
executed by invoking a CALL to the procedure while triggers are implicitly executed. In addition,
triggers can also execute stored Procedures.
Nested Trigger: A trigger can also contain INSERT, UPDATE and DELETE logic within itself, so
when the trigger is fired because of data modification it can also cause another data modification,
thereby firing another trigger. A trigger that contains data modification logic within itself is called a
nested trigger.
Q. What is View?
A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well
as updating or deleting rows. Rows updated or deleted in the view are updated or deleted in the
table the view was created with. It should also be noted that as data in the original table changes,
so does data in the view, as views are the way to look at part of the original table. The results of
using a view are not permanently stored in the database. The data accessed through a view is
actually constructed using standard T-SQL select command and can come from one to many
different base tables or even other views.
Q. What is Index?
An index is a physical structure containing pointers to the data. Indices are created in an existing
table to locate rows more quickly and efficiently. It is possible to create an index on one or more
columns of a table, and each index is given a name. The users cannot see the indexes; they are
just used to speed up queries. Effective indexes are one of the best ways to improve performance
in a database application. A table scan happens when there is no index available to help a query.
In a table scan SQL Server examines every row in the table to satisfy the query results. Table scans
are sometimes unavoidable, but on large tables, scans have a terrific impact on performance.
Clustered indexes define the physical sorting of a database tables rows in the storage media. For
this reason, each database table may
have only one clustered index. Non-clustered indexes are created outside of the database table
and contain a sorted list of references to the table itself.
Declare cursor
Open cursor
Close cursor
Deallocate cursor
RANK CACHE
Sample Rank Mapping
When the Power Center Server runs a session with a Rank transformation, it compares an input
row with rows in the data cache. If the input row out-ranks a Stored row, the Power Center Server
replaces the stored row with the input row.
Example: Power Center caches the first 5 rows if we are finding top 5 salaried Employees. When
6th row is read, it compares it with 5 rows in cache and places it in Cache is needed.
1) RANK INDEX CACHE:
The index cache holds group information from the group by ports. If we are Using Group By on
Aggregator Caches
1. The Power Center Server stores data in the aggregate cache until it completes Aggregate
calculations.
2. It stores group values in an index cache and row data in the data cache. If the Power Center
Server requires more space, it stores overflow values in cache files.
Note: The Power Center Server uses memory to process an Aggregator transformation with sorted
ports. It does not use cache memory. We do not need to configure cache memory for Aggregator
transformations that use sorted ports.
1) Aggregator Index Cache:
The index cache holds group information from the group by ports. If we are using Group By on
DEPTNO, then this cache stores values 10, 20, 30 etc.
JOINER CACHES
Joiner always caches the MASTER table. We cannot disable caching. It builds Index cache and Data
Cache based on MASTER table.
1) Joiner Index Cache:
All Columns of MASTER table used in Join condition are in JOINER INDEX CACHE.
For a connected Lookup transformation, stores data for the connected output ports, not
For an unconnected Lookup transformation, stores data from the return port.
Connected Lookup
Unconnected Lookup
Cache includes all lookup columns used in Cache includes all lookup/output ports in
the mapping.
the lookup condition and the
lookup/return port.
If there is no match for the lookup
If there is no match for the lookup
condition, the Power Center Server returns condition, the Power Center Server
the default value for all output ports.
returns NULL.
If there is a match for the lookup
condition, the Power Center Server returns
the result of the lookup condition for all
lookup/output ports.
Cache Comparison
Persistent
1) A Lookup transformation to use a non-persistent or persistent cache. The PowerCenter Server
saves or deletes lookup cache files after a successful session based on the Lookup Cache
Persistent property.
2) Persistent, we are not able to update the catch with new data.
3) Persistent catch is Reusable.
(When we need previous cache data, that only we need Persistent Cache)
Informatica - Transformations
In Informatica, Transformations help to transform the source data according to the requirements of
target system and it ensures the quality of the data being loaded into target.
Transformations are of two types: Active and Passive.
Active Transformation
An active transformation can change the number of rows that pass through it from source to
target. (i.e) It eliminates rows that do not meet the condition in transformation.
Passive Transformation
A passive transformation does not change the number of rows that pass through it (i.e) It passes
all rows through the transformation.
Connected Transformation
Connected transformation is connected to other transformations or directly to target table in the
mapping.
Unconnected Transformation
An unconnected transformation is not connected to other transformations in the mapping. It is
called within another transformation, and returns a value to that transformation.
In the following pages, we will explain all the above Informatica Transformations and their
significances in the ETL process in detail.
===========================================================
===================
Aggregator Transformation
Aggregator transformation is an Active and Connected transformation.
This transformation is useful to perform calculations such as averages and sums (mainly to
perform calculations on multiple rows or groups).
For example, to calculate total of daily sales or to calculate average of monthly or yearly sales.
Aggregate functions such as AVG, FIRST, COUNT, PERCENTILE, MAX, SUM etc. can be used in
aggregate transformation.
===========================================================
===================
Expression Transformation
Expression transformation is a Passive and Connected transformation.
This can be used to calculate values in a single row before writing to the target.
sales data resides in another table. Here instead of using the sales table as one more source, use
Lookup transformation to lookup the data for the product, with ID 10 in sales table.
Connected lookup receives input values directly from mapping pipeline whereas
Unconnected lookup receives values from: LKP expression from another transformation.
Connected lookup returns multiple columns from the same row whereas
Unconnected lookup has one return port and returns one column from each row.
Connected lookup supports user-defined default values whereas
Unconnected lookup does not support user defined values.
===========================================================
===================
Normalizer Transformation
Normalizer Transformation is an Active and Connected transformation.
It is used mainly with COBOL sources where most of the time data is stored in de-normalized
format.
Also, Normalizer transformation can be used to create multiple rows from a single row of data.
===========================================================
===================
Rank Transformation
Rank transformation is an Active and Connected transformation.
It is used to select the top or bottom rank of data.
For example,
To select top 10 Regions where the sales volume was very high
or
To select 10 lowest priced products.
===========================================================
===================
Router Transformation
Router is an Active and Connected transformation. It is similar to filter transformation.
The only difference is, filter transformation drops the data that do not meet the condition whereas
router has an option to capture the data that do not meet the condition. It is useful to test multiple
conditions.
It has input, output and default groups.
For example, if we want to filter data like where State=Michigan, State=California, State=New
York and all other States. Its easy to route data to different tables.
===========================================================
===================
You can specify how to treat source rows in table, insert, update, delete or data driven.
===========================================================
===================
XML Source Qualifier Transformation
XML Source Qualifier is a Passive and Connected transformation.
XML Source Qualifier is used only with an XML source definition.
It represents the data elements that the Informatica Server reads when it executes a session with
XML sources.
===========================================================
===================
Constraint-Based Loading
In the Workflow Manager, you can specify constraint-based loading for a session. When you select
this option, the Integration Service orders the target load on a row-by-row basis. For every row
generated by an active source, the Integration Service loads the corresponding transformed row
first to the primary key table, then to any foreign key tables. Constraint-based loading depends on
the following requirements:
Active source: Related target tables must have the same active source.
Key relationships: Target tables must have key relationships.
Target connection groups: Targets must be in one target connection group.
Treat rows as insert. Use this option when you insert into the target. You cannot use updates with
constraint based loading.
Active Source:
When target tables receive rows from different active sources, the Integration Service reverts to
normal loading for those tables, but loads all other targets in the session using constraint-based
loading when possible. For example, a mapping contains three distinct pipelines. The first two
contain a source, source qualifier, and target. Since these two targets receive data from different
active sources, the Integration Service reverts to normal loading for both targets. The third
pipeline contains a source, Normalizer, and two targets. Since these two targets share a single
active source (the Normalizer), the Integration Service performs constraint-based loading: loading
the primary key table first, then the foreign key table.
Key Relationships:
When target tables have no key relationships, the Integration Service does not perform constraintbased loading.
Similarly, when target tables have circular key relationships, the Integration Service reverts to a
normal load. For example, you have one target containing a primary key and a foreign key related
to the primary key in a second target. The second target also contains a foreign key that
references the primary key in the first target. The Integration Service cannot enforce constraintbased loading for these tables. It reverts to a normal load.
Target Connection Groups:
The Integration Service enforces constraint-based loading for targets in the same target
connection group. If you want to specify constraint-based loading for multiple targets that receive
data from the same active source, you must verify the tables are in the same target connection
group. If the tables with the primary key-foreign key relationship are in different target connection
groups, the Integration Service cannot enforce constraint-based loading when you run the
workflow. To verify that all targets are in the same target connection group, complete the following
tasks:
Verify all targets are in the same target load order group and receive data from the same
active source.
Use the default partition properties and do not add partitions or partition points.
Define the same target type for all targets in the session properties.
Define the same database connection name for all targets in the session properties.
Choose normal mode for the target load type for all targets in the session properties.
Treat Rows as Insert:
Use constraint-based loading when the session option Treat Source Rows As is set to insert. You
might get inconsistent data if you select a different Treat Source Rows As option and you configure
the session for constraint-based loading.
When the mapping contains Update Strategy transformations and you need to load data to a
primary key table first, split the mapping using one of the following options:
Load primary key table in one mapping and dependent tables in another mapping. Use
constraint-based loading to load the primary table.
Example
The following mapping is configured to perform constraint-based loading:
In the first pipeline, target T_1 has a primary key, T_2 and T_3 contain foreign keys referencing the
T1 primary key. T_3 has a primary key that T_4 references as a foreign key.
Since these tables receive records from a single active source, SQ_A, the Integration Service
loads rows to the target in the following order:
1. T_1
2. T_2 and T_3 (in no particular order)
3. T_4
The Integration Service loads T_1 first because it has no foreign key dependencies and contains a
primary key referenced by T_2 and T_3. The Integration Service then loads T_2 and T_3, but since
T_2 and T_3 have no dependencies, they are not loaded in any particular order. The Integration
Service loads T_4 last, because it has a foreign key that references a primary key in T_3.After
loading the first set of targets, the Integration Service begins reading source B. If there are no key
relationships between T_5 and T_6, the Integration Service reverts to a normal load for both
targets.
If T_6 has a foreign key that references a primary key in T_5, since T_5 and T_6 receive data from a
single active source, the Aggregator AGGTRANS, the Integration Service loads rows to the tables in
the following order:
T_5
T_6
T_1, T_2, T_3, and T_4 are in one target connection group if you use the same database connection
for each target, and you use the default partition properties. T_5 and T_6 are in another target
connection group together if you use the same database connection for each target and you use
the default partition properties. The Integration Service includes T_5 and T_6 in a different target
connection group because they are in a different target load order group from the first four targets.
Enabling Constraint-Based Loading:
When you enable constraint-based loading, the Integration Service orders the target load on a rowby-row basis. To enable constraint-based loading:
1. In the General Options settings of the Properties tab, choose Insert for the Treat Source Rows
As property.
2. Click the Config Object tab. In the Advanced settings, select Constraint Based Load Ordering.
3. Click OK.
The Target Load Plan dialog box lists all Source Qualifier transformations in the mapping and
the targets that receive data from each source qualifier.
Click the Up and Down buttons to move the source qualifier within the load order.
Repeat steps 3 to 4 for other source qualifiers you want to reorder. Click OK.
The Integration Service saves the latest value of a mapping variable to the repository at the
end of each successful session.
We can also clear all saved values for the session in the Workflow Manager.
We might use a mapping variable to perform an incremental read of the source. For example, we
have a source table containing time stamped transactions and we want to evaluate the
transactions on a daily basis. Instead of manually entering a session override to filter source data
each time we run the session, we can create a mapping variable, $$IncludeDateTime. In the
source qualifier, create a filter to read only rows whose transaction date equals $
$IncludeDateTime, such as:
TIMESTAMP = $$IncludeDateTime
In the mapping, use a variable function to set the variable value to increment one day each time
the session runs. If we set the initial value of $$IncludeDateTime to 8/1/2004, the first time the
Integration Service runs the session, it reads only rows dated 8/1/2004. During the session, the
Integration Service sets $$IncludeDateTime to 8/2/2004. It saves 8/2/2004 to the repository at the
end of the session. The next time it runs the session, it reads only rows from August 2, 2004.
Used in following transformations:
Expression
Filter
Router
Update Strategy
Initial and Default Value:
When we declare a mapping parameter or variable in a mapping or a mapplet, we can enter an
initial value. When the Integration Service needs an initial value, and we did not declare an initial
value for the parameter or variable, the Integration Service uses a default value based on the data
type of the parameter or variable.
Data ->Default Value
Numeric ->0
String ->Empty String
Date time ->1/1/1
Variable Values: Start value and current value of a mapping variable
Start Value:
The start value is the value of the variable at the start of the session. The Integration Service looks
for the start value in the following order:
Initial value
Default value
Current Value:
The current value is the value of the variable as the session progresses. When a session starts, the
current value of a variable is the same as the start value. The final current value for a variable is
saved to the repository at the end of a successful session. When a session fails to complete, the
Integration Service does not update the value of the variable in the repository.
Note: If a variable function is not used to calculate the current value of a mapping variable, the
start value of the variable is saved to the repository.
Variable Data type and Aggregation Type When we declare a mapping variable in a mapping, we
need to configure the Data type and aggregation type for the variable. The IS uses the aggregate
type of a Mapping variable to determine the final current value of the mapping variable.
Aggregation types are:
Count: Integer and small integer data types are valid only.
Max: All transformation data types except binary data type are valid.
Min: All transformation data types except binary data type are valid.
Variable Functions
Variable functions determine how the Integration Service calculates the current value of a mapping
variable in a pipeline.
SetMaxVariable: Sets the variable to the maximum value of a group of values. It ignores rows
marked for update, delete, or reject. Aggregation type set to Max.
SetMinVariable: Sets the variable to the minimum value of a group of values. It ignores rows
marked for update, delete, or reject. Aggregation type set to Min.
SetCountVariable: Increments the variable value by one. It adds one to the variable value when
a row is marked for insertion, and subtracts one when the row is Marked for deletion. It ignores
rows marked for update or reject. Aggregation type set to Count.
SetVariable: Sets the variable to the configured value. At the end of a session, it compares the
final current value of the variable to the start value of the variable. Based on the aggregate type of
the variable, it saves a final value to the repository.
Creating Mapping Parameters and Variables
In the Mapping Designer, click Mappings > Parameters and Variables. -or- In the Mapplet
Designer, click Mapplet > Parameters and Variables.
Select Type and Data type. Select Aggregation type for mapping variables.
PARAMETER FILE
A parameter file is a list of parameters and associated values for a workflow, worklet, or session.
Parameter files provide flexibility to change these variables each time we run a workflow or
session.
We can create multiple parameter files and change the file we use for a session or workflow. We
can create a parameter file using a text editor such as WordPad or Notepad.
Enter the parameter file name and directory in the workflow or session properties.
A parameter file contains the following types of parameters and variables:
Workflow variable: References values and records information in a workflow.
Worklet variable: References values and records information in a worklet. Use predefined worklet
variables in a parent workflow, but we cannot use workflow variables from the parent workflow in a
worklet.
Session parameter: Defines a value that can change from session to session, such as a database
connection or file name.
Mapping parameter and Mapping variable
USING A PARAMETER FILE
Parameter files contain several sections preceded by a heading. The heading identifies the
Integration Service, Integration Service process, workflow, worklet, or session to which we want to
assign parameters or variables.
Mapplet
A mapplet is a reusable object that we create in the Mapplet Designer.
It contains a set of transformations and lets us reuse that transformation logic in multiple
mappings.
Created in Mapplet Designer in Designer Tool.
We need to use same set of 5 transformations in say 10 mappings. So instead of making 5
transformations in every 10 mapping, we create a mapplet of these 5 transformations. Now we use
this mapplet in all 10 mappings. Example: To create a surrogate key in target. We create a mapplet
using a stored procedure to create Primary key for target table. We give target table name and key
column name as input to mapplet and get the Surrogate key as output.
Mapplets help simplify mappings in the following ways:
Include source definitions: Use multiple source definitions and source qualifiers to provide
source data for a mapping.
Accept data from sources in a mapping
Include multiple transformations: As many transformations as we need.
Pass data to multiple transformations: We can create a mapplet to feed data to multiple
transformations. Each Output transformation in a mapplet represents one output group in a
mapplet.
Contain unused ports: We do not have to connect all mapplet input and output ports in a
mapping.
Mapplet Input:
Mapplet input can originate from a source definition and/or from an Input transformation in the
mapplet. We can create multiple pipelines in a mapplet.
We use Mapplet Input transformation to give input to mapplet.
Use of Mapplet Input transformation is optional.
Mapplet Output:
The output of a mapplet is not connected to any target table.
We must use Mapplet Output transformation to store mapplet output.
A mapplet must contain at least one Output transformation with at least one connected port in the
mapplet.
Example1: We will join EMP and DEPT table. Then calculate total salary. Give the output to
mapplet out transformation.
EMP and DEPT will be source tables.
Output will be given to transformation Mapplet_Out.
Steps:
Transformation -> Create -> Select Expression for list -> Create -> Done
Pass all ports from joiner to expression and then calculate total salary as described in
expression transformation.
Now Transformation -> Create -> Select Mapplet Out from list > Create -> Give name and
then done.
Transformation -> Create -> Select Filter for list -> Create -> Done.
Drag all ports from mplt_example1 to filter and give filter condition.
Connect all ports from filter to target. We can add more transformations after filter if
needed.
Sample:
D:\EMP1.txt
E:\EMP2.txt
E:\FILES\DWH\EMP3.txt and so on
3. Now make a session and in Source file name and Source File Directory location fields, give the
name and location of above created file.
4. In Source file type field, select Indirect.
5. Click Apply.
6. Validate Session
7. Make Workflow. Save it to repository and run.
Incremental Aggregation
When we enable the session option-> Incremental Aggregation the Integration Service
performs incremental aggregation, it passes source data through the mapping and uses historical
cache data to perform aggregation calculations incrementally.
When using incremental aggregation, you apply captured changes in the source to aggregate
calculations in a session. If the source changes incrementally and you can capture changes, you
can configure the session to process those changes. This allows the Integration Service to update
the target incrementally, rather than forcing it to process the entire source and recalculate the
same data each time you run the session.
For example, you might have a session using a source that receives new data every day. You can
capture those incremental changes because you have added a filter condition to the mapping that
removes pre-existing data from the flow of data. You then enable incremental aggregation.
When the session runs with incremental aggregation enabled for the first time on March 1, you use
the entire source. This allows the Integration Service to read and store the necessary aggregate
data. On March 2, when you run the session again, you filter out all the records except those timestamped March 2. The Integration Service then processes the new data and updates the target
accordingly. Consider using incremental aggregation in the following circumstances:
You can capture new source data. Use incremental aggregation when you can capture new source
data each time you run the session. Use a Stored Procedure or Filter transformation to process new
data.
Incremental changes do not significantly change the target. Use incremental aggregation when the
changes do not significantly change the target. If processing the incrementally changed source
alters more than half the existing target, the session may not benefit from using incremental
aggregation. In this case, drop the table and recreate the target with complete source data.
Note: Do not use incremental aggregation if the mapping contains percentile or median functions.
The Integration Service uses system memory to process these functions in addition to the cache
memory you configure in the session properties. As a result, the Integration Service does not store
incremental aggregation values for percentile and median functions in disk caches.
Integration Service Processing for Incremental Aggregation
(i)The first time you run an incremental aggregation session, the Integration Service processes the
entire source. At the end of the session, the Integration Service stores aggregate data from that
session run in two files, the index file and the data file. The Integration Service creates the files in
the cache directory specified in the Aggregator transformation properties.
(ii)Each subsequent time you run the session with incremental aggregation, you use the
incremental source changes in the session. For each input record, the Integration Service checks
historical information in the index file for a corresponding group. If it finds a corresponding group,
the Integration Service performs the aggregate operation incrementally, using the aggregate data
for that group, and saves the incremental change. If it does not find a corresponding group, the
Integration Service creates a new group and saves the record data.
(iii)When writing to the target, the Integration Service applies the changes to the existing target. It
saves modified aggregate data in the index and data files to be used as historical data the next
time you run the session.
(iv) If the source changes significantly and you want the Integration Service to continue saving
aggregate data for future incremental changes, configure the Integration Service to overwrite
existing aggregate data with new aggregate data.
Each subsequent time you run a session with incremental aggregation, the Integration Service
creates a backup of the incremental aggregation files. The cache directory for the Aggregator
transformation must contain enough disk space for two sets of the files.
(v)When you partition a session that uses incremental aggregation, the Integration Service creates
one set of cache files for each partition.
The Integration Service creates new aggregate data, instead of using historical data, when you
perform one of the following tasks:
Move the aggregate files without correcting the configured path or directory for the files in
the session properties.
Change the configured path or directory for the aggregate files without moving the files to
the new location.
When the Integration Service rebuilds incremental aggregation files, the data in the previous
files is lost.
Note: To protect the incremental aggregation files from file corruption or disk failure, periodically
back up the files.
Preparing for Incremental Aggregation:
When you use incremental aggregation, you need to configure both mapping and session
properties:
Configure the session for incremental aggregation and verify that the file directory has
enough disk space for the aggregate files.
Configuring the Mapping
Before enabling incremental aggregation, you must capture changes in source data. You can use a
Filter or Stored Procedure transformation in the mapping to remove pre-existing source data during
a session.
Configuring the Session
Use the following guidelines when you configure the session for incremental aggregation:
(i) Verify the location where you want to store the aggregate files.
The index and data files grow in proportion to the source data. Be sure the cache directory has
enough disk space to store historical data for the session.
When you run multiple sessions with incremental aggregation, decide where you want the files
stored. Then, enter the appropriate directory for the process variable, $PMCacheDir, in the
Workflow Manager. You can enter session-specific directories for the index and data files. However,
by using the process variable for all sessions using incremental aggregation, you can easily
change the cache directory when necessary by changing $PMCacheDir.
Changing the cache directory without moving the files causes the Integration Service to reinitialize
the aggregate cache and gather new aggregate data.
In a grid, Integration Services rebuild incremental aggregation files they cannot find. When an
Integration Service rebuilds incremental aggregation files, it loses aggregate history.
(ii) Verify the incremental aggregation settings in the session properties.
You can configure the session for incremental aggregation in the Performance settings on the
Properties tab.
You can also configure the session to reinitialize the aggregate cache. If you choose to reinitialize
the cache, the Workflow Manager displays a warning indicating the Integration Service overwrites
the existing cache and a reminder to clear this option after running the session.
4) Simple Pass-Through
The integration service passes all rows at one partition point to the next partition point without
redistributing them. Choose pass-through partitioning where you want to create an additional
pipeline stage to improve performance, but do not want to change the distribution of data across
partitions
5) Round-Robin
The integration service distributes data evenly among all partitions. Use round-robin partitioning
where you want each partition to process approximately the same number of rows.
value list.
ALTER TABLE customers
MODIFY PARTITION south_india
DROP VALUES (KOCHI,MANGALORE);
SPLITTING PARTITIONS
You can split a single partition into two partitions. For example to split the partition p5 of sales
table into two partitions give the following command.
Alter table sales split partition p5 into
(Partition p6 values less than (1996),
Partition p7 values less then (MAXVALUE));
TRUNCATING PARTITON
Truncating a partition will delete all rows from the partition.
To truncate a partition give the following statement
Alter table sales truncate partition p5;
LISTING INFORMATION ABOUT PARTITION TABLES
To see how many partitioned tables are there in your schema give the following statement
Select * from user_part_tables;
To see on partition level partitioning information
Select * from user_tab_partitions;
TASKS
The Workflow Manager contains many types of tasks to help you build workflows and worklets. We
can create reusable tasks in the Task Developer.
Types of tasks:
Task Type
Tool where task can be
Reusable or not
created
Session
Task Developer
Yes
Workflow Designer
Yes
Command
Worklet Designer
Yes
Event-Raise
Workflow Designer
No
Event-Wait
Worklet Designer
No
Timer
No
Decision
No
Assignment
No
Control
No
SESSION TASK
A session is a set of instructions that tells the Power Center Server how and when to move data
from sources to targets.
To run a session, we must first create a workflow to contain the Session task.
We can run as many sessions in a workflow as we need. We can run the Session tasks sequentially
or concurrently, depending on our needs.
The Power Center Server creates several files and in-memory caches depending on the
transformations and options used in the session.
EMAIL TASK
The Workflow Manager provides an Email task that allows us to send email during a workflow.
Created by Administrator usually and we just drag and use it in our mapping.
Steps:
1. In the Task Developer or Workflow Designer, choose Tasks-Create.
2. Select an Email task and enter a name for the task. Click Create.
3. Click Done.
4. Double-click the Email task in the workspace. The Edit Tasks dialog box appears.
5. Click the Properties tab.
6. Enter the fully qualified email address of the mail recipient in the Email User Name field.
7. Enter the subject of the email in the Email Subject field. Or, you can leave this field blank.
8. Click the Open button in the Email Text field to open the Email Editor.
9. Click OK twice to save your changes.
Example: To send an email when a session completes:
Steps:
1. Create a workflow wf_sample_email
2. Drag any session task to workspace.
3. Edit Session task and go to Components tab.
4. See On Success Email Option there and configure it.
5. In Type select reusable or Non-reusable.
6. In Value, select the email task to be used.
7. Click Apply -> Ok.
8. Validate workflow and Repository -> Save
9. We can also drag the email task and use as per need.
10.
We can set the option to send email on success or failure in components tab of a
session task.
COMMAND TASK
The Command task allows us to specify one or more shell commands in UNIX or DOS commands in
Windows to run during the workflow.
For example, we can specify shell commands in the Command task to delete reject files, copy a
file, or archive target files.
Ways of using command task:
1. Standalone Command task: We can use a Command task anywhere in the workflow or worklet
to run shell commands.
2. Pre- and post-session shell command: We can call a Command task as the pre- or post-session
shell command for a Session task. This is done in COMPONENTS TAB of a session. We can run it in
Pre-Session Command or Post Session Success Command or Post Session Failure Command. Select
the Value and Type option as we did in Email task.
Example: to copy a file sample.txt from D drive to E.
Command: COPY D:\sample.txt E:\ in windows
Steps for creating command task:
1. In the Task Developer or Workflow Designer, choose Tasks-Create.
2. Select Command Task for the task type.
3. Enter a name for the Command task. Click Create. Then click done.
4. Double-click the Command task. Go to commands tab.
5. In the Commands tab, click the Add button to add a command.
6. In the Name field, enter a name for the new command.
7. In the Command field, click the Edit button to open the Command Editor.
8. Enter only one command in the Command Editor.
9. Click OK to close the Command Editor.
10.
Repeat steps 5-9 to add more commands in the task.
11.
Click OK.
Steps to create the workflow using command task:
1. Create a task using the above steps to copy a file in Task Developer.
2. Open Workflow Designer. Workflow -> Create -> Give name and click ok.
3. Start is displayed. Drag session say s_m_Filter_example and command task.
4. Link Start to Session task and Session to Command Task.
5. Double click link between Session and Command and give condition in editor as
6. $S_M_FILTER_EXAMPLE.Status=SUCCEEDED
7. Workflow-> Validate
8. Repository > Save
WORKING WITH EVENT TASKS
We can define events in the workflow to specify the sequence of task execution.
Types of Events:
Pre-defined event: A pre-defined event is a file-watch event. This event Waits for a specified file
to arrive at a given location.
User-defined event: A user-defined event is a sequence of tasks in the Workflow. We create
events and then raise them as per need.
Steps for creating User Defined Event:
1. Open any workflow where we want to create an event.
2. Click Workflow-> Edit -> Events tab.
3. Click to Add button to add events and give the names as per need.
4. Click Apply -> Ok. Validate the workflow and Save it.
Types of Events Tasks:
EVENT RAISE: Event-Raise task represents a user-defined event. We use this task to raise a user
defined event.
EVENT WAIT: Event-Wait task waits for a file watcher event or user defined event to occur before
executing the next session in the workflow.
Example1: Use an event wait task and make sure that session s_filter_example runs when abc.txt
file is present in D:\FILES folder.
Steps for creating workflow:
1. Workflow -> Create -> Give name wf_event_wait_file_watch -> Click ok.
2. Task -> Create -> Select Event Wait. Give name. Click create and done.
3. Link Start to Event Wait task.
4. Drag s_filter_example to workspace and link it to event wait task.
5. Right click on event wait task and click EDIT -> EVENTS tab.
6. Select Pre Defined option there. In the blank space, give directory and filename to watch.
Example: D:\FILES\abc.tct
7. Workflow validate and Repository Save.
Example 2: Raise a user defined event when session s_m_filter_example succeeds. Capture this
event in event wait task and run session S_M_TOTAL_SAL_EXAMPLE
Steps for creating workflow:
1. Workflow -> Create -> Give name wf_event_wait_event_raise -> Click ok.
2. Workflow -> Edit -> Events Tab and add events EVENT1 there.
3. Drag s_m_filter_example and link it to START task.
4. Click Tasks -> Create -> Select EVENT RAISE from list. Give name
5. ER_Example. Click Create and then done. Link ER_Example to s_m_filter_example.
6. Right click ER_Example -> EDIT -> Properties Tab -> Open Value for User Defined Event and
Select EVENT1 from the list displayed. Apply -> OK.
7. Click link between ER_Example and s_m_filter_example and give the condition
$S_M_FILTER_EXAMPLE.Status=SUCCEEDED
8. Click Tasks -> Create -> Select EVENT WAIT from list. Give name EW_WAIT. Click Create and
then done.
9. Link EW_WAIT to START task.
10.
Right click EW_WAIT -> EDIT-> EVENTS tab.
11.
Select User Defined there. Select the Event1 by clicking Browse Events button.
12.
Apply -> OK.
13.
Drag S_M_TOTAL_SAL_EXAMPLE and link it to EW_WAIT.
14.
Mapping -> Validate
15.
Repository -> Save.
Run workflow and see.
TIMER TASK
The Timer task allows us to specify the period of time to wait before the Power Center Server runs
the next task in the workflow. The Timer task has two types of settings:
Absolute time: We specify the exact date and time or we can choose a user-defined workflow
variable to specify the exact time. The next task in workflow will run as per the date and time
specified.
Relative time: We instruct the Power Center Server to wait for a specified period of time after the
Timer task, the parent workflow, or the top-level workflow starts.
Example: Run session s_m_filter_example relative to 1 min after the timer task.
Steps for creating workflow:
1. Workflow -> Create -> Give name wf_timer_task_example -> Click ok.
2. Click Tasks -> Create -> Select TIMER from list. Give name TIMER_Example. Click Create and
then done.
3. Link TIMER_Example to START task.
4. Right click TIMER_Example-> EDIT -> TIMER tab.
5. Select Relative Time Option and Give 1 min and Select From start time of this task Option.
6. Apply -> OK.
7. Drag s_m_filter_example and link it to TIMER_Example.
8. Workflow-> Validate and Repository -> Save.
DECISION TASK
The Decision task allows us to enter a condition that determines the execution of the workflow,
similar to a link condition.
The Decision task has a pre-defined variable called $Decision_task_name.condition that represents
the result of the decision condition.
The Power Center Server evaluates the condition in the Decision task and sets the pre-defined
condition variable to True (1) or False (0).
We can specify one decision condition per Decision task.
Example: Command Task should run only if either s_m_filter_example or
S_M_TOTAL_SAL_EXAMPLE succeeds. If any of s_m_filter_example or
S_M_TOTAL_SAL_EXAMPLE fails then S_m_sample_mapping_EMP should run.
Steps for creating workflow:
1. Workflow -> Create -> Give name wf_decision_task_example -> Click ok.
2. Drag s_m_filter_example and S_M_TOTAL_SAL_EXAMPLE to workspace and link both of them to
START task.
3. Click Tasks -> Create -> Select DECISION from list. Give name DECISION_Example. Click Create
and then done. Link DECISION_Example to both s_m_filter_example and
S_M_TOTAL_SAL_EXAMPLE.
4. Right click DECISION_Example-> EDIT -> GENERAL tab.
5. Set Treat Input Links As to OR. Default is AND. Apply and click OK.
6. Now edit decision task again and go to PROPERTIES Tab. Open the Expression editor by clicking
the VALUE section of Decision Name attribute and enter the following condition:
$S_M_FILTER_EXAMPLE.Status = SUCCEEDED OR $S_M_TOTAL_SAL_EXAMPLE.Status = SUCCEEDED
7. Validate the condition -> Click Apply -> OK.
8. Drag command task and S_m_sample_mapping_EMP task to workspace and link them to
DECISION_Example task.
9. Double click link between S_m_sample_mapping_EMP & DECISION_Example & give the
condition: $DECISION_Example.Condition = 0. Validate & click OK.
10.
Double click link between Command task and DECISION_Example and give the
condition: $DECISION_Example.Condition = 1. Validate and click OK.
11.
Workflow Validate and repository Save.
Run workflow and see the result.
CONTROL TASK
We can use the Control task to stop, abort, or fail the top-level workflow or the parent workflow
based on an input link condition.
A parent workflow or worklet is the workflow or worklet that contains the Control task.
We give the condition to the link connected to Control Task.
Control Option
Description
Fail Me
Fail Parent
Stop Parent
Abort Parent
Fail Top-Level WF
Stop Top-Level WF
Abort Top-Level WF
Example: Drag any 3 sessions and if anyone fails, then Abort the top level workflow.
Steps for creating workflow:
1. Workflow -> Create -> Give name wf_control_task_example -> Click ok.
2. Drag any 3 sessions to workspace and link all of them to START task.
3. Click Tasks -> Create -> Select CONTROL from list. Give name cntr_task.
4. Click Create and then done.
5. Link all sessions to the control task cntr_task.
6. Double click link between cntr_task and any session say s_m_filter_example and give the
condition: $S_M_FILTER_EXAMPLE.Status = SUCCEEDED.
7. Repeat above step for remaining 2 sessions also.
8. Right click cntr_task-> EDIT -> GENERAL tab. Set Treat Input Links As to OR. Default is AND.
9. Go to PROPERTIES tab of cntr_task and select the value Fail top level
10.
Workflow for Control Option. Click Apply and OK.
11.
Workflow Validate and repository Save.
Run workflow and see the result.
ASSIGNMENT TASK
The Assignment task allows us to assign a value to a user-defined workflow variable.
See Workflow variable topic to add user defined variables.
To use an Assignment task in the workflow, first create and add the
Assignment task to the workflow. Then configure the Assignment task to assign values or
expressions to user-defined variables.
12.
Click OK.
Scheduler
We can schedule a workflow to run continuously, repeat at a given time or interval, or we can
manually start a workflow. The Integration Service runs a scheduled workflow as configured.
By default, the workflow runs on demand. We can change the schedule settings by editing the
scheduler. If we change schedule settings, the Integration Service reschedules the workflow
according to the new settings.
A scheduler is a repository object that contains a set of schedule settings.
Scheduler can be non-reusable or reusable.
The Workflow Manager marks a workflow invalid if we delete the scheduler associated with the
workflow.
If we choose a different Integration Service for the workflow or restart the Integration Service, it
reschedules all workflows.
If we delete a folder, the Integration Service removes workflows from the schedule.
The Integration Service does not run the workflow if:
The prior workflow run fails.
We remove the workflow from the schedule
The Integration Service is running in safe mode
Creating a Reusable Scheduler
For each folder, the Workflow Manager lets us create reusable schedulers so we can reuse the
same set of scheduling settings for workflows in the folder.
Use a reusable scheduler so we do not need to configure the same set of scheduling settings in
each workflow.
When we delete a reusable scheduler, all workflows that use the deleted scheduler becomes
invalid. To make the workflows valid, we must edit them and replace the missing scheduler.
Steps:
Open the folder where we want to create the scheduler.
In the Workflow Designer, click Workflows > Schedulers.
Click Add to add a new scheduler.
In the General tab, enter a name for the scheduler.
Configure the scheduler settings in the Scheduler tab.
Click Apply and OK.
Configuring Scheduler Settings
Configure the Schedule tab of the scheduler to set run options, schedule options, start options,
1. Run on Demand:
Integration Service runs the workflow when we start the workflow manually.
2. Run Continuously:
Integration Service runs the workflow as soon as the service initializes. The Integration Service
then starts the next run of the workflow as soon as it finishes the previous run.
3. Run on Server initialization
Integration Service runs the workflow as soon as the service is initialized. The Integration Service
then starts the next run of the workflow according to settings in Schedule Options.
Schedule options for Run on Server initialization:
Run Once: To run the workflow just once.
Run every: Run the workflow at regular intervals, as configured.
Customized Repeat: Integration Service runs the workflow on the dates and times specified in
the Repeat dialog box.
Start options for Run on Server initialization:
Start Date
Start Time
scheduler
If we select Reusable, choose a reusable scheduler from the Scheduler
Browser dialog box.
Click Ok.
Points to Ponder:
To remove a workflow from its schedule, right-click the workflow in the Navigator window and
choose Unscheduled Workflow.
To reschedule a workflow on its original schedule, right-click the workflow in the Navigator window
and choose Schedule Workflow.
Pushdown Optimization Overview
You can push transformation logic to the source or target database using pushdown
optimization. When you run a session configured for pushdown optimization, the Integration
Service translates the transformation logic into SQL queries and sends the SQL queries
to the database. The source or target database executes the SQL queries to process the
transformations.
The amount of transformation logic you can push to the database depends on the database,
transformation logic, and mapping and session configuration. The Integration Service processes all
transformation logic that it cannot push to a database.
Use the Pushdown Optimization Viewer to preview the SQL statements and mapping logic
that the Integration Service can push to the source or target database. You can also use the
Pushdown Optimization Viewer to view the messages related to pushdown optimization.
The following figure shows a mapping containing transformation logic that can be pushed to
This mapping contains a Filter transformation that filters out all items except those with an
ID greater than 1005. The Integration Service can push the transformation logic to the database. It
generates the following SQL statement to process the transformation logic:
The Integration Service generates an INSERT SELECT statement to get the ID, NAME, and
DESCRIPTION columns from the source table. It filters the data using a WHERE clause. The
Integration Service does not extract data from the database at this time.
Pushdown Optimization Types
You can configure the following types of pushdown optimization:
Source-side pushdown optimization.
The Integration Service pushes as much
The Integration Service generates and executes an INSERT SELECT, DELETE, or UPDATE statement
for each database to which it pushes transformation logic.
For example, a mapping contains the following transformations:
The Rank transformation cannot be pushed to the source or target database. If you configure the
session for full pushdown optimization, the Integration Service pushes the Source Qualifier
transformation and the Aggregator transformation to the source, processes the Rank
transformation, and pushes the Expression transformation and target to the target database. The
Integration Service does not fail the session if it can push only part of the transformation logic to
the database.
The Integration Service and databases can produce different results when processing the same
transformation logic. The Integration Service sometimes converts data to a different format when
it reads data. The Integration Service and database may also handle null values, case sensitivity,
and sort order differently.
The database and Integration Service produce different output when the following settings and
conversions are different:
Nulls treated as the highest or
lowest value. The Integration Service
and a database can treat null values
differently. For example, you want to push
a Sorter transformation to an Oracle
database. In the session, you configure
nulls as the lowest value in the sort order.
Oracle treats null values as the highest
value in the sort order.
Sort order. The Integration Service and a
database can use different sort orders.
For example, you want to push the
transformations in a session to a Microsoft
SQL Server database, which is configured
to use a sort order that is not case
sensitive. You configure the session
properties to use the binary sort order,
which is case sensitive. The results differ
based on whether the Integration Service
or Microsoft SQL Server database process
the transformation logic.
Case sensitivity. The Integration Service
and a database can treat case sensitivity
differently. For example, the Integration
Service uses case sensitive queries and
the database does not. A Filter
transformation uses the following filter
condition: IIF(col_varchar2 = CA, TRUE,
FALSE). You need the database to return
rows that match CA. However, if you
push this transformation logic to a
Microsoft SQL Server database that is not
case sensitive, it returns rows that match
the values Ca, ca, cA, and CA.
Numeric values converted to
character values. The Integration
Service and a database can convert the
same numeric value to a character value
in different formats. The database can
convert numeric values to an
unacceptable character format. For
example, a table contains the number
1234567890. When the Integration
Service converts the number to a
character value, it inserts the characters
1234567890. However, a database
might convert the number to 1.2E9. The
two sets of characters represent the same
value. However, if you require the
characters in the format 1234567890,
you can disable pushdown optimization.
http://shan-informatica.blogspot.com/
Staging Area : it is the work place where raw data is brought in, cleaned, combined, archived and
exported to one or more data marts. The purpose of data staging area is to get data ready for loading
into a presentation layer.
Queries : The DWH contains 2 types of queries. There will be fixed queries that are clearly defined
and well understood, such as regular reports, canned queries and common aggregations.
There will also be ad hoc queries that are unpredictable, both in quantity and frequency.
Ad Hoc Query : are the starting point for any analysis into a database. The ability to run any query
when desired and expect a reasonable response that makes the data warehouse worthwhile and makes
the design such a significant challenge.
The end-user access tools are capable of automatically generating the database query that answers
any question posted by the user.
Canned Queries : are pre-defined queries. Canned queries contain prompts that allow you to
customize the query for your specific needs
Kimball (Bottom up) vs Inmon (Top down) approaches :
Acc. To Ralph Kimball, when you plan to design analytical solutions for an enterprise, try building data
marts. When you have 3 or 4 such data marts, you would be having an enterprise wide data warehouse
built up automatically without time and effort from exclusively spent on building the EDWH. Because
the time required for building a data mart is lesser than for an EDWH.
INMON : try to build an Enterprise wide Data warehouse first and all the data marts will be the subsets
of the EDWH. Acc. To him, independent data marts cannot make up an enterprise data warehouse
under any circumstance, but they will remain isolated pieces of information stove pieces
************************************************************************************************************************
Dimensional Data Model :
Dimensional data model is most often used in data warehousing systems. This is different from the 3rd normal
form, commonly used for transactional (OLTP) type systems. As you can imagine, the same data would then be
stored differently in a dimensional model than in a 3rd normal form model.
To understand dimensional data modeling, let's define some of the terms commonly used in this type of
modeling:
Dimension: A category of information. For example, the time dimension.
Attribute: A unique level within a dimension. For example, Month is an attribute in the Time Dimension.
Hierarchy: The specification of levels that represents relationship between different attributes within a
dimension. For example, one possible hierarchy in the Time dimension is Year --> Quarter --> Month --> Day.
Fact Table: A fact table is a table that contains the measures of interest. For example, sales amount would be
such a measure. This measure is stored in the fact table with the appropriate granularity. For example, it can
be sales amount by store by day. In this case, the fact table would contain three columns: A date column, a
store column, and a sales amount column.
Lookup Table: The lookup table provides the detailed information about the attributes. For example, the
lookup table for the Quarter attribute would include a list of all of the quarters available in the data
warehouse. Each row (each quarter) may have several fields, one for the unique ID that identifies the quarter,
and one or more additional fields that specifies how that particular quarter is represented on a report (for
example, first quarter of 2001 may be represented as "Q1 2001" or "2001 Q1").
A dimensional model includes fact tables and lookup tables. Fact tables connect to one or more lookup tables,
but fact tables do not have direct relationships to one another. Dimensions and hierarchies are represented by
lookup tables. Attributes are the non-key columns in the lookup tables.
In designing data models for data warehouses / data marts, the most commonly used schema types are Star
Schema and Snowflake Schema.
Star Schema: In the star schema design, a single object (the fact table) sits in the middle and is radially
connected to other surrounding objects (dimension lookup tables) like a star. A star schema can be simple or
complex. A simple star consists of one fact table; a complex star can have more than one fact table.
Snowflake Schema: The snowflake schema is an extension of the star schema, where each point of the star
explodes into more points. The main advantage of the snowflake schema is the improvement in query
performance due to minimized disk storage requirements and joining smaller lookup tables. The main
disadvantage of the snowflake schema is the additional maintenance efforts needed due to the increase
number of lookup tables.
Whether one uses a star or a snowflake largely depends on personal preference and business needs.
Personally, I am partial to snowflakes, when there is a business case to analyze the information at that
particular level.
Slowly Changing Dimensions:
The "Slowly Changing Dimension" problem is a common one particular to data warehousing. In a nutshell, this
applies to cases where the attribute for a record varies over time. We give an example below:
Christina is a customer with ABC Inc. She first lived in Chicago, Illinois. So, the original entry in the customer
lookup table has the following record:
Customer Key
Name
State
1001
Christina
Illinois
At a later date, she moved to Los Angeles, California on January, 2003. How should ABC Inc. now modify its
customer table to reflect this change? This is the "Slowly Changing Dimension" problem.
There are in general three ways to solve this type of problem, and they are categorized as follows:
Type 1: The new record replaces the original record. No trace of the old record exists.
Type 2: A new record is added into the customer dimension table. Therefore, the customer is treated
essentially as two people.
Type 3: The original record is modified to reflect the change.
We next take a look at each of the scenarios and how the data model and the data looks like for each of
them. Finally, we compare and contrast among the three alternatives.
Type 1 Slowly Changing Dimension:
In Type 1 Slowly Changing Dimension, the new information simply overwrites the original information. In other
words, no history is kept.
In our example, recall we originally have the following table:
Customer Key
1001
Name
Christina
State
Illinois
After Christina moved from Illinois to California, the new information replaces the new record, and we have
the following table:
Customer Key
Name
State
1001
Christina
California
Advantages:
- This is the easiest way to handle the Slowly Changing Dimension problem, since there is no need to keep
track of the old information.
Disadvantages:
- All history is lost. By applying this methodology, it is not possible to trace back in history. For example, in
this case, the company would not be able to know that Christina lived in Illinois before.
Usage:
About 50% of the time.
When to use Type 1:
Type 1 slowly changing dimension should be used when it is not necessary for the data warehouse to keep
track of historical changes.
Type 2 Slowly Changing Dimension:
In Type 2 Slowly Changing Dimension, a new record is added to the table to represent the new information.
Therefore, both the original and the new record will be present. The newe record gets its own primary key.
In our example, recall we originally have the following table:
Customer Key
Name
State
1001
Christina
Illinois
After Christina moved from Illinois to California, we add the new information as a new row into the table:
Customer Key
Name
State
1001
Christina
Illinois
1005
Christina
California
Advantages:
- This allows us to accurately keep all historical information.
Disadvantages:
- This will cause the size of the table to grow fast. In cases where the number of rows for the table is very
high to start with, storage and performance can become a concern.
- This necessarily complicates the ETL process.
Usage:
About 50% of the time.
When to use Type 2:
Type 2 slowly changing dimension should be used when it is necessary for the data warehouse to track
historical changes.
Type 3 Slowly Changing Dimension :
In Type 3 Slowly Changing Dimension, there will be two columns to indicate the particular attribute of
interest, one indicating the original value, and one indicating the current value. There will also be a column
that indicates when the current value becomes active.
In our example, recall we originally have the following table:
Customer Key
Name
State
1001
Christina
Illinois
To accomodate Type 3 Slowly Changing Dimension, we will now have the following columns:
Customer Key
Name
Original State
Current State
Effective Date
After Christina moved from Illinois to California, the original information gets updated, and we have the
following table (assuming the effective date of change is January 15, 2003):
Customer Key
Name
Original State
Illinois
Current State
California
Effective Date
1001
Christina
15-JAN-2003
Advantages:
- This does not increase the size of the table, since new information is updated.
- This allows us to keep some part of history.
Disadvantages:
- Type 3 will not be able to keep all history where an attribute is changed more than once. For example, if
Christina later moves to Texas on December 15, 2003, the California information will be lost.
Usage:
Type 3 is rarely used in actual practice.
When to use Type 3:
Type III slowly changing dimension should only be used when it is necessary for the data warehouse to track
historical changes, and when such changes will only occur for a finite number of time.
Surrogate key :
A surrogate key is frequently a sequential number but doesn't have to be. Having the key independent of all
other columns insulates the database relationships from changes in data values or database design and
guarantees uniqueness.
Some database designers use surrogate keys religiously regardless of the suitability of other candidate keys.
However, if a good key already exists, the addition of a surrogate key will merely slow down access,
particularly if it is indexed.
The concept of surrogate key is important in data warehouse ,surrogate means deputy or substitute.
surrogate key is a small integer(say 4 bytes)that can uniquely identify the record in the dimension
table.however it has no meaning data warehouse experts suggest that production key used in the databases
should not be used in the dimension tables as primary keys instead in there place the surrogate key have to
be used which are generated automatically.
At this level, the data modeler attempts to describe the data in as much detail as possible, without regard to
how they will be physically implemented in the database.
In data warehousing, it is common for the conceptual data model and the logical data model to be combined
into a single step (deliverable).
The steps for designing the logical data model are as follows:
1.
2.
3.
4.
5.
6.
At this level, the data modeler will specify how the logical data model will be realized in the database
schema.
The steps for physical data model design are as follows:
1.
2.
3.
4.
What Is OLAP :
OLAP stands for On-Line Analytical Processing. The first attempt to provide a definition to OLAP was by Dr.
Codd, who proposed 12 rules for OLAP. Later, it was discovered that this particular white paper was sponsored
by one of the OLAP tool vendors, thus causing it to lose objectivity. The OLAP Report has proposed the FASMI
test, Fast Analysis of Shared Multidimensional Information. For a more detailed description of both Dr. Codd's
rules and the FASMI test, please visit The OLAP Report.
For people on the business side, the key feature out of the above list is "Multidimensional." In other words,
the ability to analyze metrics in different dimensions such as time, geography, gender, product, etc. For
example, sales for the company is up. What region is most responsible for this increase? Which store in this
region is most responsible for the increase? What particular product category or categories contributed the
most to the increase? Answering these types of questions in order means that you are performing an OLAP
analysis.
Depending on the underlying technology used, OLAP can be braodly divided into two different camps: MOLAP
and ROLAP. A discussion of the different OLAP types can be found in the MOLAP, ROLAP, and HOLAP section.
In the OLAP world, there are mainly two different types: Multidimensional OLAP (MOLAP) and Relational OLAP
(ROLAP). Hybrid OLAP (HOLAP) refers to technologies that combine MOLAP and ROLAP.
MOLAP
This is the more traditional way of OLAP analysis. In MOLAP, data is stored in a multidimensional cube. The
storage is not in the relational database, but in proprietary formats.
Advantages:
Excellent performance: MOLAP cubes are built for fast data retrieval, and is optimal for slicing and
dicing operations.
Can perform complex calculations: All calculations have been pre-generated when the cube is
created. Hence, complex calculations are not only doable, but they return quickly.
Disadvantages:
Limited in the amount of data it can handle: Because all calculations are performed when the cube is
built, it is not possible to include a large amount of data in the cube itself. This is not to say that the
data in the cube cannot be derived from a large amount of data. Indeed, this is possible. But in this
case, only summary-level information will be included in the cube itself.
Requires additional investment: Cube technology are often proprietary and do not already exist in the
organization. Therefore, to adopt MOLAP technology, chances are additional investments in human
and capital resources are needed.
ROLAP
This methodology relies on manipulating the data stored in the relational database to give the appearance of
traditional OLAP's slicing and dicing functionality. In essence, each action of slicing and dicing is equivalent to
adding a "WHERE" clause in the SQL statement.
Advantages:
Can handle large amounts of data: The data size limitation of ROLAP technology is the limitation on
data size of the underlying relational database. In other words, ROLAP itself places no limitation on
data amount.
Can leverage functionalities inherent in the relational database: Often, relational database already
comes with a host of functionalities. ROLAP technologies, since they sit on top of the relational
database, can therefore leverage these functionalities.
Disadvantages:
Performance can be slow: Because each ROLAP report is essentially a SQL query (or multiple SQL
queries) in the relational database, the query time can be long if the underlying data size is large.
Limited by SQL functionalities: Because ROLAP technology mainly relies on generating SQL statements
to query the relational database, and SQL statements do not fit all needs (for example, it is difficult
to perform complex calculations using SQL), ROLAP technologies are therefore traditionally limited by
what SQL can do. ROLAP vendors have mitigated this risk by building into the tool out-of-the-box
complex functions as well as the ability to allow users to define their own functions.
HOLAP
HOLAP technologies attempt to combine the advantages of MOLAP and ROLAP. For summary-type information,
HOLAP leverages cube technology for faster performance. When detail information is needed, HOLAP can
"drill through" from the cube into the underlying relational data.
Bill Inmon vs. Ralph Kimball:
In the data warehousing field, we often hear about discussions on where a person / organization's philosophy
falls into Bill Inmon's camp or into Ralph Kimball's camp. We describe below the difference between the two.
Bill Inmon's paradigm: Data warehouse is one part of the overall business intelligence system. An enterprise
has one data warehouse, and data marts source their information from the data warehouse. In the data
warehouse, information is stored in 3rd normal form.
Ralph Kimball's paradigm: Data warehouse is the conglomerate of all data marts within the enterprise.
Information is always stored in the dimensional model.
There is no right or wrong between these two ideas, as they represent different data warehousing
philosophies. In reality, the data warehouse in most enterprises are closer to Ralph Kimball's idea. This is
because most data warehouses started out as a departmental effort, and hence they originated as a data
mart. Only when more data marts are built later do they evolve into a data warehouse.
********************************************************************************
******************** Shankar Prasad ****************************************
********************************************************************************
ports specified and can caculated aggregate functions like ( avg, sum, count,
stddev....etc) for each of those groups.
From a performance perspective if your mapping has an AGGREGATOR transform
use filters and sorters very early in the pipeline if there is any need for them.
Q. What are various types of Aggregation?
A. Various types of aggregation are SUM, AVG, COUNT, MAX, MIN, FIRST, LAST,
MEDIAN, PERCENTILE, STDDEV, and VARIANCE.
Q. What are Dimensions and various types of Dimension?
A. Dimensions are classified to 3 types.
1. SCD TYPE 1(Slowly Changing Dimension): this contains current data.
2. SCD TYPE 2(Slowly Changing Dimension): this contains current data +
complete historical data.
3. SCD TYPE 3(Slowly Changing Dimension): this contains current data.
+partially historical data
Q. What are 2 modes of data movement in Informatica Server?
A. The data movement mode depends on whether Informatica Server should
process single byte or multi-byte character data. This mode selection can affect
the enforcement of code page relationships and code page validation in the
Informatica Client and Server.
a) Unicode - IS allows 2 bytes for each character and uses additional byte for each
non-ascii character (such as Japanese characters)
b) ASCII - IS holds all data in a single byte
The IS data movement mode can be changed in the Informatica Server
configuration parameters. This comes into effect once you restart the Informatica
Server.
When the PowerCenter Server runs a session, the DTM performs the following
tasks:
1. Fetches session and mapping metadata from the repository.
2. Creates and expands session variables.
3. Creates the session log file.
4. Validates session code pages if data code page validation is enabled. Checks
query
conversions if data code page validation is disabled.
5. Verifies connection object permissions.
6. Runs pre-session shell commands.
7. Runs pre-session stored procedures and SQL.
8. Creates and runs mappings, reader, writer, and transformation threads to
extract, transform, and load data.
9. Runs post-session stored procedures and SQL.
10. Runs post-session shell commands.
11. Sends post-session email.
the master thread. The master thread creates and manages all other threads.
If we partition a session, the DTM creates a set of threads for each partition
to allow concurrent processing.. When Informatica server writes messages to the
session log it includes thread type and thread ID.
Following are the types of threads that DTM creates:
Master Thread - Main thread of the DTM process. Creates and manages all other
threads.
Mapping Thread - One Thread to Each Session. Fetches Session and Mapping
Information.
Pre and Post Session Thread - One Thread each to Perform Pre and Post Session
Operations.
Reader Thread - One Thread for Each Partition for Each Source Pipeline.
Writer Thread - One Thread for Each Partition if target exist in the source pipeline
write to the target.
Transformation Thread - One or More Transformation Thread For Each Partition.
Perform Calculation.
Update slowly changing dimension tables - We can use unconnected lookup
transformation to determine whether the records already exist in the target or
not.
Q. While importing the relational source definition from database, what
are the meta data of source U import?
Source name
Database location
Column names
Data types
Key constraints
Q. How many ways you can update a relational source
definition and what are they?
A.
Two ways
1. Edit the definition
2. Reimport the definition
Q. Where should you place the flat file to import the flat file
definition to the designer?
A.
Place it in local folder
Q. Which transformation should u need while using the Cobol sources as
source definitions?
A.
Normalizer transformation which is used to normalize the data. Since Cobol
sources r often consists of denormalized data.
Q. How can you create or import flat file definition in to the warehouse
designer?
A.
You can create flat file definition in warehouse designer. In the warehouse
designer, you can create a new target: select the type as flat file. Save it and u
can enter various columns for that created target by editing its properties. Once
the target is created, save it. You can import it from the mapping designer.
Q. What is a mapplet?
A.
A mapplet should have a mapplet input transformation which receives input
values, and an output transformation which passes the final modified data to back
to the mapping. Set of transformations where the logic can be reusable when the
mapplet is
displayed within the mapping only input & output ports are displayed so that the
internal logic is hidden from end-user point of view.
Q. What is a transformation?
Q. Between
What is meant
by lookup
caches? Lookups
Differences
Connected
and Unconnected
A. The
Informatica server builds a cache in memory when
it processesLookup
the first
Connected
Lookup
Unconnected
row of a data in a cached look up transformation. It allocates
memory
for thefrom the result
Receives
input values
based directly
on the amount
u pipeline.
configure in the transformation
session in another
Receives cache
input values
from the
of a :LKPorexpression
properties. The Informatica server stores condition values
in the index cache and
transformation.
output
values or
in static
the data
cache.
You can use
a dynamic
cache.
You can use a static cache.
Q. What
r the types
of used
lookup
caches?
Cache includes
all lookup
columns
in the
mapping (that
Cache includes all lookup/output
Persistent
cache:
U can in
save
lookup
cache and
files and reuse them the next
is, lookupA.
source
columns
included
the the
lookup
condition
ports in the lookup condition and the
time columns
the Informatica
server
processes
lookup transformation configured to use
lookup source
linked as
output
ports toaother
lookup/return port.
the cache.
transformations).
Can return multiple columns from the same row or insert into Designate one return port (R).
Recache
from
database: If the persistent cache is not Returns
synchronized
with the
the dynamic
lookup
cache.
one column
from each row.
table,
configure
the the
lookup
transformation to rebuild the lookup
If there islookup
no match
for you
the can
lookup
condition,
PowerCenter
If there is no match for the lookup
cache.
Server returns
the default value for all output ports. If you
condition, the PowerCenter Server
configure dynamic caching, the PowerCenter Server inserts
returns NULL.
cache:
U can configure
a static or read-only cache for only lookup table. By
rows into Static
the cache
or leaves
it unchanged.
Informatica
server
creates the
a static
cache. It caches the lookup table and
If there isdefault
a match
for the lookup
condition,
PowerCenter
If there is a match for the lookup
lookup
values
forcondition
each rowfor
that
Server returns
the
resultinofthe
thecache
lookup
allcomes into the transformation. When
condition, the PowerCenter Server
the lookup
is true,dynamic
the Informatica
lookup/output
ports. condition
If you configure
caching,server
the does not update the cache
returns the result of the lookup
while
it processes
the lookup
PowerCenter
Server
either updates
thetransformation.
row the in the cache or
condition into the return port.
leaves the row unchanged.
Dynamic cache: If you want to cache the target table and
new rows
into
Passinsert
one output
value
to another
cache and the target, you can create a look up transformation
to use dynamic
transformation.
The
Pass multiple output values to another transformation. Link
cache. The Informatica server dynamically inserts data
to the target table. port passes the
lookup/output/return
lookup/output ports to another transformation.
value to the transformation calling
Shared cache: U can share the lookup cache between :LKP
multiple
transactions. You
expression.
can share unnamed cache between transformations inDoes
the same
mapping.
not support
user-defined default
Supports user-defined default values.
values.
Q: What is a Mapping?
A: Mapping Represent the data flow between source and target
Q: What are the components must contain in Mapping?
A: Source definition, Transformation, Target Definition and Connectors
Q: What is Transformation?
A: Transformation is a repository object that generates, modifies, or passes data.
Transformation performs specific function. They are two types of transformations:
1. Active
Rows, which are affected during the transformation or can change the no of rows
that pass through it. Eg: Aggregator, Filter, Joiner, Normalizer, Rank, Router,
Source qualifier, Update Strategy, ERP Source Qualifier, Advance External
Procedure.
2. Passive
Does not change the number of rows that pass through it. Eg: Expression,
External Procedure, Input, Lookup, Stored Procedure, Output, Sequence
Generator, XML Source Qualifier.
Q: Which transformation can be overridden at the Server?
A: Source Qualifier and Lookup Transformations
Q: What is connected and unconnected Transformation and give
Examples?
Q: What are Options/Type to run a Stored Procedure?
A:
Normal: During a session, the stored procedure runs where the transformation
exists in the mapping on a row-by-row basis. This is useful for calling the stored
procedure for each row of data that passes through the mapping, such as running
a calculation against an input port. Connected stored procedures run only in
normal mode.
Pre-load of the Source. Before the session retrieves data from the source, the
stored procedure runs. This is useful for verifying the existence of tables or
performing joins of data in a temporary table.
Post-load of the Source. After the session retrieves data from the source, the
stored procedure runs. This is useful for removing temporary tables.
Pre-load of the Target. Before the session sends data to the target, the stored
procedure runs. This is useful for verifying target tables or disk space on the
target system.
Post-load of the Target. After the session sends data to the target, the stored
procedure runs. This is useful for re-creating indexes on the database.
It must contain at least one Input and one Output port.
Q: What kinds of sources and of targets can be used in Informatica?
A:
Sources may be Flat file, relational db or XML.
Target may be relational tables, XML or flat files.
Q: Transformations: What are the different transformations you have
worked with?
A:
Source Qualifier (XML, ERP, MQ)
Joiner
Expression
Lookup
Filter
Router
Sequence Generator
Aggregator
Update Strategy
Stored Proc
External Proc
Advanced External Proc
Rank
Normalizer
Q: What are active/passive transformations?
A: Passive transformations do not change the nos. of rows passing through it
whereas active transformation changes the nos. rows passing thru it.
Active: Filter, Aggregator, Rank, Joiner, Source Qualifier
Passive: Expression, Lookup, Stored Proc, Seq. Generator
Q: What are connected/unconnected transformations?
A:
Connected transformations are part of the mapping pipeline. The input and
output ports are connected to other transformations.
Unconnected transformations are not part of the mapping pipeline. They are
not linked in the map with any input or output ports. Eg. In Unconnected Lookup
you can pass multiple values to unconnected transformation but only one column
of data will be returned from the transformation. Unconnected: Lookup, Stored
Proc.
Q: In target load ordering, what do you order - Targets or Source
Qualifiers?
A: Source Qualifiers. If there are multiple targets in the mapping, which are
populated from multiple sources, then we can use Target Load ordering.
Q: Have you used constraint-based load ordering? Where do you set
this?
A: Constraint based loading can be used when you have multiple targets in the
mapping and the target tables have a PK-FK relationship in the database. It can be
set in the session properties. You have to set the Source Treat Rows as: INSERT
and check the box Constraint based load ordering in Advanced Tab.
Q: If you have a FULL file that you have to match and load into a
corresponding table, how will you go about it? Will you use Joiner
transformation?
A: Use Joiner and join the file and Source Qualifier.
Q: If you have 2 files to join, which file will you use as the master file?
A: Use the file with lesser nos. of records as master file.
Q: If a sequence generator (with increment of 1) is connected to (say) 3
targets and each target uses the NEXTVAL port, what value will each
target get?
A: Each target will get the value in multiple of 3.
Q: Have you used the Abort, Decode functions?
A: Abort can be used to Abort / stop the session on an error condition.
If the primary key column contains NULL, and you need to stop the session from
continuing then you may use ABORT function in the default value for the port. It
can be used with IIF and DECODE function to Abort the session.
Q: Have you used SQL Override?
A: It is used to override the default SQL generated in the Source Qualifier / Lookup
transformation.
truncation, etc.
Q: How did you handle runtime errors? If the session stops abnormally
how were you managing the reload process?
Q: Have you used pmcmd command? What can you do using this
command?
A: pmcmd is a command line program. Using this command
You can start sessions
Stop sessions
Recover session
Q: What are the two default repository user groups
A: Administrators and Public
Q: What are the Privileges of Default Repository and Extended
Repository user?
A:
Default Repository Privileges
o
Use Designer
o
Browse Repository
o
Create Session and Batches
Extended Repository Privileges
o
Session Operator
o
Administer Repository
o
Administer Server
o
Super User
Q: How many different locks are available for repository objects
A: There are five kinds of locks available on repository objects:
Read lock. Created when you open a repository object in a folder for which you
do not have write permission. Also created when you open an object with an
existing write lock.
Write lock. Created when you create or edit a repository object in a folder for
which you have write permission.
Execute lock. Created when you start a session or batch, or when the
Informatica Server starts a scheduled session or batch.
Fetch lock. Created when the repository reads information about repository
5.
What the active and passive transformations?
An active transformation changes the number of rows that pass through the
mapping.
1. Source Qualifier
2. Filter transformation
3. Router transformation
4. Ranker
5. Update strategy
6. Aggregator
7. Advanced External procedure
8. Normalizer
9. Joiner
Passive transformations do not change the number of rows that pass through the
mapping.
1. Expressions
2. Lookup
3. Stored procedure
4. External procedure
5. Sequence generator
6. XML Source qualifier
6.
What is a lookup transformation?
Used to look up data in a relational table, views, or synonym, The informatica
server queries the lookup table based on the lookup ports in the transformation. It
compares lookup transformation port values to lookup table column values based
on the lookup condition. The result is passed to other transformations and the
target.
Used to :
Get related value
Perform a calculation
Update slowly changing dimension tables.
Diff between connected and unconnected lookups. Which is better?
Connected :
Received input values directly from the pipeline
Can use Dynamic or static cache.
Cache includes all lookup columns used in the mapping
drag a COBOL source into the Mapping Designer Workspace, the Normaliser
transformation appears, creating input and output ports for every columns in the
source.
14. What is Source qualifier transformation?
When you add relational or flat file source definition to a mapping , you need to
connect to a source Qualifier transformation. The source qualifier represents the
records that the informatica server reads when it runs a session.
Join Data originating from the same source database.
Filter records when the Informatica server reads the source data.
Specify an outer join rather than the default inner join.
Specify sorted ports
Select only distinct values from the source
Create a custom query to issue a special SELECT statement for the Informatica
server to read the source data.
2. Sources
Set a filter transformation after each SQ and see the records are not through.
If the time taken is same then there is a problem.
You can also identify the Source problem by
Read Test Session where we copy the mapping with sources, SQ and remove
all transformations
and connect to file target. If the performance is same then there is a Source
bottleneck.
Using database query Copy the read query directly from the log. Execute the
query against the
source database with a query tool. If the time it takes to execute the query and
the time to fetch
the first row are significantly different, then the query can be modified using
optimizer hints.
Solutions:
Optimize Queries using hints.
Use indexes wherever possible.
3. Mapping
If both Source and target are OK then problem could be in mapping.
Add a filter transformation before target and if the time is the same then there
is a problem.
(OR) Look for the performance monitor in the Sessions property sheet and view
the counters.
Solutions:
If High error rows and rows in lookup cache indicate a mapping bottleneck.
Optimize Single Pass Reading:
Optimize Lookup transformation :
1. Caching the lookup table:
When caching is enabled the informatica server caches the lookup table
and queries the
cache during the session. When this option is not enabled the server
queries the lookup
table on a row-by row basis.
Static, Dynamic, Shared, Un-shared and Persistent cache
2. Optimizing the lookup condition
Whenever multiple conditions are placed, the condition with equality
sign should take
precedence.
3. Indexing the lookup table
session bottleneck.
You can identify a session bottleneck by using the performance details. The
informatica server
creates performance details when you enable Collect Performance Data on the
General Tab of
the session properties.
Performance details display information about each Source Qualifier, target
definitions, and
individual transformation. All transformations have some basic counters that
indicate the
Number of input rows, output rows, and error rows.
Any value other than zero in the readfromdisk and writetodisk counters for
Aggregate, Joiner,
or Rank transformations indicate a session bottleneck.
Low bufferInput_efficiency and BufferOutput_efficiency counter also
indicate a session
bottleneck.
Small cache size, low buffer memory, and small commit intervals can cause
session bottlenecks.
5. System (Networks)
18. How to improve the Session performance?
1 Run concurrent sessions
2 Partition session (Power center)
3. Tune Parameter DTM buffer pool, Buffer block size, Index cache size, data
cache size, Commit Interval, Tracing level (Normal, Terse, Verbose Init, Verbose
Data)
The session has memory to hold 83 sources and targets. If it is more, then DTM
can be increased.
The informatica server uses the index and data caches for Aggregate, Rank,
Lookup and Joiner
transformation. The server stores the transformed data from the above
transformation in the data
cache before returning it to the data flow. It stores group information for those
transformations in
index cache.
If the allocated data or index cache is not large enough to store the date, the
server stores the data
in a temporary disk file as it processes the session data. Each time the server
pages to the disk the
performance slows. This can be seen from the counters .
Since generally data cache is larger than the index cache, it has to be more than
the index.
4. Remove Staging area
5. Tune off Session recovery
6. Reduce error tracing
19. What are tracing levels?
Normal-default
Logs initialization and status information, errors encountered, skipped rows due to
transformation errors, summarizes session results but not at the row level.
Terse
Log initialization, error messages, notification of rejected data.
Verbose Init.
In addition to normal tracing levels, it also logs additional initialization
information, names of index and data files used and detailed transformation
statistics.
Verbose Data.
In addition to Verbose init, It records row level logs.
20. What is Slowly changing dimensions?
Slowly changing dimensions are dimension tables that have slowly increasing data
as well as updates to existing data.
21. What are mapping parameters and variables?
A mapping parameter is a user definable constant that takes up a value before
running a session. It can be used in SQ expressions, Expression transformation
etc.
Steps:
Define the parameter in the mapping designer - parameter & variables .
Use the parameter in the Expressions.
Define the values for the parameter in the parameter file.
A mapping variable is also defined similar to the parameter except that the value
of the variable is subjected to change.
It picks up the value in the following order.
1. From the Session parameter file
2. As stored in the repository object in the previous run.
3. As defined in the initial values in the designer.
4. Default values
Q. What are the output files that the Informatica server creates during
Rank transformation
Lookup transformation
Q. What is the difference between joiner transformation and source
qualifier transformation?
A. You can join heterogeneous data sources in joiner transformation which we
cannot do in source qualifier transformation.
Q. What is meant by lookup caches?
A. The Informatica server builds a cache in memory when it processes the first
row of a data in a cached look up transformation. It allocates memory for the
cache based on the amount you configure in the transformation or session
properties. The Informatica server stores condition values in the index cache and
output values in the data cache.
Q. What is meant by parameters and variables in Informatica and how it
is used?
A. Parameter: A mapping parameter represents a constant value that you can
define before running a session. A mapping parameter retains the same value
throughout the entire session.
Variable: A mapping variable represents a value that can change through the
session. Informatica Server saves the value of a mapping variable to the
repository at the end of each successful session run and uses that value the next
time you run the session
Q. What is target load order?
You specify the target load order based on source qualifiers in a mapping. If you
have multiple source qualifiers connected to multiple targets, you can define the
order in which Informatica server loads data into the targets
nformatica is a leading data integration software. The products of the company support
various enterprise-wide data integration and data quality solutions including data
warehousing, data migration, data consolidation, data synchronization, data governance,
master data management, and cross-enterprise data integration.
The important Informatica Components are:
Power
Power
Power
Power
Exchange
Center
Center Connect
Exchange
Power Channel
Metadata Exchange
Power Analyzer
Super Glue
This section will contain some useful tips and tricks for optimizing informatica performance.
This includes some of the real time problems or errors and way to troubleshoot them, best
prcatices etc.
Q1: Introduce Yourself.
Re: What is incremental aggregation and how it is done?
Answer When using incremental aggregation, you apply captured
#4
changes in the source to aggregate calculations in a
session. If the source changes only incrementally and you
can capture changes, you can configure the session to
process only those changes. This allows the Informatica
Server to update your target incrementally, rather than
forcing it to process the entire source and recalculate the
same calculations each time you run the session.
Current data
Short database transactions
Online update/insert/delete
Normalization is promoted
High volume transactions
Transaction recovery is necessary
OLAP
Current and historical data
Long database transactions
Batch update/insert/delete
Denormalization is promoted
Low volume transactions
Transaction recovery is not necessary
The Integration Service processes all input groups in parallel. The Integration Service concurrently reads
sources connected to the Union transformation and pushes blocks of data into the input groups of
the transformation. The Union transformation processes the blocks of data based on the order it receives the
blocks from the Integration Service.
You can connect heterogeneous sources to a Union transformation. The Union transformation merges sources
with matching ports and outputs the data from one output group with the same ports as the input groups.
In a star schema a dimension table will not have any parent table.
Whereas in a snow flake schema a dimension table will have one or more parent tables.
Hierarchies for the dimensions are stored in the dimensional table itself in star schema.
Whereas hierachies are broken into separate tables in snow flake schema. These hierachies helps to drill
down the data from topmost hierachies to the lowermost hierarchies.
You can also perform the following tasks to optimize the mapping:
1.
2.
3.
4.
5.
RE: Why did you use stored procedure in your ETL Appli...
Click Here to view complete document
hi
usage of stored procedure has the following advantages
1checks the status of the target database
2drops and recreates indexes
3determines if enough space exists in the database
4performs aspecilized calculation
=======================================
Stored procedure in Informatica will be useful to impose complex business rules.
======================================= static cache:
Dynamic cache:
create a Oracle source with how much ever column you want
and write the join query in SQL query override. But the
column order and data type should be same as in the SQL query.
DECODE FUNCTION YOU CAN FIND IN SQL BUT IIF FUNCTION IS NOT
IN SQL. DECODE FUNCTION WILL GIVE CLEAR READABILITY TO
UNDERSTAND THE LOGIC TO OTHER.
SQ is an active tramsformation. It performs one of the following task: to join data from the
same source database to filtr the rows when Power centre reads source data to perform an
outer join to select only distinct values from the source
In source qualifier transformatio a user can defined join conditons,filter the data and
eliminating the duplicates. The default source qualifier can over written by the above options,
this is known as SQL Override.
The source qualifier represents the records that the informatica server reads when it runs a
session.
When we add a relational or a flat file source definition to a mapping,we need to connect it to
a source qualifier transformation.The source qualifier transformation represents the records
that the informatica server reads when it runs a session.
How many dimension tables did you had in your project and name some dimensions
(columns)?
Product Dimension : Product Key, Product id, Product Type, Product name, Batch Number.
Distributor Dimension: Distributor key, Distributor Id, Distributor Location,
Customer Dimension : Customer Key, Customer Id, CName, Age, status, Address, Contact
Account Dimension : Account Key, Acct id, acct type, Location, Balance,
Standalone Repository : A repository that functions individually and this is unrelated to any
other repositories.
Global Repository : This is a centralized repository in a domain. This repository can contain
shared objects across the repositories in a domain. The objects are shared through global
shortcuts.
Local Repository : Local repository is within a domain and its not a global repository. Local
repository can connect to a global repository using global shortcuts and can use objects in its shared folders.
Versioned Repository : This can either be local or global repository but it allows version
control for the repository. A versioned repository can store multiple copies, or versions of an
object. This features allows to efficiently develop, test and deploy metadata in the
production environment.
Q. What is a code page?
A. A code page contains encoding to specify characters in a set of one or more languages. The
code page is selected based on source of the data. For example if source contains Japanese text
then the code page should be selected to support Japanese text.
When a code page is chosen, the program or application for which the code page is set, refers to a
specific set of data that describes the characters the application recognizes. This influences the
way that application stores, receives, and sends character data.
Q. Which all databases PowerCenter Server on Windows can connect to?
A. PowerCenter Server on Windows can connect to following databases:
IBM DB2
Informix
Microsoft Access
Microsoft Excel
Microsoft SQL Server
Oracle
Sybase
Teradata
IBM DB2
Informix
Oracle
Sybase
Teradata
Aggregator
Application Source Qualifier
Custom
Expression
External Procedure
Filter
Input
Joiner
Lookup
Normalizer
Output
Rank
Router
Sequence Generator
Sorter
Source Qualifier
Stored Procedure
Transaction Control
Union
Update Strategy
XML Generator
XML Parser
is stored as a metadata separate from any other mapping that uses the transformation. Whenever
any changes to a reusable transformation are made, all the mappings where the transformation is
used will be invalidated.
Q. What is update strategy and what are the options for update strategy?
A. Informatica processes the source data row-by-row. By default every row is marked to be inserted
in the target table. If the row has to be updated/inserted based on some logic Update Strategy
transformation is used. The condition can be specified in Update Strategy to mark the processed
row for update or insert.
Following options are available for update strategy :
DD_INSERT : If this is used the Update Strategy flags the row for insertion. Equivalent
numeric value of DD_INSERT is 0.
DD_UPDATE : If this is used the Update Strategy flags the row for update. Equivalent
numeric value of DD_UPDATE is 1.
DD_DELETE : If this is used the Update Strategy flags the row for deletion. Equivalent
numeric value of DD_DELETE is 2.
DD_REJECT : If this is used the Update Strategy flags the row for rejection. Equivalent
numeric value of DD_REJECT is 3.
The above query will give the desired results, but it might
be clearer to write the query using an anti-join:
SELECT d.department_name
FROM departments d
WHERE NOT EXISTS (SELECT NULL
FROM employees e
WHERE e.department_id = d.department_id)
ORDER BY d.department_name;
Re: Without using any transformations how u can load the data into target?
If you join two or more tables and then pull out about two columns from each table into the source qualifier and then just
pull out one column from the source qualifier into an Expression transformation and then do a generate SQL in the
source qualifier how many columns will show up in the generated SQL.
In a Type 1 mapping with one source and one target table what is the minimum number of update strategy
transformations to be used?
At what levels can you define parameter files and what is the order?
In a session log file where can you find the reader and the writer details?
For joining three heterogeneous tables how many joiner transformations are required?
Can you look up a flat file using Informatica?
While running a session what default files are created?
Describe the use of Materialized views and how are they different from a normal view.
Contributed by Mukherjee, Saibal (ETL Consultant)
Many readers are asking Wheres the answer? Well it will take some time before I get time to write it But there is no
reason to get upset The informatica help files should have all of these answers!
Posted in ETL Tools, Informatica, Informatica FAQs, Interview FAQs,Uncategorized | 26 Comments
This is going to be a very interesting topic for ETL & Data modelers who design processes/tables to load fact or
transactional data which keeps on changing between dates.
The table above shows an entity in the source system that contains time variant values but they dont change daily. The values are valid over a period of
time; then they change.
But for ETL developers or ETL leads the decision is already made so lets look
for a solution.
2. What should be the ETL design to load such a structure?
Design A
There is one to one relationship between the source row and the target row.
There is a CURRENT_FLAG attribute, that means every time the ETL process get a new value it has add a new row
with current flag and go to the previous row and retire it. Now this step is a very costly ETL step it will slow down the ETL
process.
From the report writer issue this model is a major challange to use. Because what if the report wants a rate which
is not current. Imagine the complex query.
Design B
In this design the sanpshot of the source table is taken every day.
The ETL is very easy. But can you imagine the size of fact table when the source which has more than 1 million
rows in the source table. (1 million x 365 days = ? rows per year). And what if the change in values are in hours or
minutes?
But you have a very happy user who can write SQL reports very easily.
Design C
Can there be a comprimise. How about using from date (time) to date (time)!
provide a date (time) and the straight SQL can return a value/row that was valid at that moment.
However the ETL is indeed complex as the A model. Because while the current row will be from current date toinfinity. The previous row has to be retired to from date to todays date -1.
This kind of ETL coding also creates lots of testing issues as you want to make sure that for nay given date and
time only one instance of the row exists (for the primary key).
Which design is better, I have used all depending on the situtation.
3. What should be the unit test plan?
There are various cases where the ETL can miss and when planning for test cases and your plan should be to precisely test those. Here are some examples
of test plans
a. There should be only one value for a given date/date time
b. During the initial load when the data is available for multiple days the process should go sequential and create snapshots/ranges correctly.
c. At any given time there should be only one current row .
d. etc
1.Can 2 Fact Tables share same dimensions Tables? How many Dimension tables are associated
with one Fact Table ur project?
Ans: Yes
2.What is ROLAP, MOLAP, and DOLAP...?
Ans: ROLAP (Relational OLAP), MOLAP (Multidimensional OLAP), and DOLAP (Desktop OLAP). In
these three OLAP
architectures, the interface to the analytic layer is typically the same; what is quite different
is how the data is physically stored.
In MOLAP, the premise is that online analytical processing is best implemented by storing
the data multidimensionally; that is,
data must be stored multidimensionally in order to be viewed in a multidimensional manner.
In ROLAP, architects believe to store the data in the relational model; for instance, OLAP
single
The data corresponding to any combination of dimension members can be retrieved with a
I/O.
Data is clustered compactly in a multidimensional array.
Values are caluculated ahead of time.
The index is small and can therefore usually reside completely in memory.
have a several fact tables that require a series of dimension keys, you can create a mapplet
containing a series of Lookup
transformations to find each dimension key. You can then use the mapplet in each fact table
mapping, rather than recreate the
same lookup logic in each mapping.
To create a new mapplet:
1. In the Mapplet Designer, choose Mapplets-Create Mapplet.
2. Enter a descriptive mapplet name.
The recommended naming convention for mapplets is mpltMappletName.
3. Click OK.
The Mapping Designer creates a new mapplet in the Mapplet Designer.
4. Choose Repository-Save.
6. What for is the transformations are used?
Ans: Transformations are the manipulation of data from how it appears in the source system(s)
into another form in the data
warehouse or mart in a way that enhances or simplifies its meaning. In short, u transform
data into information.
This includes Datamerging, Cleansing, Aggregation: Datamerging: Process of standardizing data types and fields. Suppose one source system
calls integer type data as smallint
where as another calls similar data as decimal. The data from the two source systems needs
to rationalized when moved into
the oracle data format called number.
Cleansing: This involves identifying any changing inconsistencies or inaccuracies.
Eliminating inconsistencies in the data from multiple sources.
Converting data from different systems into single consistent data set suitable for
analysis.
Meets a standard for establishing data elements, codes, domains, formats and
naming conventions.
Correct data errors and fills in for missing data values.
Aggregation: The process where by multiple detailed values are combined into a single
summary value typically summation numbers representing dollars spend or units sold.
Generate summarized data for use in aggregate fact and dimension tables.
Data Transformation is an interesting concept in that some transformation can occur
during the extract, some during the
transformation, or even in limited cases--- during load portion of the ETL process. The
type of transformation function u
need will most often determine where it should be performed. Some transformation functions
could even be performed in more
than one place. Bze many of the transformations u will want to perform already exist in
To import an Excel source definition, you need to complete the following tasks:
Install the Microsoft Excel ODBC driver on your system.
Create a Microsoft Excel ODBC data source for each source file in the ODBC 32-bit
Administrator.
Ans: The data warehouse will contain two types of query. There will be fixed queries that are
clearly defined and well understood, such as regular reports, canned queries (standard
reports) and common aggregations. There will also be ad hoc queries that are unpredictable,
both in quantity and frequency.
Ad Hoc Query: Ad hoc queries are the starting point for any analysis into a database. Any
business analyst wants to know what is inside the database. He then proceeds by calculating
totals, averages, maximum and minimum values for most attributes within the database. These
are unpredictable element of a data warehouse. It is exactly that ability to run any query when
desired and expect a reasonable response that makes the data warhouse worthwhile, and makes
the design such a significant challenge.
The end-user access tools are capable of automatically generating the database query that
answers any Question posed by the user. The user will typically pose questions in terms that they
are familier with (for example, sales by store last week); this is converted into the database
query by the access tool, which is aware of the structure of information within the data
warehouse.
Canned queries: Canned queries are predefined queries. In most instances, canned queries
contain prompts that allow you to customize the query for your specific needs. For example, a
prompt may ask you for a School, department, term, or section ID. In this instance you would
enter the name of the School, department or term, and the query will retrieve the specified data
from the Warehouse.You can measure resource requirements of these queries, and the results can
be used for capacity palnning and for database design.
The main reason for using a canned query or report rather than creating your own is that your
chances of misinterpreting data or getting the wrong answer are reduced. You are assured of
getting the right data and the right answer.
12. How many Fact tables and how many dimension tables u did? Which table precedes what?
Ans: http://www.ciobriefings.com/whitepapers/StarSchema.asp
13. What is the difference between STAR SCHEMA & SNOW FLAKE SCHEMA?
Ans: http://www.ciobriefings.com/whitepapers/StarSchema.asp
14. Why did u choose STAR SCHEMA only? What are the benefits of STAR SCHEMA?
Ans: Because its denormalized structure , i.e., Dimension Tables are denormalized. Why to
denormalize means the first (and often
only) answer is : speed. OLTP structure is designed for data inserts, updates, and deletes,
but not data retrieval. Therefore,
we can often squeeze some speed out of it by denormalizing some of the tables and having
queries go against fewer tables.
These queries are faster because they perform fewer joins to retrieve the same recordset.
Joins are also confusing to many
End users. By denormalizing, we can present the user with a view of the data that is far
easier for them to understand.
- SAS Dataset
- Graphic files (eg., *.gif, *.jpg, *.bmp, etc.)
- Microsoft Office documents (*.doc, *.xls, etc.)
(iii): Yes. If u r using Windows, u can access a text-based FTP utility from a DOS prompt.
To do this, perform the following steps:
1.
2.
You cannot concatenate ports from more than one transformation into the Filter
transformation; the input ports for the filter
must come from a single transformation. Filter transformations exist within the flow of the
mapping and cannot be
unconnected. The Filter transformation does not allow setting output default values.
19.What are default sources which will supported by Informatica Powermart ?
Ans :
20. When do u create the Source Definition ? Can I use this Source Defn to any Transformation?
Ans: When working with a file that contains fixed-width binary data, you must create the
source definition.
The Designer displays the source definition as a table, consisting of names, datatypes, and
constraints. To use a source
definition in a mapping, connect a source definition to a Source Qualifier or Normalizer
transformation. The Informatica
Server uses these transformations to read the source data.
21. What is Active & Passive Transformation ?
Ans: Active and Passive Transformations
Transformations can be active or passive. An active transformation can change the
number of records passed through it. A
passive transformation never changes the record count.For example, the Filter
transformation removes rows that do not
meet the filter condition defined in the transformation.
Active transformations that might change the record count include the following:
/*
You can connect only one of these active transformations to the same
transformation or target, since the Informatica
Server cannot determine how to concatenate data from different sets of records with
different numbers of rows.
*/
Passive transformations that never change the record count include the following:
Lookup
Expression
External Procedure
Sequence Generator
Stored Procedure
Update Strategy
You can connect any number of these passive transformations, or connect one active
transformation with any number of
passive transformations, to the same transformation or target.
22. What is staging Area and Work Area?
Ans: Staging Area : - Holding Tables on DW Server.
- Loaded from Extract Process
- Input for Integration/Transformation
- May function as Work Areas
- Output to a work area or Fact Table
Work Area: - Temporary Tables
- Memory
23. What is Metadata? (plz refer DATA WHING IN THE REAL WORLD BOOK page # 125)
Ans: Defn: Data About Data
Metadata contains descriptive data for end users. In a data warehouse the term metadata is
used in a number of different
situations.
Metadata is used for:
Data management
Query management
Data transformation and load:
Metadata may be used during data transformation and load to describe the source data and any
changes that need to be made. The advantage of storing metadata about the data being
transformed is that as source data changes the changes can be captured in the metadata, and
transformation programs automatically regenerated.
For each source data field the following information is reqd:
Source Field:
Unique identifier (to avoid any confusion occurring betn 2 fields of the same anme from
different sources).
Location
- system ( system it comes from ex.Accouting system).
- object ( object that contains it ex. Account Table).
The destination field needs to be described in a similar way to the source:
Destination:
Unique identifier
Name
Type (database data type, such as Char, Varchar, Number and so on).
Transformation (s)
- Name
- Language (name of the lanjuage that transformation is written in).
- module name
- syntax
The Name is the unique identifier that differentiates this from any other similar transformations.
The Language attribute contains the name of the lnguage that the transformation is written
in.
The other attributes are module name and syntax. Generally these will be mutually exclusive,
with only one being defined. For simple transformations such as simple SQL functions the
syntax will be stored. For complex transformations the name of the module that contains the
code is stored instead.
Data management:
Metadata is reqd to describe the data as it resides in the data warehouse.This is needed by the
warhouse manager to allow it to track and control all data movements. Every object in the
database needs to be described.
Tables
- Columns
- name
- type
Indexes
- Columns
- name
- type
Views
- Columns
- name
- type
Constraints
- name
- type
- table
- columns
Aggregations, Partition information also need to be stored in Metadata( for details refer page
# 30)
Query Generation:
Metadata is also required by the query manger to enable it to generate queries. The same
metadata can be used by the Whouse manager to describe the data in the data warehouse is also
reqd by the query manager.
The query mangaer will also generate metadata about the queries it has run. This metadata
can be used to build a history of all quries run and generate a query profile for each user,
group of users and the data warehouse as a whole.
The metadata that is reqd for each query is:
- query
- tables accessed
- columns accessed
- name
- refence identifier
- restrictions applied
- column name
- table name
- reference identifier
- restriction
- join Criteria applied
group
by
criteria
sort
criteria
syntax
execution plan
resources
25. What are the tasks that are done by Informatica Server?
Ans:The Informatica Server performs the following tasks:
Ans: Target Load Order: - In the Designer, you can set the order in which the
Informatica Server sends records to various target
definitions in a mapping. This feature is crucial if you want to maintain
referential integrity when inserting, deleting, or updating
records in tables that have the primary key and foreign key constraints
applied to them. The Informatica Server writes data to
all the targets connected to the same Source Qualifier or Normalizer
simultaneously, to maximize performance.
28. (ii) What are the minimim condition that u need to have so as to use Targte Load Order Option
in Designer?
Ans: U need to have Multiple Source Qualifier transformations.
To specify the order in which the Informatica Server sends data to targets, create one Source
Qualifier or Normalizer
transformation for each target within a mapping. To set the target load order, you then
determine the order in which each
Source Qualifier sends data to connected targets in the mapping.
When a mapping includes a Joiner transformation, the Informatica Server sends all
records to targets connected to that
Joiner at the same time, regardless of the target load order.
28(iii). How do u set the Target load order?
Ans: To set the target load order:
1. Create a mapping that contains multiple Source Qualifier transformations.
2. After you complete the mapping, choose Mappings-Target Load Plan.
A dialog box lists all Source Qualifier transformations in the mapping, as well as the
targets that receive data from each
Source Qualifier.
3. Select a Source Qualifier from the list.
4. Click the Up and Down buttons to move the Source Qualifier within the load order.
5. Repeat steps 3 and 4 for any other Source Qualifiers you wish to reorder.
6. Click OK and Choose Repository-Save.
29. What u can do with Repository Manager?
Ans: We can do following tasks using Repository Manager : To create usernames, you must have one of the following sets of privileges:
- Administer Repository privilege
- Super User privilege
To create a user group, you must have one of the following privileges :
- Administer Repository privilege
- Super User privilege
To assign or revoke privileges , u must hv one of the following privilege..
- Administer Repository privilege
- Super User privilege
Note: You cannot change the privileges of the default user groups or the default repository
users.
30. What u can do with Designer ?
Ans: The Designer client application provides five tools to help you create mappings:
Source Analyzer. Use to import or create source definitions for flat file, Cobol, ERP, and
relational sources.
Warehouse Designer. Use to import or create target definitions.
Transformation Developer. Use to create reusable transformations.
Mapplet Designer. Use to create mapplets.
Mapping Designer. Use to create mappings.
Note:The Designer allows you to work with multiple tools at one time. You can also work in
multiple folders and repositories
31. What are different types of Tracing Levels u hv in Transformations?
Ans: Tracing Levels in Transformations :Level
Description
Terse
Indicates when the Informatica Server initializes the session and its
components. Summarizes session results, but not at the level of individual
records.
Normal
Verbose initialization Includes all information provided with the Normal setting plus more
extensive information about initializing transformations in the session.
Verbose data
31(i). What the difference is between a database, a data warehouse and a data mart?
Ans: -- A database is an organized collection of information.
-- A data warehouse is a very large database with special sets of tools to extract and
cleanse data from operational systems
and to analyze data.
-- A data mart is a focused subset of a data warehouse that deals with a single area of data
and is organized for quick
analysis.
32. What is Data Mart, Data WareHouse and Decision Support System explain briefly?
Ans: Data Mart:
A data mart is a repository of data gathered from operational data and other sources that is
designed to serve a particular
community of knowledge workers. In scope, the data may derive from an enterprise-wide
database or data warehouse or be more specialized. The emphasis of a data mart is on
meeting the specific demands of a particular group of knowledge users in terms of analysis,
content, presentation, and ease-of-use. Users of a data mart can expect to have data presented in
terms that are familiar.
In practice, the terms data mart and data warehouse each tend to imply the presence of the other
in some form. However, most writers using the term seem to agree that the design of a data
mart tends to start from an analysis of user needs and that a data warehouse tends to
start from an analysis of what data already exists and how it can be collected in such a
way that the data can later be used. A data warehouse is a central aggregation of data (which
can be distributed physically); a data mart is a data repository that may derive from a data
warehouse or not and that emphasizes ease of access and usability for a particular designed
purpose. In general, a data warehouse tends to be a strategic but somewhat unfinished concept;
a data mart tends to be tactical and aimed at meeting an immediate need.
Data Warehouse:
A data warehouse is a central repository for all or significant parts of the data that an
enterprise's various business systems collect. The term was coined by W. H. Inmon. IBM
sometimes uses the term "information warehouse."
Typically, a data warehouse is housed on an enterprise mainframe server. Data from various
online transaction processing (OLTP) applications and other sources is selectively extracted and
organized on the data warehouse database for use by analytical applications and user queries.
Data warehousing emphasizes the capture of data from diverse sources for useful analysis and
access, but does not generally start from the point-of-view of the end user or knowledge worker
who may need access to specialized, sometimes local databases. The latter idea is known as the
data mart.
data mining, Web mining, and a decision support system (DSS) are three kinds of
applications that can make use of a data warehouse.
Decision Support System:
A decision support system (DSS) is a computer program application that analyzes business data
and presents it so that users can make business decisions more easily. It is an "informational
application" (in distinction to an "operational application" that collects the data in the course of
normal business operation).
Typical information that a decision support application might gather and present would
be:
Comparative sales figures between one week and the next
Projected revenue figures based on new product sales assumptions
The consequences of different decision alternatives, given past experience in a context that is
described
A decision support system may present information graphically and may include an expert system
or artificial intelligence (AI). It may be aimed at business executives or some other group of
knowledge workers.
33. What r the differences between Heterogeneous and Homogeneous?
Ans: Heterogeneous
Homogeneous
Common structure
34. How do you use DDL commands in PL/SQL block ex. Accept table name from user and drop it,
if available else display msg?
Ans: To invoke DDL commands in PL/SQL blocks we have to use Dynamic SQL, the Package
used is DBMS_SQL.
35. What r the steps to work with Dynamic SQL?
Ans: Open a Dynamic cursor, Parse SQL stmt, Bind i/p variables (if any), Execute SQL stmt of
Dynamic Cursor and
Close the Cursor.
36. Which package, procedure is used to find/check free space available for db objects like
table/procedures/views/synonymsetc?
Ans: The Package
The Procedure
The Table
is DBMS_SPACE
is UNUSED_SPACE
is DBA_OBJECTS
41(ii). What r the differences between Connected lookups and Unconnected lookups?
Ans:
Although both types of lookups perform the same basic task, there are some
important differences:
----------------------------------------------------------------------------------------------------------------------------Connected Lookup
Unconnected Lookup
---------------------------------------------------------------
transformation.
Supports default values.
the server
server returns the default value for all output ports.
More visible. Shows the data passing in and out
returns NULL.
Less visible. You write an expression using
:LKP to tell
of the lookup.
Cache includes all lookup columns used in the
Lookup condition
mapping (that is, lookup table columns included
||' '||OPTIONS
5 FROM PLAN_TABLE
6 START WITH ID = 0 AND STATEMENT_ID = 'PKAR02'
7 CONNECT BY PRIOR ID = PARENT_ID
8 AND STATEMENT_ID = 'PKAR02'
9 ORDER BY ID;
STEP_DESCRIPTION
---------------------------------------------------0 SELECT STATEMENT
1
2
FILTER
SORT GROUP BY
Choose Repository-Save.
Repository Copying: You can copy a repository from one database to another. You use this
feature before upgrading, to
preserve the original repository. Copying repositories provides a quick way to copy all
metadata you want to use as a basis for
a new repository.
If the database into which you plan to copy the repository contains an existing repository, the
Repository Manager deletes the existing repository. If you want to preserve the old repository,
cancel the copy. Then back up the existing repository before copying the new repository.
To copy a repository, you must have one of the following privileges:
Description
----------------------------------------------------------------------------------------------------------
Repository
Required
repository name must be unique within
other repositories.
Database Username
Required
database. This login must have the
5. If asked whether you want to delete an existing repository data in the second repository,
click OK to delete it. Click Cancel to preserve the existing repository.
Copying Sessions:
In the Server Manager, you can copy stand-alone sessions within a folder, or copy sessions in and
out of batches.
To copy a session, you must have one of the following:
Create Sessions and Batches privilege with read and write permission
you ensure each use of the shortcut exactly matches the original object. For example, if you
have a shortcut to a target
definition, and you add a column to the definition, the shortcut automatically inherits the
additional column.
Shortcuts allow you to reuse an object without creating multiple objects in the repository. For
example, you use a source
definition in ten mappings in ten different folders. Instead of creating 10 copies of the same
source definition, one in each
folder, you can create 10 shortcuts to the original source definition.
You can create shortcuts to objects in shared folders. If you try to create a shortcut to a nonshared folder, the Designer
creates a copy of the object instead.
You can create shortcuts to the following repository objects:
Source definitions
Reusable transformations
Mapplets
Mappings
Target definitions
Business components
You can create two types of shortcuts:
Local shortcut. A shortcut created in the same repository as the original object.
Global shortcut. A shortcut created in a local repository that references an object in a global
repository.
Advantages: One of the primary advantages of using a shortcut is maintenance. If you need
to change all instances of an
object, you can edit the original repository object. All shortcuts accessing the object
automatically inherit the changes.
Shortcuts have the following advantages over copied repository objects:
You can maintain a common repository object in a single location. If you need to edit the
object, all shortcuts immediately inherit the changes you make.
You can restrict repository users to a set of predefined metadata by asking users to
incorporate the shortcuts into their work instead of developing repository objects independently.
You can develop complex mappings, mapplets, or reusable transformations, then reuse
them easily in other folders.
You can save space in your repository by keeping a single repository object and using
shortcuts to that object, instead of creating copies of the object in multiple folders or multiple
repositories.
48. What are Pre-session and Post-session Options?
(Plzz refer Help Using Shell Commands n Post-Session Commands and Email)
Ans: The Informatica Server can perform one or more shell commands before or after the
session runs. Shell commands are
operating system commands. You can use pre- or post- session shell commands, for
example, to delete a reject file or
session log, or to archive target files before the session begins.
The status of the shell command, whether it completed successfully or failed, appears in
the session log file.
To call a pre- or post-session shell command you must:
1.
Use any valid UNIX command or shell script for UNIX servers, or any valid DOS or batch file
for Windows NT servers.
2.
Configure the session to execute the pre- or post-session shell commands.
You can configure a session to stop if the Informatica Server encounters an error while executing
pre-session shell commands.
For example, you might use a shell command to copy a file from one directory to another. For a
Windows NT server you would use the following shell command to copy the SALES_ ADJ file
from the target directory, L, to the source, H:
copy L:\sales\sales_adj H:\marketing\
For a UNIX server, you would use the following command line to perform a similar operation:
cp sales/sales_adj marketing/
Tip: Each shell command runs in the same environment (UNIX or Windows NT) as the Informatica
Server. Environment settings in one shell command script do not carry over to other scripts. To
run all shell commands in the same environment, call a single shell script that in turn invokes
other scripts.
49. What are Folder Versions?
Ans: In the Repository Manager, you can create different versions within a folder to help you
archive work in development. You can copy versions to other folders as well. When you save a
version, you save all metadata at a particular point in development. Later versions contain new or
modified metadata, reflecting work that you have completed since the last version.
Maintaining different versions lets you revert to earlier work when needed. By archiving the
contents of a folder into a version each time you reach a development landmark, you can access
those versions if later edits prove unsuccessful.
You create a folder version after completing a version of a difficult mapping, then continue
working on the mapping. If you are unhappy with the results of subsequent work, you can revert
to the previous version, then create a new version to continue development. Thus you keep the
landmark version intact, but available for regression.
Note: You can only work within one version of a folder at a time.
50. How do automate/schedule sessions/batches n did u use any tool for automating
Sessions/batch?
Ans: We scheduled our sessions/batches using Server Manager.
You can either schedule a session to run at a given time or interval, or you can manually
start the session.
U needto hv create sessions n batches with Read n Execute permissions or super user
privilege.
If you configure a batch to run only on demand, you cannot schedule it.
Note: We did not use any tool for automation process.
51. What are the differences between 4.7 and 5.1 versions?
Ans: New Transformations added like XML Transformation and MQ Series Transformation, and
PowerMart and PowerCenter both
are same from 5.1version.
52. What r the procedure that u need to undergo before moving Mappings/sessions from
Testing/Development to Production?
Ans:
53. How many values it (informatica server) returns when it passes thru Connected Lookup n
Unconncted Lookup?
Ans: Connected Lookup can return multiple values where as Unconnected Lookup will return only
one values that is Return Value.
54. What is the difference between PowerMart and PowerCenter in 4.7.2?
Ans: If You Are Using PowerCenter
PowerCenter allows you to register and run multiple Informatica Servers against the same
repository. Because you can run
these servers at the same time, you can distribute the repository session load across available
servers to improve overall
performance.
With PowerCenter, you receive all product functionality, including distributed metadata, the
ability to organize repositories into
a data mart domain and share metadata across repositories.
A PowerCenter license lets you create a single repository that you can configure as a global
repository, the core component
of a data warehouse.
If You Are Using PowerMart
This version of PowerMart includes all features except distributed metadata and multiple
registered servers. Also, the various
options available with PowerCenter (such as PowerCenter Integration Server for BW,
PowerConnect for IBM DB2,
PowerConnect for SAP R/3, and PowerConnect for PeopleSoft) are not available with PowerMart.
------------------------
Task
----------------Calculate a value
Perform an aggregate calculations
Transformation
-----------------------Expression
Aggregator
Modify text
Expression
Filter records
Stored Procedure
External Procedure
Sequence Generator
Rank
Normalizer
Lookup
Update Strategy
or reject records
Join records from different databases
Joiner
------------------------------------------
Transformation
--------------------Expression
Aggregator
Filter
using an expression.
Rank
Update Strategy
In each transformation, you use the Expression Editor to enter the expression. The Expression
Editor supports the transformation language for building expressions. The transformation
language uses SQL-like functions, operators, and other components to build the expression.
For example, as in SQL, the transformation language includes the functions COUNT and SUM.
However, the PowerMart/PowerCenter transformation language includes additional functions
not found in SQL.
When you enter the expression, you can use values available through ports. For example, if
the transformation has two input ports representing a price and sales tax rate, you can
calculate the final sales tax using these two values. The ports used in the expression can
appear in the same transformation, or you can use output ports in other transformations.
57. In case of Flat files (which comes thru FTP as source) has not arrived then what happens?
Where do u set this option?
Ans: U get an fatel error which cause server to fail/stop the session.
U can set Event-Based Scheduling Option in Session Properties under General tab->Advanced options..
----------------------------------Event-Based
Required/ Optional
-----------------------------------Indicator File to Wait For
Optional
scheduling. Enter the indicator file
-----------------Description
-----------------Required to use event-based
Ans: When testing sessions in development, you may not need to process the entire source. If
this is true, use the Test Load
Option(Session Properties General Tab Target Options Choose Target Load options as
Normal (option button), with
Test Load cheked (Check box) and No.of rows to test ex.2000 (Text box with Scrolls)). You
can also click the Start button.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------59. SCD Type 2 and SGT difference?
60. Differences between 4.7 and 5.1?
61. Tuning Informatica Server for improving performance? Performance Issues?
Ans: See /* C:\pkar\Informatica\Performance Issues.doc */
62. What is Override Option? Which is better?
63. What will happen if u increase buffer size?
64. what will happen if u increase commit Intervals? and also decrease commit Intervals?
65. What kind of Complex mapping u did? And what sort of problems u faced?
66. If u have 10 mappings designed and u need to implement some changes(may be in existing
mapping or new mapping need to
be designed) then how much time it takes from easier to complex?
67. Can u refresh Repository in 4.7 and 5.1? and also can u refresh pieces (partially) of repository
in 4.7 and 5.1?
68. What is BI?
Ans: http://www.visionnet.com/bi/index.shtml
69. Benefits of BI?
Ans: http://www.visionnet.com/bi/bi-benefits.shtml
70. BI Faq
Ans: http://www.visionnet.com/bi/bi-faq.shtml
71. What is difference between data scrubbing and data cleansing?
Ans: Scrubbing data is the process of cleaning up the junk in legacy data and making it accurate
and useful for the next generations
of automated systems. This is perhaps the most difficult of all conversion activities. Very
Let us assume that the source system is a Relational Database . The source table is having duplicate
rows. Now to eliminate duplicate records, we can check the Distinct option of the Source Qualifier of
the source table and load the target accordingly.
Source Qualifier Transformation DISTINCT clause
Maths
100
75
80
Subject Name
Maths
Life Science
Physical Science
Maths
Life Science
Physical Science
Maths
Life Science
Physical Science
Ans.
Here to convert the Rows to Columns we have to use the Normalizer Transformation followed by an
Expression Transformation to Decode the column taken into consideration. For more details on how the
mapping is performed please visit Working with Normalizer
Q4. Name the transformations which converts one to many rows i.e increases the i/p:o/p row count.
Also what is the name of its reverse transformation.
Ans.
Normalizer as well as Router Transformations are the Active transformation which can increase the
number of input rows to output rows.
Aggregator Transformation is the active transformation that performs the reverse action.
Q5. Suppose we have a source table and we want to load three target tables based on source rows such
that first row moves to first target table, secord row in second target table, third row in third target
table, fourth row again in first target table so on and so forth. Describe your approach.
Ans.
We can clearly understand that we need a Router transformation to route or filter source data to the
three target tables. Now the question is what will be the filter conditions. First of all we need an
Expression Transformation where we have all the source table columns and along with that we have
another i/o port say seq_num, which is gets sequence numbers for each source row from the port
NextVal of a Sequence Generator start value 0 and increment by 1. Now the filter condition for the
three router groups will be:
MOD(SEQ_NUM,3)=1 connected to 1st target table, MOD(SEQ_NUM,3)=2 connected to 2nd target
table, MOD(SEQ_NUM,3)=0 connected to 3rd target table.
Subject Name
Maths
Maths
Physical Science
Maths
Life Science
Life Science
Physical Science
Life Science
Physical Science
Maths
100
75
80
Ans.
Here our scenario is to convert many rows to one rows, and the transformation which will help us to
We will sort the source data based on STUDENT_NAME ascending followed by SUBJECT ascending.
Sorter Transformation
Now based on STUDENT_NAME in GROUP BY clause the following output subject columns are
populated as
MATHS: MAX(MARKS, SUBJECT='Maths')
LIFE_SC: MAX(MARKS, SUBJECT='Life Science')
PHY_SC: MAX(MARKS, SUBJECT='Physical Science')
Aggregator Transformation
returned by the Database to the Integration Service and hence it is an Active transformation.
Q10. What happens to a mapping if we alter the datatypes between Source and its corresponding
Source Qualifier?
Ans.
The Source Qualifier transformation displays the transformation datatypes. The transformation
datatypes determine how the source database binds data when the Integration Service reads it.
Now if we alter the datatypes in the Source Qualifier transformation or the datatypes in the source
definition and Source Qualifier transformation do not match, the Designer marks the mapping as
invalid when we save it.
Q11. Suppose we have used the Select Distinct and the Number Of Sorted Ports property in the SQ and
then we add Custom SQL Query. Explain what will happen.
Ans.
Whenever we add Custom SQL or SQL override query it overrides the User-Defined Join, Source
Filter, Number of Sorted Ports, and Select Distinct settings in the Source Qualifier transformation.
Hence only the user defined SQL Query will be fired in the database and all the other options will be
ignored .
Q12. Describe the situations where we will use the Source Filter, Select Distinct and Number Of Sorted
Ports properties of Source Qualifier transformation.
Ans.
Source Filter option is used basically to reduce the number of rows the Integration Service queries so
as to improve performance.
Select Distinct option is used when we want the Integration Service to select unique values from a
source, filtering out unnecessary data earlier in the data flow, which might improve performance.
Number Of Sorted Ports option is used when we want the source data to be in a sorted fashion so as
to use the same in some following transformations like Aggregator or Joiner, those when configured for
sorted input will improve the performance.
Q13. What will happen if the SELECT list COLUMNS in the Custom override SQL Query and the
OUTPUT PORTS order in SQ transformation do not match?
Ans.
Mismatch or Changing the order of the list of selected columns to that of the connected transformation
output ports may result is session failure.
Q14. What happens if in the Source Filter property of SQ transformation we include keyword WHERE
say, WHERE CUSTOMERS.CUSTOMER_ID > 1000.
Ans.
We use source filter to reduce the number of source records. If we include the string WHERE in the
source filter, the Integration Service fails the session .
Q15. Describe the scenarios where we go for Joiner transformation instead of Source Qualifier
transformation.
Ans.
While joining Source Data of heterogeneous sources as well as to join flat files we will use the Joiner
transformation.
Use the Joiner transformation when we need to join the following types of sources:
Join data from different Relational Databases.
Join data from different Flat Files.
Join relational sources and flat files.
Q16. What is the maximum number we can use in Number Of Sorted Ports for Sybase source system.
Ans.
Sybase supports a maximum of 16 columns in an ORDER BY clause. So if the source is Sybase, do not
sort more than 16 columns.
Q17. Suppose we have two Source Qualifier transformations SQ1 and SQ2 connected to Target tables
TGT1 and TGT2 respectively. How do you ensure TGT2 is loaded after TGT1?
Ans.
If we have multiple Source Qualifier transformations connected to multiple targets, we can designate
the order in which the Integration Service loads data into the targets.
In the Mapping Designer, We need to configure the Target Load Plan based on the Source Qualifier
transformations in a mapping to specify the required loading order.
Image: Target Load Plan
Q18. Suppose we have a Source Qualifier transformation that populates two target tables. How do you
ensure TGT2 is loaded after TGT1?
Ans.
In the Workflow Manager, we can Configure Constraint based load ordering for a session. The
Integration Service orders the target load on a row-by-row basis. For every row generated by an active
source, the Integration Service loads the corresponding transformed row first to the primary key table,
then to the foreign key table.
Hence if we have one Source Qualifier transformation that provides data for multiple target tables
having primary and foreign key relationships, we will go for Constraint based load ordering.
Image: Constraint based loading
transformation, depending on whether a row meets the specified condition. Only rows that return
TRUE pass through this transformation. Discarded rows do not appear in the session log or reject files.
Q20. What is the difference between Source Qualifier transformations Source Filter to Filter
transformation?
Ans.
SQ Source Filter
Source Qualifier transformation filters rows when read from a source.
Source Qualifier transformation can only filter rows from Relational
Sources.
Source Qualifier limits the row set extracted from a source.
Source Qualifier reduces the number of rows used throughout the
mapping and hence it provides better performance.
The filter condition in the Source Qualifier transformation only uses
standard SQL as it runs in the database.
Filter Transformation
Filter transformation filters rows from withi
Filter transformation filters rows coming fro
system in the mapping level.
Filter transformation limits the row set sent
To maximize session performance, include t
close to the sources in the mapping as possib
data early in the flow of data from sources to
Filter Transformation can define a condition
transformation function that returns either a
Joiner transformation cannot be used when either of the input pipeline contains an Update Strategy
transformation.
Joiner transformation cannot be used if we connect a Sequence Generator transformation directly
before the Joiner transformation.
Q23. Out of the two input pipelines of a joiner, which one will you set as the master pipeline?
Ans.
During a session run, the Integration Service compares each row of the master source against the
detail source.
The master and detail sources need to be configured for optimal performance .
To improve performance for an Unsorted Joiner transformation, use the source with fewer rows as the
master source. The fewer unique rows in the master, the fewer iterations of the join comparison occur,
which speeds the join process.
When the Integration Service processes an unsorted Joiner transformation, it reads all master rows
before it reads the detail rows. The Integration Service blocks the detail source while it caches rows
from the master source . Once the Integration Service reads and caches all master rows, it unblocks
the detail source and reads the detail rows.
To improve performance for a Sorted Joiner transformation, use the source with fewer duplicate key
values as the master source.
When the Integration Service processes a sorted Joiner transformation, it blocks data based on the
mapping configuration and it stores fewer rows in the cache, increasing performance. Blocking logic is
possible if master and detail input to the Joiner transformation originate from different sources .
Otherwise, it does not use blocking logic. Instead, it stores more rows in the cache.
Q24. What are the different types of Joins available in Joiner Transformation?
Ans.
In SQL, a join is a relational operator that combines data from multiple tables into a single result set.
The Joiner transformation is similar to an SQL join except that data can originate from different types
of sources.
The Joiner transformation supports the following types of joins :
Normal
Master Outer
Detail Outer
Full Outer
Note: A normal or master outer join performs faster than a full outer or detail outer join.
Q25. Define the various Join Types of Joiner Transformation.
Ans.
In a normal join , the Integration Service discards all rows of data from the master and detail source
that do not match, based on the join condition.
A master outer join keeps all rows of data from the detail source and the matching rows from the
master source. It discards the unmatched rows from the master source.
A detail outer join keeps all rows of data from the master source and the matching rows from the detail
source. It discards the unmatched rows from the detail source.
A full outer join keeps all rows of data from both the master and detail sources.
Q26. Describe the impact of number of join conditions and join order in a Joiner Transformation.
Ans.
We can define one or more conditions based on equality between the specified master and detail
sources.
Both ports in a condition must have the same datatype . If we need to use two ports in the join
condition with non-matching datatypes we must convert the datatypes so that they match. The Designer
validates datatypes in a join condition.
Additional ports in the join condition increases the time necessary to join two sources.
The order of the ports in the join condition can impact the performance of the Joiner transformation. If
we use multiple ports in the join condition, the Integration Service compares the ports in the order we
specified.
NOTE: Only equality operator is available in joiner join condition.
Q27. How does Joiner transformation treat NULL value matching.
Ans.
The Joiner transformation does not match null values .
For example, if both EMP_ID1 and EMP_ID2 contain a row with a null value, the Integration Service
does not consider them a match and does not join the two rows.
To join rows with null values, replace null input with default values in the Ports tab of the joiner, and
then join on the default values.
Note: If a result set includes fields that do not contain data in either of the sources, the Joiner
transformation populates the empty fields with null values. If we know that a field will return a NULL
and we do not want to insert NULLs in the target, set a default value on the Ports tab for the
corresponding port.
Q28. Suppose we configure Sorter transformations in the master and detail pipelines with the following
sorted ports in order: ITEM_NO, ITEM_NAME, PRICE.
When we configure the join condition, what are the guidelines we need to follow to maintain the sort
order?
Ans.
If we have sorted both the master and detail pipelines in order of the ports say ITEM_NO,
ITEM_NAME and PRICE we must ensure that:
Use ITEM_NO in the First Join Condition.
If we add a Second Join Condition, we must use ITEM_NAME.
If we want to use PRICE as a Join Condition apart from ITEM_NO, we must also use ITEM_NAME in
the Second Join Condition.
If we skip ITEM_NAME and join on ITEM_NO and PRICE, we will lose the input sort order and the
Integration Service fails the session .
Q29. What are the transformations that cannot be placed between the sort origin and the Joiner
transformation so that we do not lose the input sort order.
Ans.
The best option is to place the Joiner transformation directly after the sort origin to maintain sorted
data.
However do not place any of the following transformations between the sort origin and the Joiner
transformation:
Custom
Unsorted Aggregator
Normalizer
Rank
Union transformation
XML Parser transformation
XML Generator transformation
Mapplet [if it contains any one of the above mentioned transformations]
Q30. Suppose we have the EMP table as our source. In the target we want to view those employees
whose salary is greater than or equal to the average salary for their departments.
Describe your mapping approach.Ans.
Our Mapping will look like this:
Image: Mapping using Joiner
To start with the mapping we need the following transformations:
After the Source qualifier of the EMP table place a Sorter Transformation . Sort based on DEPTNO
port.
Next we place a Sorted Aggregator Transformation . Here we will find out the AVERAGE
SALARY for each (GROUP BY) DEPTNO .
When we perform this aggregation, we lose the data for individual employees. To maintain employee
data, we must pass a branch of the pipeline to the Aggregator Transformation and pass a branch with
the same sorted source data to the Joiner transformation to maintain the original data. When we join
both branches of the pipeline, we join the aggregated data with the original data.
So next we need Sorted Joiner Transformation to join the sorted aggregated data with the original
data, based on DEPTNO .
Here we will be taking the aggregated pipeline as the Master and original dataflow as Detail Pipeline.
After that we need a Filter Transformation to filter out the employees having salary less than average
salary for their department.
Filter Condition: SAL>=AVG_SAL
the Sequence Generator to the surrogate keys of both the target tables.
Will the Surrogate keys in both the target tables be same? If not how can we flow the same sequence
values in both of them.
Ans.
When we connect the NEXTVAL output port of the Sequence Generator directly to the surrogate key
columns of the target tables, the Sequence number will not be the same .
A block of sequence numbers is sent to one target tables surrogate key column. The second targets
receives a block of sequence numbers from the Sequence Generator transformation only after the first
target table receives the block of sequence numbers.
Suppose we have 5 rows coming from the source, so the targets will have the sequence values as TGT1
(1,2,3,4,5) and TGT2 (6,7,8,9,10). [Taken into consideration Start Value 0, Current value 1 and
Increment by 1.
Now suppose the requirement is like that we need to have the same surrogate keys in both the targets.
Then the easiest way to handle the situation is to put an Expression Transformation in between the
Sequence Generator and the Target tables. The SeqGen will pass unique values to the expression
transformation, and then the rows are routed from the expression transformation to the targets.
Sequence Generator
Q34. Suppose we have 100 records coming from the source. Now for a target column population we
used a Sequence generator.
Suppose the Current Value is 0 and End Value of Sequence generator is set to 80. What will happen?
Ans.
End Value is the maximum value the Sequence Generator will generate. After it reaches the End value
the session fails with the following error message:
TT_11009 Sequence Generator Transformation: Overflow error.
Failing of session can be handled if the Sequence Generator is configured to Cycle through the
sequence, i.e. whenever the Integration Service reaches the configured end value for the sequence, it
wraps around and starts the cycle again, beginning with the configured Start Value.
Q35. What are the changes we observe when we promote a non resuable Sequence Generator to a
resuable one?
And what happens if we set the Number of Cached Values to 0 for a reusable transformation?
Ans.
When we convert a non reusable sequence generator to resuable one we observe that the Number of
Cached Values is set to 1000 by default; And the Reset property is disabled.
When we try to set the Number of Cached Values property of a Reusable Sequence Generator to 0 in
the Transformation Developer we encounter the following error message:
The number of cached values must be greater than zero for reusable sequence transformation.
Test Preparation
We will perform the same test with 4 different data points (data volumes) and log the results. We will
start with 1 million data in detail table and 0.1 million in master table. Subsequently we will test with 2
million, 4 million and 6 million detail table data volumes and 0.2 million, 0.4 million and 0.6 million
master table data volumes. Here are the details of the setup we will use,
1. Oracle 10g database as relational source and target
2. Informatica PowerCentre 8.5 as ETL tool
Result
The following graph shows the performance of Informatica and Database in terms of time taken by
each system to sort data. The average time is plotted along vertical axis and data points are plotted
along horizontal axis.
Data Points
Master Table Record Count
1
0.1 M
2
0.2 M
3
0.4 M
4
0.6 M
Verdict
In our test environment, Oracle 10g performs JOIN operation 24% faster
than Informatica Joiner Transformation while without Index and 42%
faster with Database Index
Assumption
1. Average server load remains same during all the experiments
Note
1. This data can only be used for performance comparison but cannot be used for performance
benchmarking.
2. This data is only indicative and may vary in different testing conditions.
Test Preparation
We will perform the same test with different data points (data volumes) and log the results. We will
start with 1 million records and we will be doubling the volume for each next data points. Here are the
details of the setup we will use,
1. Oracle 10g database as relational source and target
2. Informatica PowerCentre 8.5 as ETL tool
3. Database and Informatica setup on different physical servers using HP UNIX
4. Source database table has no constraint, no index, no database statistics and no partition
5. Source database table is not available in Oracle shared pool before the same is read
6. There is no session level partition in Informatica PowerCentre
7. There is no parallel hint provided in extraction SQL query
8. The source table has 10 columns and first 8 columns will be used for sorting
9. Informatica sorter has enough cache size
We have used two sets of Informatica PowerCentre mappings created in Informatica PowerCentre
designer. The first mapping m_db_side_sort will use an ORDER BY clause in the source qualifier to
sort data in database level. Second mapping m_Infa_side_sort will use an Informatica sorter to sort data
in informatica level. We have executed these mappings with different data points and logged the result.
Result
The following graph shows the performance of Informatica and Database in terms of time taken by
each system to sort data. The time is plotted along vertical axis and data volume is plotted along
horizontal axis.
Verdict
The above experiment demonstrates that Oracle
database is faster in SORT operation than Informatica
by an average factor of 14%.
Assumption
1. Average server load remains same during all the experiments
2. Average network speed remains same during all the experiments
Note
This data can only be used for performance comparison but cannot be used for performance
benchmarking.
When we run a session, the integration service may create a reject file for each target instance in the
mapping to store the target reject record. With the help of the Session Log and Reject File we can
identify the cause of data rejection in the session. Eliminating the cause of rejection will lead to
rejection free loads in the subsequent session runs. If the Informatica Writer or the Target Database
rejects data due to any valid reason the integration service logs the rejected records into the reject file.
Every time we run the session the integration service appends the rejected records to the reject file.
Indicator Significance
Insert
Update
Delete
Reject
Rolled-back insert
Rolled-back update
Rolled-back delete
Committed insert
Committed update
Committed delete
Now comes the Column Data values followed by their Column Indicators, that determines the data
quality of the corresponding Column.
Type of data
Valid data or Good Data.
Null Value.
Also to be noted that the second column contains column indicator flag value 'D' which signifies that
the Row Indicator is valid.
Now let us see how Data in a Bad File looks like:
0,D,7,D,John,D,5000.375,O,,N,BrickLand Road Singapore,T
Incremental Aggregation
When the session runs with incremental aggregation enabled for the first time say 1st week of Jan, we
will use the entire source. This allows the Integration Service to read and store the necessary aggregate
data information. On 2nd week of Jan, when we run the session again, we will filter out the CDC
records from the source i.e the records loaded after the initial load. The Integration Service then
processes these new data and updates the target accordingly.
Use incremental aggregation when the changes do not significantly change the target. If
processing the incrementally changed source alters more than half the existing target, the session may
not benefit from using incremental aggregation. In this case, drop the table and recreate the target with
entire source data and recalculate the same aggregation formula .
INCREMENTAL AGGREGATION, may be helpful in cases when we need to load data in
monthly facts in a weekly basis.
Let us see a sample mapping to implement incremental aggregation:
Image: Incremental Aggregation Sample Mapping
Look at the Source Qualifier query to fetch the CDC part using a BATCH_LOAD_CONTROL
table that saves the last successful load date for the particular mapping.
Image: Incremental Aggregation Source Qualifier
Now the most important session properties configuation to implement incremental Aggregation
If we want to reinitialize the aggregate cache suppose during first week of every month we will
configure another session same as the previous session the only change being the Reinitialize aggregate
cache property checked in
INVOICE_KEY
5001
5002
5003
6007
6008
6009
1234
6157
After the first Load on 1st week of Jan 2010, the data in the target is as follows:
CUSTOMER_KEY
1111
2222
3333
INVOICE_KEY
5001
5002
5003
Now during the 2nd week load it will process only the incremental data in the source i.e those records
having load date greater than the last session run date. After the 2nd weeks load after incremental
aggregation of the incremental source data with the aggregate cache file data will update the target
table with the following dataset:
CUSTOMER_KEY
INVOICE_KEY
1111
6008
2222
6009
3333
5003
4444
1234
5555
6157
The first time we run an incremental aggregation session, the Integration Service processes the entire
source. At the end of the session, the Integration Service stores aggregate data for that session run in
two files, the index file and the data file. The Integration Service creates the files in the cache directory
specified in the Aggregator transformation properties.Each subsequent time we run the session with
incremental aggregation, we use the incremental source changes in the session. For each input record,
the Integration Service checks historical information in the index file for a corresponding group. If it
finds a corresponding group, the Integration Service performs the aggregate operation incrementally,
using the aggregate data for that group, and saves the incremental change. If it does not find a
corresponding group, the Integration Service creates a new group and saves the record data.
When writing to the target, the Integration Service applies the changes to the existing target. It saves
modified aggregate data in the index and data files to be used as historical data the next time you run
the session.
Each subsequent time we run a session with incremental aggregation, the Integration Service creates a
backup of the incremental aggregation files. The cache directory for the Aggregator transformation
must contain enough disk space for two sets of the files.
The Integration Service creates new aggregate data, instead of using historical data, when we configure
the session to reinitialize the aggregate cache, Delete cache files etc.
When the Integration Service rebuilds incremental aggregation files, the data in the previous files is
lost.
Note: To protect the incremental aggregation files from file corruption or disk failure,
periodically back up the files.
.
Normalizer, a native transformation in Informatica, can ease many complex data transformation
Sales
100
300
500
700
250
450
650
850
Month
Jan
Jan
Jan
Feb
Feb
Feb
Month
Sam
Jan
Sam
Jan
Sam
Jan
John
Jan
John
Jan
John
Jan
Tom
Jan
Tom
Jan
Tom
Jan
.. like this.
Now below is the screen-shot of a complete mapping which shows how to achieve this result using
Informatica PowerCenter Designer. Image: Normalization Mapping Example 1
I will explain the mapping further below.
In the Ports tab of the Normalizer the ports will be created automatically as configured in the
Normalizer tab.
Interestingly we will observe two new columns namely,
GK_EXPENSEHEAD
GCID_EXPENSEHEAD
GK field generates sequence number starting from the value as defined in Sequence field while GCID
holds the value of the occurence field i.e. the column no of the input Expense head.
Here 1 is for FOOD, 2 is for HOUSERENT and 3 is for TRANSPORTATION.
Now the GCID will give which expense corresponds to which field while converting columns to rows.
Below is the screen-shot of the expression to handle this GCID efficiently:
Image: Expression to handle GCID
Let's think about this scenario. You are loading your target table through a mapping. Inside the
mapping you have a Lookup and in the Lookup, you are actually looking up the same target table
you are loading. You may ask me, "So? What's the big deal? We all do it quite often...". And yes you
are right. There is no "big deal" because Informatica (generally) caches the lookup table in the very
beginning of the mapping, so whatever record getting inserted to the target table through the mapping,
will have no effect on the Lookup cache. The lookup will still hold the previously cached data, even if
the underlying target table is changing.
But what if you want your Lookup cache to get updated as and when the target table is changing? What
if you want your lookup cache to always show the exact snapshot of the data in your target table at that
point in time? Clearly this requirement will not be fullfilled in case you use a static cache. You will
need a dynamic cache to handle this.
.
A LookUp cache does not change once built. But what if the underlying lookup table changes the data
after the lookup cache is created? Is there a way so that the cache always remain up-to-date even if the
underlying table changes?
Dynamic Lookup Cache
Let's think about this scenario. You are loading your target table through a mapping. Inside the
mapping you have a Lookup and in the Lookup, you are actually looking up the same target table
you are loading. You may ask me, "So? What's the big deal? We all do it quite often...". And yes you
are right. There is no "big deal" because Informatica (generally) caches the lookup table in the very
beginning of the mapping, so whatever record getting inserted to the target table through the mapping,
will have no effect on the Lookup cache. The lookup will still hold the previously cached data, even if
the underlying target table is changing.
But what if you want your Lookup cache to get updated as and when the target table is changing? What
if you want your lookup cache to always show the exact snapshot of the data in your target table at that
point in time? Clearly this requirement will not be fullfilled in case you use a static cache. You will
need a dynamic cache to handle this.
Remember, you typically lookup the dimension while loading to fact. So you load dimension
table before loading fact table. But using dynamic lookup, you can load both simultaneously.
Loading data from a file with many duplicate records and to eliminate duplicate records in
target by updating a duplicate row i.e. keeping the most recent row or the initial row
Loading the same data from multiple sources using a single mapping. Just consider the previous
Retail business example. If you have more than one shops and Linda has visited two of your
shops for the first time, customer record Linda will come twice during the same load.
This will execute the last find command. It also displays the last find command executed along with the
result on the terminal.
2. How to find for a file using name?
find -name "sum.java"
./bkp/sum.java
./sum.java
This will find all the files with name "sum.java" in the current directory and sub-directories.
3. How to find for files using name and ignoring case?
find -iname "sum.java"
./SUM.java
./bkp/sum.java
./sum.java
This will find all the files with name "sum.java" while ignoring the case in the current directory and
sub-directories.
4. How to find for a file in the current directory only?
This will find for the file "sum.java" in the current directory only
5. How to find for files containing a specific word in its name?
find -name "*java*"
./SUM.java
./bkp/sum.java
./sum.java
./multiply.java
It displayed all the files which have the word "java" in the filename
6. How to find for files in a specific directory?
find /etc -name "*java*"
This will look for the files in the /etc directory with "java" in the filename
7. How to find the files whose name are not "sum.java"?
find -not -name "sum.java"
.
./SUM.java
./bkp
./multiply.java
This is like inverting the match. It prints all the files except the given file "sum.java".
8. How to limit the file searches to specific directories?
find -name "sum.java"
./tmp/sum.java
./bkp/var/tmp/files/sum.java
./bkp/var/tmp/sum.java
./bkp/var/sum.java
./bkp/sum.java
./sum.java
You can see here the find command displayed all the files with name "sum.java" in the current
b. How to print the files in the current directory and two levels down to the current directory?
find -maxdepth 3 -name "sum.java"
./tmp/sum.java
./bkp/var/sum.java
./bkp/sum.java
./sum.java
10. How to find the largest file in the current directory and sub directories
find . -type f -exec ls -s {} \; | sort -n -r | head -1
The find command "find . -type f -exec ls -s {} \;" will list all the files along with the size of the file.
Then the sort command will sort the files based on the size. The head command will pick only the first
line from the output of sort.
11. How to find the smallest file in the current directory and sub directories
find . -type f -exec ls -s {} \; | sort -n -r | tail -1
b. Finding directories
find . -type d
14. How to find the files which are modified after the modification of a give file.
find -newer "sum.java"
This will display all the files which are modified after the file "sum.java"
15. Display the files which are accessed after the modification of a give file.
find -anewer "sum.java"
16. Display the files which are changed after the modification of a give file.
find -cnewer "sum.java"
This will display the files which have read, write, and execute permissions. To know the permissions of
files and directories use the command "ls -l".
18. Find the files which are modified within 30 minutes.
find . -mmin -30
20. How to find the files which are modified 30 minutes back
find . -not -mmin -30
21. How to find the files which are modified 1 day back.
find . -not -mtime -1
26. How to find the files which are created between two files.
find . -cnewer f1 -and ! -cnewer f2
So far we have just find the files and displayed on the terminal. Now we will see how to perform some
operations on the files.
1. How to find the permissions of the files which contain the name "java"?
find -name "*java*"|xargs ls -l
Alternate method is
find -name "*java*" -exec ls -l {} \;
2. Find the files which have the name "java" in it and then display only the files which have "class"
word in them?
find -name "*java*" -exec grep -H class {} \;
This will delete all the files which have the word java" in the file name in the current directory and
sub-directories.
Here the actions in the begin block are performed before processing the file and the actions in the end
block are performed after processing the file. The rest of the actions are performed while processing the
file.
Examples:
Create a file input_file with the following data. This file can be easily created using the output of ls -l.
-rw-r--r-- 1 center center 0 Dec 8 21:39 p1
-rw-r--r-- 1 center center 17 Dec 8 21:15 t1
-rw-r--r-- 1 center center 26 Dec 8 21:38 t2
-rw-r--r-- 1 center center 25 Dec 8 21:38 t3
-rw-r--r-- 1 center center 43 Dec 8 21:39 t4
-rw-r--r-- 1 center center 48 Dec 8 21:39 t5
From the data, you can observe that this file has rows and columns. The rows are separated by a new
line character and the columns are separated by a space characters. We will use this file as the input for
the examples discussed here.
1. awk '{print $1}' input_file
Here $1 has a meaning. $1, $2, $3... represents the first, second, third columns... in a row respectively.
This awk command will print the first column in each row as shown below.
-rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--
To print the 4th and 6th columns in a file use awk '{print $4,$5}' input_file
Here the Begin and End blocks are not used in awk. So, the print command will be executed for each
row it reads from the file. In the next example we will see how to use the Begin and End blocks.
Notice that the syntax of if and for are similar to the C language.
Note: print $4,$5 and print $4$5 will not work the same way. The first one displays the output with
space as delimiter. The second one displays the output without any delimiter.
NF - Number of fileds variable:
The NF can be used to know the number of fields in line
8. awk '{print NF}' input_file
This will display the number of columns in each row.
NR - number of records variable:
The NR can be used to know the line number or count of lines in a file.
9. awk '{print NR}' input_file
This will display the line numbers from 1.
10. awk 'END {print NR}' input_file
This will display the total number of lines in the file.
String functions in Awk:
Some of the string functions in awk are:
index(string,search)
length(string)
split(string,array,separator)
substr(string,position)
substr(string,position,max)
tolower(string)
toupper(string)
Advanced Examples:
Required output: Now we have to print only the lines in which whose 2nd field has the string "UNIX"
as the 3rd field( The 2nd filed in the line is separated by comma delimiter ).
The ouptut is:
1 U,N,UNIX,000
3 I,M,UNIX,222
Recommended Posts:
Find Command
Grep Command
Awk command Examples - Part2
If you like this post, then please share it in google by clicking on the +1 button
Let say, we want to insert the new line "9 Z" after every two lines in the input file. The required output
data after inserting a new line looks as
1A
2B
9Z
3C
4D
9Z
5E
6F
9Z
BBB 2
CCC 3
AAA 4
AAA 5
BBB 6
CCC 7
AAA 8
BBB 9
AAA 0
Now we want to replace the fourth occurrence of the first filed "AAA" with "ZZZ" in the file.
The required output is:
AAA 1
BBB 2
CCC 3
AAA 4
AAA 5
BBB 6
CCC 7
ZZZ 8
BBB 9
AAA 0
B 39
C 22
D 44
E 75
F 89
G 67
You have to get the second field and then find the sum the even and odd lines.
The required output is
174, 172
}
}
}'
The output is
0
1
1
2
3
5
8
13
21
34
55
5. Remove leading zeros from a file using the awk command. The input file contains the below data.
0012345
05678
01010
00001
After removing the leading zeros, the output should contain the below data.
12345
5678
1010
1
This saves a lot of time if you are executing the same command again and again.
!grep
This displays the last executed grep command and also prints the result set of the command on the
terminal.
2. Search for a string in a file
This is the basic usage of grep command. It searches for the given string in the specified file.
grep "Error" logfile.txt
This searches for the string "Error" in the log file and prints all the lines that has the word "Error".
3. Searching for a string in multiple files.
grep "string" file1 file2
grep "string" file_pattern
This is also the basic usage of the grep command. You can manually specify the list of files you want to
search or you can specify a file pattern (use regular expressions) to search for.
4. Case insensitive search
The -i option enables to search for a string case insensitively in the give file. It matches the words like
"UNIX", "Unix", "unix".
grep -i "UNix" file.txt
Some times, if you are searching for an error in a log file; it is always good to know the lines around
the error lines to know the cause of the error.
grep -B 2 "Error" file.txt
This will prints the matched lines along with the two lines before the matched lines.
8. Displaying the lines after the match.
grep -A 3 "Error" file.txt
This will display the matched lines along with the three lines after the matched lines.
9. Displaying the lines around the match
grep -C 5 "Error" file.txt
This will display the matched lines and also five lines before and after the matched lines.
10. Searching for a sting in all files recursively
You can search for a string in all the files under the current directory and sub-directories with the help
-r option.
grep -r "string" *
15. Display the file names that do not contain the pattern.
We can display the files which do not contain the matched string/pattern.
grep -L "string" *
If you like this post, please share it on google by clicking on the +1 button.
The above cut command prints the fourth character in each line of the file. You can print more than one
character at a time by specifying the character positions in a comma separated list as shown in the
below example
cut -c4,6 file.txt
xo
ui
ln
This command prints the fourth and sixth character in each line.
2.Write a unix/linux cut command to print characters by range?
You can print a range of characters in a line by specifying the start and end position of the characters.
cut -c4-7 file.txt
x or
unix
linu
The above cut command prints the characters from fourth position to the seventh position in each line.
To print the first six characters in a line, omit the start position and specify only the end position.
To print the characters from tenth position to the end, specify only the start position and omit the end
position.
cut -c10- file.txt
inux os
ood os
good os
If you omit the start and end positions, then the cut command prints the entire line.
cut -c- file.txt
3.Write a unix/linux cut command to print the fields using the delimiter?
You can use the cut command just as awk command to extract the fields in a file using a delimiter. The
-d option in cut command can be used to specify the delimiter and -f option is used to specify the field
position.
cut -d' ' -f2 file.txt
or
unix
linux
This command prints the second field in each line by treating the space as delimiter. You can print more
than one field by specifying the position of the fields in a comma delimited list.
cut -d' ' -f2,3 file.txt
or linux
unix good
linux good
The above command prints the second and third field in each line.
Note: If the delimiter you specified is not exists in the line, then the cut command prints the entire line.
To suppress these lines use the -s option in cut command.
4. Write a unix/linux cut command to display range of fields?
You can print a range of fields by specifying the start and end position.
cut -d' ' -f1-3 file.txt
The above command prints the first, second and third fields. To print the first three fields, you can
ignore the start position and specify only the end position.
cut -d' ' -f-3 file.txt
To print the fields from second fields to last field, you can omit the last field position.
cut -d' ' -f2- file.txt
5. Write a unix/linux cut command to display the first field from /etc/passwd file?
The /etc/passwd is a delimited file and the delimiter is a colon (:). The cut command to display the first
field in /etc/passwd file is
cut -d':' -f1 /etc/passwd
Using the cut command extract the portion after the dot.
First reverse the text in each line and then apply the command on it.
rev filenames.txt | cut -d'.' -f1
Both Linux and UNIX include various commands for Compressing and decompresses (read as expand compressed
Compressing files
Syntax
gzip {filename}
bzip2 {filename}
Decompressing files
Syntax
gzip -d {.gz file}
gunzip {.gz file}
bzip2 -d {.bz2-file}
bunzip2 {.bz2-file}
unzip {.zip file}
tar -zxvf {.tgz-file}
tar -jxvf {.tbz2-file}
Some time you just wanted to look at files inside an archive or compressed file. Then all of the above command su
Syntax
gzip -l {.gz file}
unzip -l {.zip file}
tar -ztvf {.tar.gz}
tar -jtvf {.tbz2}
Related articles
https://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html