Showing posts with label Data Warehousing. Show all posts
Showing posts with label Data Warehousing. Show all posts

Informatica Interview 4

Design a mapping to convert column data into row data without using the normalizer transformation.
The source data looks like
col1, col2, col3
a, b, c
d, e, f


The target table data should look like
Col
a
b
c
d
e
f

Create three expression transformations with one port each. Connect col1 from Source Qualifier to port in first expression transformation. Connect col2 from Source Qualifier to port in second expression transformation. Connect col3 from source qualifier to port in third expression transformation. Create a union transformation with three input groups and each input group should have one port. Now connect the expression transformations to the input groups and connect the union transformation to the target table.

Design a mapping to convert row data into column data.
The source data looks like
id, value
10, a
10, b
10, c
20, d
20, e
20, f


The target table data should look like
id, col1, col2, col3
10, a, b, c
20, d, e, f


Step1: Use sorter transformation and sort the data using id port as the key. Then connect the sorter transformation to the expression transformation.

Step2: In the expression transformation, create the ports and assign the expressions as mentioned below.

id
value
V_curr_id=id
V_count= IIF(v_curr_id=V_prev_id,V_count+1,1)
V_prev_id=id
O_col1= IIF(V_count=1,value,NULL)
O_col2= IIF(V_count=2,value,NULL)
O_col3= IIF(V_count=3,value,NULL)


Step3: Connect the expression transformation to aggregator transformation. In the aggregator transforamtion, create the ports and assign the expressions as mentioned below.

id (specify group by on this port)
O_col1
O_col2
O_col3
col1=MAX(O_col1)
col2=MAX(O_col2)
col3=MAX(O_col3)


Stpe4: Now connect the ports id, col1, col2, col3 from aggregator transformation to the target table.



Click below links for more Informatica Interview Questions and Answers 
Informatica Interview 1
Informatica Interview 2
Informatica Interview 3

Informatica Interview 2

Name four output files that informatica server creates during session running?
  • Session Log
  • Workflow Log
  • Errors Log
  • Badfile
Why we use stored procedure transformation?
A stored procedure transformation is an important tool for populating and maintaing databases.

What is the difference between static cache and dynamic cache?
Dynamic cache decreases the performance in comparision to static cache.
Static cache do not see such things just insert data as many times as it is coming

Define maping and sessions?
Maping: It is a set of source and target definitions linked by transformation objects that define the rules for transformation.
Session : It is a set of instructions that describe how and when to move data from source to targets.

What is a command that used to run a batch?
pmcmd is used to start a batch.

What is Datadriven?
The informatica server follows instructions coded into update strategy transformations with in the session maping determine how to flag records for insert, update, delete or reject.

What is power center repository?
The PowerCenter repository allows you to share metadata across repositories to create a data mart domain.

What is parameter file?
A parameter file is a file created by text editor such as word pad or notepad. You can define the following values in parameter file.
  • Maping parameters
  • Maping variables
  • Session parameters.
What are the types of lookup caches?
  • Static cache: You can configure a static or readonly cache for only lookup table. By default, informatica server creates a static cache. It caches the lookup table and lookup values in the cache for each row that comes into the transformation. When the lookup condition is true, the informatica server does not update the cache while it processes the lookup transformation.
  • Dynamic cacheIf you want to cache the target table and insert new rows into cache and the target, you can create a look up transformation to use dynamic cache.The informatica server dynamically inserts data to the target table.
  • Persistent cache: You can save the lookup cache files and reuse them the next time the informatica server processes a lookup transformation configured to use the cache.
  • Shared cache: You can share the lookup cache between multiple transactions. You can share unnamed cache between transformations in the same mapping.
  • RecacheIf the persistent cache is not synchronized with he lookup table, you can configure the lookup transformation to rebuild the lookup cache.
What are Stored Procedure transformation?
Stored Procedure transformation is an Passive & Connected or UnConnected transformation. It is useful to automate time-consuming tasks and it is also used in error handling, to drop and recreate indexes and to determine the space in database, a specialized calculation.

What is fact table?
The centralized table in a star schema is called as fact table. Fact tables are three types
  • AdditiveAdditive facts are facts that can be summed up through all of the dimensions in the fact table.
  • Non-Additive: Non-additive facts are facts that cannot be summed up for any of the dimensions present in the fact table.
  • Semi Additive: Semi-additive facts are facts that can be summed up for some of the dimensions in the fact table, but not the others.
What are Source Qualifier transformation?
Source Qualifier transformation is an Active and Connected transformation. When adding a relational or a flat file source definition to a mapping, it is must to connect it to a Source Qualifier transformation. The Source Qualifier performs the various tasks such as overriding default SQL query, filtering records; join data from two or more tables etc.

What is difference between maplet and reusable transformation?
Maplet consists of set of transformations that is reusable. A reusable transformation is a single transformation that can be reusable.

What is Update Strategy transformation?
Update strategy transformation is an active and connected transformation. It is used to update data in target table, either to maintain history of data or recent changes. You can specify how to treat source rows in table, insert, update, delete or data driven.

How many types of dimensions are available in informatica?
There are three types of dimensions.
  • Star SchemaA star schema is the one in which a central fact table is sourrounded by denormalized dimensional tables. A star schema can be simple or complex. A simple star schema consists of one fact table where as a complex star schema have more than one fact table.
  • Snowflake SchemaA snow flake schema is an enhancement of star schema by adding additional dimensions. Snow flake schema are useful when there are low cardinality attributes in the dimensions.
  • Galaxy SchemaGalaxy schema contains many fact tables with some common dimensions (conformed dimensions). This schema is a combination of many data marts.
What are different types of parsing?
  • Quick parsing
  • Thorough parsing
How do you handle large datasets?
By Using Bulk utility mode at the session level and if possible by disabling constraints after consulting with DBA; Using Bulk utility mode would mean that no writing is taking place in Roll Back Segment so loading is faster. However the pitfall is that recovery is not possible.

What are the limitations of handling long datatypes?
When the length of a datatype (e.g varchar2(4000)) goes beyond 4000, Informatica makes this as varchar2(2000).

What are the types of OLAP?

  • ROLAP (Relational OLAP) - Users see their data organized in cubes and dimensions but the data is really stored in RDBMS. The performance is slow. A storage mode that uses tables in a relational database to store multidimensional structures.
  • MOLAP (Multidimensional OLAP) - Users see their data organized in cubes and dimensions but the data is really stored in MDBMS. Query performance is fast.
  • HOLAP (Hybrid OLAP) - It is a combination of ROLAP and HOLAP. EG: HOLOs. In this one will find data queries on aggregated data as well as detailed data.
What is Meta data?
Data about the data, contains the location and description of data warehouse system components such as name, definitions and end user views.

How does the recovery mode work in informatica?
In case of load failure an entry is made in OPB_SERV_ENTRY(?) table from where the extent of loading can be determined.

What is Aggregate Awareness?
Aggregate awareness is a feature of DESIGNER that makes use of aggregate tables in a database. These are tables that contain pre-calculated data. The purpose of these tables is to enhance the performance of SQL transactions; they are thus used to speed up the execution of queries.

When should you use a star schema and when a snowflake schema?
A star schema is a simplest data warehouse schema. Snowflake schema is similar to the star schema. It normalizes dimension table to save data storage space. It can be used to represent hierarchies of information.

What parameters can be tweaked to get better performance from a session?
DTM shared memory, Index cache memory, Data cache memory, by indexing, using persistent cache, increasing commit interval etc.

Why we are going for surrogate keys?
  • Data tables in various source systems may use different keys for the same entity.
  • Keys may change or be reused in the source data systems.
  • Changes in organizational structures may move keys in the hierarchy.
When is more convenient to join in the database or in Informatica?
  • Definitely at the database level
  • at the source Qualifier query itself
  • rather than using Joiner transformation
How do you measure session performance?
By checking Collect performance Data check box.

What is Dimension Table?
It contains data used to reference data stored in the fact table.
  • Fewer rows
  • Primarily character data
  • One primary key (dimensional key)
  • Updatable data
What is a database connection?
A connection is a set of parameters that provides access to an RDBMS. These parameters include system information such as the data account, user identification, and the path to the database. Designer provides three types of connections: secured, shared, and personal.

What are all the types of dimensions?
  • Informational Dimension
  • Structural Dimension
  • Categorical Dimension
  • Partitioning Dimension


Click below links for more Informatica Interview Questions and Answers 



Informatica Interview 3

How to generate sequence numbers using expression transformation?
In the expression transformation, create a variable port and increment it by 1. Then assign the variable port to an output port. In the expression transformation, the ports are:
V_count=V_count+1
O_count=V_count

Design a mapping to load the first 3 rows from a flat file into a target?
You have to assign row numbers to each record. Generate the row numbers either using the expression transformation as mentioned above or use sequence generator transformation.
Then pass the output to filter transformation and specify the filter condition as O_count <=3



Design a mapping to load the last 3 rows from a flat file into a target?
Consider the source has the following data.
col
a
b
c
d
e



Step1: You have to assign row numbers to each record. Generate the row numbers using the expression transformation as mentioned above and call the row number generated port as O_count. Create a DUMMY output port in the same expression transformation and assign 1 to that port. So that, the DUMMY output port always return 1 for each row.

In the expression transformation, the ports are
V_count=V_count+1
O_count=V_count
O_dummy=1


The output of expression transformation will be
col, o_count, o_dummy
a, 1, 1
b, 2, 1
c, 3, 1
d, 4, 1
e, 5, 1

Step2: Pass the output of expression transformation to aggregator and do not specify any group by condition. Create an output port O_total_records in the aggregator and assign O_count port to it. The aggregator will return the last row by default. The output of aggregator contains the DUMMY port which has value 1 and O_total_records port which has the value of total number of records in the source.

In the aggregator transformation, the ports are
O_dummy
O_count
O_total_records=O_count


The output of aggregator transformation will be
O_total_records, O_dummy
5, 1

Step3: Pass the output of expression transformation, aggregator transformation to joiner transformation and join on the DUMMY port. In the joiner transformation check the property sorted input, then only you can connect both expression and aggregator to joiner transformation.

In the joiner transformation, the join condition will be
O_dummy (port from aggregator transformation) = O_dummy (port from expression transformation)

The output of joiner transformation will be
col, o_count, o_total_records
a, 1, 5
b, 2, 5
c, 3, 5
d, 4, 5
e, 5, 5

Step4: Now pass the ouput of joiner transformation to filter transformation and specify the filter condition as O_total_records (port from aggregator)-O_count(port from expression) <=2

In the filter transformation, the filter condition will be
O_total_records - O_count <=2

The output of filter transformation will be
col o_count, o_total_records
c, 3, 5
d, 4, 5
e, 5, 5

Design a mapping to load the first record from a flat file into one table A, the last record from a flat file into table B and the remaining records into table C? 
This is similar to the above problem; the first 3 steps are same. In the last step instead of using the filter transformation, you have to use router transformation. In the router transformation create two output groups.

In the first group, the condition should be O_count=1 and connect the corresponding output group to table A. In the second group, the condition should be O_count=O_total_records and connect the corresponding output group to table B. The output of default group should be connected to table C.



Consider the following products data which contain duplicate rows.
A
B
C
C
B
D
B



Q1. Design a mapping to load all unique products in one table and the duplicate rows in another table.
The first table should contain the following output
A
D


The second target should contain the following output
B
B
B
C
C

sorter transformation and sort the products data. Pass the output to an expression transformation and create a dummy port O_dummy and assign 1 to that port. So that, the DUMMY output port always return 1 for each row.

The output of expression transformation will be
Product, O_dummy
A, 1
B, 1
B, 1
B, 1
C, 1
C, 1
D, 1

Pass the output of expression transformation to an aggregator transformation. Check the group by on product port. In the aggreagtor, create an output port O_count_of_each_product and write an expression count(product).

The output of aggregator will be
Product, O_count_of_each_product
A, 1
B, 3
C, 2
D, 1

Now pass the output of expression transformation, aggregator transformation to joiner transformation and join on the products port. In the joiner transformation check the property sorted input, then only you can connect both expression and aggregator to joiner transformation.

The output of joiner will be
product, O_dummy, O_count_of_each_product
A, 1, 1
B, 1, 3
B, 1, 3
B, 1, 3
C, 1, 2
C, 1, 2
D, 1, 1

Now pass the output of joiner to a router transformation, create one group and specify the group condition as O_dummy=O_count_of_each_product. Then connect this group to one table. Connect the output of default group to another table.

Q2. Design a mapping to load each product once into one table and the remaining products which are duplicated into another table.
The first table should contain the following output
A
B
C
D


The second table should contain the following output
B
B
C

Use sorter transformation and sort the products data. Pass the output to an expression transformation and create a variable port,V_curr_product, and assign product port to it. Then create a V_count port and in the expression editor write IIF(V_curr_product=V_prev_product, V_count+1,1). Create one more variable port V_prev_port and assign product port to it. Now create an output port O_count port and assign V_count port to it.

In the expression transformation, the ports are
Product
V_curr_product=product
V_count=IIF(V_curr_product=V_prev_product,V_count+1,1)
V_prev_product=product
O_count=V_count


The output of expression transformation will be
Product, O_count
A, 1
B, 1
B, 2
B, 3
C, 1
C, 2
D, 1

Now Pass the output of expression transformation to a router transformation, create one group and specify the condition as O_count=1. Then connect this group to one table. Connect the output of default group to another table.



Consider the following employees data as source
employee_id, salary
10, 1000
20, 2000
30, 3000
40, 5000


Q1. Design a mapping to load the cumulative sum of salaries of employees into target table?
The target table data should look like as
employee_id, salary, cumulative_sum
10, 1000, 1000
20, 2000, 3000
30, 3000, 6000
40, 5000, 11000

Connect the source Qualifier to expression transformation. In the expression transformation, create a variable port V_cum_sal and in the expression editor write V_cum_sal+salary. Create an output port O_cum_sal and assign V_cum_sal to it.

Q2. Design a mapping to get the pervious row salary for the current row. If there is no pervious row exists for the current row, then the pervious row salary should be displayed as null.
The output should look like as
employee_id, salary, pre_row_salary
10, 1000, Null
20, 2000, 1000
30, 3000, 2000
40, 5000, 3000

Connect the source Qualifier to expression transformation. In the expression transformation, create a variable port V_count and increment it by one for each row entering the expression transformation. Also create V_salary variable port and assign the expression IIF(V_count=1,NULL,V_prev_salary) to it . Then create one more variable port V_prev_salary and assign Salary to it. Now create output port O_prev_salary and assign V_salary to it. Connect the expression transformation to the target ports.

In the expression transformation, the ports will be

employee_id
salary
V_count=V_count+1
V_salary=IIF(V_count=1,NULL,V_prev_salary)
V_prev_salary=salary
O_prev_salary=V_salary


Q3. Design a mapping to get the next row salary for the current row. If there is no next row for the current row, then the next row salary should be displayed as null.
The output should look like as
employee_id, salary, next_row_salary
10, 1000, 2000
20, 2000, 3000
30, 3000, 5000
40, 5000, Null



Step1: Connect the source qualifier to two expression transformation. In each expression transformation, create a variable port V_count and in the expression editor write V_count+1. Now create an output port O_count in each expression transformation. In the first expression transformation, assign V_count to O_count. In the second expression transformation assign V_count-1 to O_count.

In the first expression transformation, the ports will be

employee_id
salary
V_count=V_count+1
O_count=V_count

In the second expression transformation, the ports will be

employee_id
salary
V_count=V_count+1
O_count=V_count-1

Step2: Connect both the expression transformations to joiner transformation and join them on the port O_count. Consider the first expression transformation as Master and second one as detail. In the joiner specify the join type as Detail Outer Join. In the joiner transformation check the property sorted input, then only you can connect both expression transformations to joiner transformation.

Step3: Pass the output of joiner transformation to a target table. From the joiner, connect the employee_id, salary which are obtained from the first expression transformation to the employee_id, salary ports in target table. Then from the joiner, connect the salary which is obtained from the second expression transformaiton to the next_row_salary port in the target table.

Q4. Design a mapping to find the sum of salaries of all employees and this sum should repeat for all the rows.
The output should look like as
employee_id, salary, salary_sum
10, 1000, 11000
20, 2000, 11000
30, 3000, 11000
40, 5000, 11000
Step1: Connect the source qualifier to the expression transformation. In the expression transformation, create a dummy port and assign value 1 to it.

In the expression transformation, the ports will be

employee_id
salary
O_dummy=1


Step2: Pass the output of expression transformation to aggregator. Create a new port O_sum_salary and in the expression editor write SUM(salary). Do not specify group by on any port.

In the aggregator transformation, the ports will be

salary
O_dummy
O_sum_salary=SUM(salary)


Step3: Pass the output of expression transformation, aggregator transformation to joiner transformation and join on the DUMMY port. In the joiner transformation check the property sorted input, then only you can connect both expression and aggregator to joiner transformation.

Step4: Pass the output of joiner to the target table.





Click below links for more Informatica Interview Questions and Answers


Informatica Interview 1
Informatica Interview 2
Informatica Interview 4


Informatica Interview 1

What is Data warehouse? 
A Data warehouse is a subject oriented, integrated ,time variant, non volatile collection of data in support of management’s decision making process.

What are the types of data warehouses? 
There are three types of data warehouses:
  1. Enterprise Data Warehouse
  2. ODS (operational data store)
  3. Data Mart
What is Data mart? 
A data mart is a subset of data warehouse that is designed for a particular line of business, such as sales, marketing, or finance. In a dependent data mart, data can be derived from an enterprise wide data warehouse. In an independent data mart can be collected directly from sources. 

What is star schema? 
A star schema is the simplest form of data warehouse schema that consists of one or more dimensional and fact tables. 

What is snow flake schema? 
A Snowflake schema is nothing but one Fact table which is connected to a number of dimension tables, The snowflake and star schema are methods of storing data which are multidimensional in nature. 

What are ETL Tools? 
ETL Tools are stands for Extraction, Transformation, and Loading the data into the data warehouse for decision making. ETL refers to the methods involved in accessing and manipulating source data and loading it into target database. 

What are Dimensional table? 
Dimension tables contain attributes that describe fact records in the fact table. 

What is Data Modelling? 
Data Modeling is representing the real world set of data structures or entities and their relationship in their of data models, required for a database. Data Modelling consists of various types like : 
  • Conceptual data modeling
  • Logical data modeling
  • Physical data modeling
  • Enterprise data modeling
  • Relation data modeling
  • Dimensional data modeling.
 What is Surrogate key? 
Surrogate key is a substitution for the natural primary key. It is just a unique identifier or number of each row that can be used for the primary key to the table. 

What is Data Mining? 
A Data Mining is the process of analyzing data from different perpectives and summarizing it into useful information. 

What is Operational Data Store? 
A ODS is an operational data store which comes as a second layer in a datawarehouse architecture. It has got the characteristics of both OLTP and DSS systems. 

What is the Difference between OLTP and OLAP? 
OLTP is nothing but OnLine Transaction Processing which contains a normalised tables. 
But OLAP(Online Analtical Programming) contains the history of OLTP data which is non-volatile acts as a Decisions Support System. 

How many types of dimensions are available in Informatica? 
There are three types of dimensions available are :
  1. Junk dimension
  2. Degenerative Dimension
  3. Conformed Dimension
What is Difference between ER Modeling and Dimensional Modeling? 
ER Modeling is used for normalizing the OLTP database design. Dimesional Modeling is used for de-normalizing the ROLAP / MOLAP design. 

What is the maplet? 
Maplet is a set of transformations that you build in the maplet designer and you can use in multiple mapings. 

What is Session and Batches? 
A session is a set of commands that describes the server to move data to the target. A Batch is set of tasks that may include one or more numbar of tasks (sessions, ewent wait, email, command, etc). 

What are slowly changing dimensions? 
Dimensions that change overtime are called Slowly Changing Dimensions(SCD).
  • Slowly Changing Dimension-Type1 : Which has only current records.
  • Slowly Changing Dimension-Type2 : Which has current records + historical records.
  • Slowly Changing Dimension-Type3 : Which has current records + one previous records.
What are 2 modes of data movement in Informatica Server? 
There are two modes of data movement are:
  1. Normal Mode in which for every record a separate DML stmt will be prepared and executed.
  2. Bulk Mode in which for multiple records DML stmt will be preapred and executed thus improves performance. 
What is the difference between Active and Passive 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.
A Passive Transformation does not change the number of rows that pass through it i.e it passes all rows through the transformation. 

What is the difference between connected and unconnected transformation? 
Connected transformation is connected to other transformations or directly to target table in the mapping.
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. 

What are 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). 

What are 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. 

What are Filter transformation? 
Filter transformation is an Active and Connected transformation. This can be used to filter rows in a mapping that do not meet the condition. 

What are Joiner transformation? 
Joiner Transformation is an Active and Connected transformation. This can be used to join two sources coming from two different locations or from same location. 

Why we use lookup transformations? 
Lookup Transformations can access data from relational tables that are not sources in mapping. 

What are 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 denormalized format. Also, Normalizer transformation can be used to create multiple rows from a single row of data.  

What are Rank transformation? 
Rank transformation is an Active and Connected transformation. It is used to select the top or bottom rank of data. 

What are Router transformation? 
Router transformationis 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. 

What are Sorter transformation? 
Sorter transformation is a Connected and an Active transformation. It allows to sort data either in ascending or descending order according to a specified field. 




Click below links for more Informatica Interview Questions and Answers
Informatica Interview 2
Informatica Interview 3
Informatica Interview 4