Tuesday, June 24, 2014

ODI SNP & Temporary Tables list ?

ODI SNP & Temporary Tables. 

1)     RKM will store the metadata into below following tables.
1.     Cleans up the SNP_REV_xx tables from previous executions using the OdiReverseResetTable tool.
2.     Retrieves sub models, datastores, attributes, unique keys, foreign keys, conditions from the metadata provider to SNP_REV_SUB_MODEL, SNP_REV_TABLE, SNP_REV_COL, SNP_REV_KEY, SNP_REV_KEY_COL, SNP_REV_JOIN, SNP_REV_JOIN_COL, SNP_REV_COND tables.

2)     LKM Temporary Tables.
a.     C$ table will be created by LKM for load the data from Source table to C$ staging table.
3)     CKM Temporary Tables.
a.     E$ Table for store error records while checking the Dataquality at Mapping level
b.    SNP_CHECK_TAB is a common error table to maintain the high level error details like. Schema name, table name, Error , Error type.
4)     IKM Temporary Tables.
a.     I$ table using for to load the data for integration before going to target table
5)     JKM Temporary Tables.
a.     J$ table for CDC concept to store the PK value into J$ table
b.    T$ Trigger for CDC concept is enabled at source table for DML trigger
c.     V$ View  will display the data for both Source and J$ table join query
d.    V$ DView will be joined both Source and J$table for filter condition with subscriber






What are the different types IKM Knowledge Module?

What are the different types IKM Knowledge Module?

1)     Append: Insert records from the flow into the target. It is possible to optionally delete all records from the target before the insert. Existing records are not updated.
      Using options like  TRUNCATE or DELETE_ALL =ture
2)     Control Append: Same as above, but in addition the data flow is checked in the process.
3)     Incremental Update: Same as above. In addition, it is possible to update existing records with data from the flow.

4)     Slowly Changing Dimension: Integrate data into a table using Type 2 slowly changing dimensions (SCD).

Oracle Data Integrator Project Components in ODI 12c

Oracle Data Integrator Project Components in ODI 12c

The following components are stored into a project. They appear in the in the Project accordion in the Designer Navigator, under the project's node.
Folder
Folders are components that help organizing the work into a project. Folders contain packages, mappings, procedures, and subfolders.
Packages
A package is a workflow, made up of a sequence of steps organized into an execution diagram. Packages assemble and reference other components from a project such as mappings, procedure or variable.
Mappings
A mapping is a reusable dataflow. It is a set of declarative rules that describes the loading of one or several target datastores from one or more source datastores. See 
Procedure
A Procedure is a reusable component that groups a sequence of operations that do not fit in the mapping concept.
Examples of procedures:
1)     Wait and unzip a file
2)     Send a batch of files via FTP
3)     Receive emails
4)     Purge a database
Variable
A variable's value is stored in Oracle Data Integrator. This value may change during the execution.
Sequence
A sequence is a variable automatically incremented when used. Between two uses the value is persistent.
User Functions
User functions allow you to define customized functions or "function aliases," for which you will define technology-dependent implementations. They are usable in mappings and procedures.
Knowledge Modules
Oracle Data Integrator uses Knowledge Modules at several points of a project design. A Knowledge Module is a code template related to a given technology that provides a specific function (loading data, reverse-engineering, journalizing).
Markers
A component of a project may be flagged in order to reflect a methodology or organization. Flags are defined using markers. These markers are organized into groups, and can be applied to most objects in a project.
Scenarios

When a package, mapping, procedure, or variable component has been fully developed, it is compiled in a scenario. A scenario is the execution unit for production. Scenarios can be scheduled for automated execution. See 

ODI Topology Coponent List of Objects

Topology Navigator
Topology Navigator is used to manage the data describing the information system's physical and logical architecture. Through Topology Navigator you can manage the topology of your information system, the technologies and their data types, the data servers linked to these technologies and the schemas they contain, the contexts, the language and the agents, as well as the repositories. The site, machine, and data server descriptions will enable Oracle Data Integrator to execute the same mappings in different environments.
This section contains these objects:
1.       Physical Architecture
2.       Contexts
3.       Logical Architecture
4.       Agents
5.       Languages
6.       Repositories

Physical Architecture

The physical architecture defines the different elements of the information system, as well as their characteristics taken into account by Oracle Data Integrator. Each type of database (Oracle, DB2, etc.), file format (XML, Flat File), or application software is represented in Oracle Data Integrator by a technology.

Contexts

Contexts bring together components of the physical architecture (the real Architecture) of the information system with components of the Oracle Data Integrator logical architecture (the Architecture on which the user works).
For example, contexts may correspond to different execution environments (Development, Test and Production) or different execution locations (Boston Site, New-York Site, and so forth.) where similar physical resource exist.

Logical Architecture

The logical architecture allows a user to identify as a single Logical Schema a group of similar physical schemas - that is containing data stores that are structurally identical - but located in different physical locations. Logical Schemas, like their physical counterpart, are attached to a technology.

Languages

Languages defines the languages and language elements available when editing expressions at design-time. Languages provided by default in Oracle Data Integrator do not require any user change.

Repositories (Master & Work Repositories)


The topology contains information about the Oracle Data Integrator repositories. Repository definition, configuration and installation is covered in the Installation and Upgrade Guide for Oracle Data Integrator.

Physical , Context and Logical Architecture Relations in TOPOLOGY in ODI

Physical , Context and Logical Architecture Relations in TOPOLOGY in ODI 

Always Your Physical Architecture will connect direct applications or database or flat files data servers.

Context is an interface or mediator between Logical and Physical Architecture and It will act as a Environments or Set of Servers related to the Environment or Locations.

Logical Architecture is an alias or synonym for you physical schemas. we can create one logical schema
for your set of physical schemas based on contexts.






Difference between ELT & ETL Architecture


ETL versus ELT Architecture.


Extract -- the action of reading data from a database.
Transform -- the action of transforming the extracted data from its previous form into the resultant form.
Load -- the action of writing the data into the target database. 




Difference between ELT & ETL
Column1 ETL ELT
Approach Traditional Modern/Future
Transformations Row-By-Row Bulk
Data Movement Throgh Network Twice Only Once
Engine(Staing server) Require Not Required
Database Performance No need to be high Should be high
Licensing  cost High Comparitively Low
Examples Datastage,Informatica ODI/ Sunopsis




Type of Data Modeling?

Type of Data Modeling?

1) Conceptual Data Model
2) Logical Data Model
3) Physical Data Model

Conceptual Data Model - Design Step 1

This is First step for DWH Designing.

Conceptual Data Model is the first step in Data Warehouse design. In conceptual data model, very high level relationships between dimension and fact table is depicted. Conceptual data model not necessarily includes keys, attributes of tables. Conceptual data model gives a very high level idea of proposed Data Warehouse design including possible fact and dimension table. Conceptual data model is the stepping stone to design logical data model of Data Warehouse.


Characteristics of Data Warehouse Conceptual Data Model
  1. It shows only high level relationship between tables.
  2. It does not show primary key or column names
  3. It is the stepping stone of Logical Data Model

Logical Data Model - Design Step -2

This is Second step for Designing  

Good Logical data model in data warehouse implementation is very important. Logical data model has to be detailed (though some might not agree) as it represents the entire business in one shot and shows relationship between business entities. Logical Model should have following things to make it detailed and self explanatory.
  1. All entities to be included in data warehouse
  2. All possible attributes of each entity
  3. Primary keys of each entity ( Natural Keys as well as Surrogate Keys )
  4. Relationships between each every entity
Characteristics of Data Warehouse Logical Data Model
  1. It has all the entities which will be used in data warehouse
  2. It shows all possible attributes of all entities
  3. It depicts the relationships between all entities

Physical Data Model - Design Step -3

This is third step for Designing for DWH Design

Physical Data Model is the actual model which will be created in the database to store the data. It is the most detailed data model in Data Warehouse data modeling. It includes
  1. Tables names
  2. All column names of the table along with data type and size
  3. Primary keys, Foreign Keys of a table
  4. Constraints

Physical Data Model can be converted to actual SQL DDL statement by using different tools. ERWIN is the famous tool to do this.

Types of Facts In Data Warehousing ?

Types of Facts In Data Warehousing ?

Additive:
Additive facts are facts that can be summed up through all of the dimensions in the fact table. A sales fact is a good example for additive fact.
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.
Eg: Daily balances fact can be summed up through the customers dimension but not through the time dimension.
Non-Additive:
Non-additive facts are facts that cannot be summed up for any of the dimensions present in the fact table.
Eg: Facts which have percentages, ratios calculated.

Factless Fact Table:
 In the real world, it is possible to have a fact table that contains no measures or facts. These tables are called “Factless Fact tables”.
Eg: A fact table which has only product key and date key is a factless fact. There are no measures in this table. But still you can get the number products sold over a period of time.
Based on the above classifications, fact tables are categorized into two:
Cumulative:
This type of fact table describes what has happened over a period of time. For example, this fact table may describe the total sales by product by store by day. The facts for this type of fact tables are mostly additive facts. The first example presented here is a cumulative fact table.
Snapshot:
This type of fact table describes the state of things in a particular instance of time, and usually includes more semi-additive and non-additive facts. The second example presented here is a snapshot fact table.

Types of Dimensions in Data warehousing ?

Types of Dimensions in Data Warehousing?
Dimension -
A dimension table typically has two types of columns, primary keys to fact tables and textual\descreptive data.?
Fact -A fact table typically has two types of columns, foreign keys to dimension tables and measures those that contain numeric facts. A fact table can contain fact’s data on detail or aggregated level.

Types of Dimensions -
Slowly Changing Dimensions:
 Attributes of a dimension that would undergo changes over time. It depends on the business requirement whether particular attribute history of changes should be preserved in the data warehouse. This is called a Slowly Changing Attribute and a dimension containing such an attribute is called a Slowly Changing Dimension.

Rapidly Changing Dimensions:
A dimension attribute that changes frequently is a Rapidly Changing Attribute. If you don’t need to track the changes, the Rapidly Changing Attribute is no problem, but if you do need to track the changes, using a standard Slowly Changing Dimension technique can result in a huge inflation of the size of the dimension. One solution is to move the attribute to its own dimension, with a separate foreign key in the fact table. This new dimension is called a Rapidly Changing Dimension.

Junk Dimensions:
A junk dimension is a single table with a combination of different and unrelated attributes to avoid having a large number of foreign keys in the fact table. Junk dimensions are often created to manage the foreign keys created by Rapidly Changing Dimensions.

Inferred Dimensions:
While loading fact records, a dimension record may not yet be ready. One solution is to generate an surrogate key with Null for all the other attributes. This should technically be called an inferred member, but is often called an inferred dimension.

Conformed Dimensions:
A Dimension that is used in multiple locations is called a conformed dimension. A conformed dimension may be used with multiple fact tables in a single database, or across multiple data marts or data warehouses.

Degenerate Dimensions:
 A degenerate dimension is when the dimension attribute is stored as part of fact table, and not in a separate dimension table. These are essentially dimension keys for which there are no other attributes. In a data warehouse, these are often used as the result of a drill through query to analyze the source of an aggregated number in a report. You can use these values to trace back to transactions in the OLTP system.

Role Playing Dimensions:
A role-playing dimension is one where the same dimension key — along with its associated attributes — can be joined to more than one foreign key in the fact table. For example, a fact table may include foreign keys for both Ship Date and Delivery Date. But the same date dimension attributes apply to each foreign key, so you can join the same dimension table to both foreign keys. Here the date dimension is taking multiple roles to map ship date as well as delivery date, and hence the name of Role Playing dimension.

Shrunken Dimensions:
A shrunken dimension is a subset of another dimension. For example, the Orders fact table may include a foreign key for Product, but the Target fact table may include a foreign key only for ProductCategory, which is in the Product table, but much less granular. Creating a smaller dimension table, with ProductCategory as its primary key, is one way of dealing with this situation of heterogeneous grain. If the Product dimension is snowflaked, there is probably already a separate table for ProductCategory, which can serve as the Shrunken Dimension.

Static Dimensions:

Static dimensions are not extracted from the original data source, but are created within the context of the data warehouse. A static dimension can be loaded manually — for example with Status codes — or it can be generated by a procedure, such as a Date or Time dimension.

ODI Interview Questions and Answers

ODI Interview Questions and Answers

1)We have an options recyle_errors on target table Flow tab. how exactly it works?

A)ODI KM’s option called Recycle Errors does the following

ODI reads from the E$ tables and loads into the I$ capturing all the records

 which are not present in the I$ by matching on the Primary Key or Unique Keys.

2)-I'd like to ask if it possible to use a stored procedure (maybe in cursor) as a data source?

A) As far as i know i dont think you can. 
Either you can use a table, or view or synonym. 
If you have a sql query convert it to a view or use a temporary interface.

 Iam not very sure the codes used in your procedure. If you can put the code here then it would be better to understand and develop the logic.
If its a direct insert to your table you can use odi procedure with java code and jython codes. 
We can write the return resultset of your procedure to a table with help help java/jython without taking the help of interface.

3)
Is it possible to place a variable as a parameter in an API Reference? 

I have a project variable (var1) which uses an API Reference <%=odiRef.getContext("CTX_CODE")%> to get the context code. 
I also have another project variable (var2) that uses the API reference <%=odiRef.getSchemaName ()%>.
Then I want to use var1 as a parameter in API <%=odiRef.getSchemaName("SCHEMA_NAME", "VAR1", "W")%>... is this possible?

A)Though i doubt on this still Check it once.

<%=odiRef.getSchemaName("SCHEMA_NAME", "#VAR1", "W")%>

4)
Whenever i start the CDC it is creating, J$ tables, JV$ Views, UT$ and DT$ triggers.
 but when i stop the CDC it is dropping the tables and views but not the triggers. 
Can anyone please tell me why it is not dropping the tirggers . 
one more issues i have is when i check the trigger script it is pointing to SNP_SUBSCRIBERS in different schema. 
i am not understanding why it is pointing to SNP_SUBSCRIBERS in another schema.please help me with this

A)SNP_SUBSCRIBER will be created in the work schema defined under your Source connection (in Topology) -
 I would advise you keep it here to be honest, saves cluttering up the data schema in the source system.

If ODI is not attempting to drop triggers, why not create an additional KM step to do this for you?
If you study the JKM, there are options to determine when a step runs (Create Journal, Drop Journal,
 Extend Window etc etc.) - Just grab the API ref to create trigger name and re-use in a simlar fashion to drop it.


5)
I am using OdiScpPut for scp the file from ODI server to another Hyperion Server, getting following error.

ODI Command used:

OdiScpPut "-HOST=<Target Server Name>" "-USER=<User Name>" "-PASSWORD=<encrypted password>" 
"-LOCAL_DIR=C:\ODI\FILES" "-LOCAL_FILE=EXTRACT.csv" "-REMOTE_DIR=/eas/app/BI/test" "-COMPRESSION=NO" 
"-STRICT_HOSTKEY_CHECKING=NO" "-TIMEOUT=10"

error-caused by :timeout (socket is not established)


6) how to prevent overwrite existing data in table

A)In target propertices of flow tab if you are using Incremental update tab

Set Option UPDATE = false.   
OR 
A) Use Control append KM



7)
I have Table1(col1,col2),Table2(col1,col2,col3) and excel spredsheet.
I need to compare value of col1 from table1 with col1 of table2.
If it is present in table2 then no action and if not insert that record in excel file.

A)
Reverse engineer Table1, Table2 and your excel spreadsheet (with relevant topology, ODBC / JDBC connections to write out to excel)

Two ways of doing it in an interface :

Option 1 (if using 11G) 

Use the Minus operator , First data set : Table1 , Second data set : Table 2 , map only colum1 ,
 the resulting SQL will load all the values from Table1 that do not exist in table2 to your I$ table, then write out to the Excel File.

Option 2 (if using 10G or alternative to the above)

Source datastore : Table 1
Target datastore : Excel File.

Filter on Table 1 ,NOT EXISTS (select 'x' from <%=odiRef.getObjectName("Table2")%> 
where <%=odiRef.getObjectName("Table1")%>.col1 = <%odiref.getobjectname("Table2")%>.col1 )

so the SQL when loading C$ table will look like :

select
col1,col2 from Table 1 where 1=1 and not exists (select 'x' from table2 where table1.col1 = table2.col1)

This will only give you the values from Table1 that dont exist in Table2, into the I$ table , ready to go out to your excel file.


8) How to tune a mapping in ODI ?

A)Choose between various knowledge modules (KMs) for loading and integration.
 Each one performs differently based on the source/target technology and the type of data that you're dealing with. 
Some perform better than others depending on the situation. Some KMs use set-based transactions, others use PL/SQL blocks to commit data in small batches.

Choose where ODI should execute each join/filter/transform. You can usually choose between the source, target or a separate staging area.
What you choose here can influence how much source data you will extract and process.

The ODI KMs utilize temporary tables to perform the loading, checking and transform operations and will create the necessary indexes for performance.
 It will also analyse these tables as part of the flow to enable the DB engine to generate accurate execution plans.


9)  what is the purpose of defining the OLAP type (dimension, fact table, SCD) in the data store properties in ODI?
 I'm already familiar with dimensions & fact tables as used in data warehousing modeling. 
I am just wondering how specifying the OLAP type of a data store affects its behavior.


A)Pretty sure it opens up the UI to set more options depending on that option, not at PC so cant check.
e.g SCD - Surrogate Key, Current Record, Start Date, End Date etc.


10)what is the difference between JKM Oracle Simple and JKM Oracle Consistent?


A)  With simple journalisation, you focus on 1 table / 1 interface.
When you launch the interface, the journalized data are extracted, then loaded into the target, and the J$ table is deleted.
There is no relation other tables in the CDC process.
It means you can capture changed data in a table A, but not in table B if you want.

With Consistent journalisation, you focus on a set of tables (ex : an entire model). You will focus on a package, and not an unique interface.
When you launch an interface, the journalized data will be extracted and loaded into the target, 
but the J$ table won't be deleted until you decide to purge the journal (at the end of the package.).

This type of journalisation is more complicated, but very important if you have relations between journalised table.

for instance, suppose you have an "order table" and "order line table" in your source. With consistent CDC, 
the data you will capture will be consistent between the 2 tables. You won't capture only order ligne table data, but no order table data.

Actually, the J$ table and the JV$ view structures are different in Simple CDC, or Consistent CDC.

To make it simple, the simple CDC has to be used ONLY if you focus on 1 source table, or various independant source table. 
But if you have relationships between many source table and you want to journalize all these table, you should use consistent CDC. Then consistent JKM.



JKM Oracle consistenet takes care of referential integrity 
i.e. befor populating journalised data in child table, it will make sure that parent table has related data.
While Simple JKM doesnt check referential integrity


11)
I just want to know the procedure to do testing in ODI. 
And along with how to move data from one environment to another environment, say for example now I am working with DEV environment. I want to 
move this data to Testing environment and after that to the Production.


A)What do you mean by "moving data" ?

If you're talking about moving the ODI object, like scenario, projects, interfaces... then use "export / import" tool to move your source into other environment.

If you're talking about data that are in your database table, then use "context". Create 1 context for development, 1 context for Testing and so on.
Just change the context when you want to change data / environment in order to do your QA tests.



12) 

 I am attempting to re-organize the Projects in my ODI instance and can't seem to copy/paste an interface from one Project to another.
 Is this not allowed in ODI or am I doing something wrong? 

A)That's not a stupid question at all.

Actually you can't move it or copy/cut-paste it, because they have some reference in their project.

But you can export it and then import it in your other project


13) I need to process the data in each line of a file, controlling for each line, lengths, comparisons with other tables, etc.
 where these lines are correct in other table and insert them in cases of error, in another file, but not as can be.
I might give some idea.

A)
There are 2 ways to control your file.

1) Define the file as an ODI Datastore. 
When ODI will read it, it will reject the rows that doesn't fit to your specification (length, type...) in a .BAD file and an ERR.file. 
These 2 files are located in the same folder than your original file.

2) Define some constraints in your datastore : alternative key, references and conditions. Thanks to alternative key,
 your can reject the rows that are not unique. Thanks to references, you can compare data of column with values of other tables (like foreign key) and reject the bad ones.
Thanks to conditions, you can set custom rules like "this field must be equal to A, B, C or D only".

These constraints will be set in an ODI interface, whose "working schema" will be set on a specific database.
Indeed, you cannot use the constraints on the file technology, because it requires to create an error table on a database.

14)

For instance, create a simple interface that use your file on source and load any dummy table, but with insert=NO and update=NO. 
The important thing is to activate the flow control in your IKM.

OR... you can also create a full customised KM that will control your file, but it's more difficult and not native. 




15)In one of my interface when ever I executes there are some duplicates are coming to the target table. 
Say if the count of the rows around 5000 in the source table and in the target it would be around 120000. Even after using the distinct rows in the flow control some bugs are coming.

Can you please help how solve this...
Note:In source table one column contains surrogate key.
IKM oracle control append is the KM I am using

A)Using the Control Append IKM will always add the data that is in the Source to the Target, unless you truncate or delete from the Target first.
 If you have data in the Source that has already been loaded to the Target, and you do not truncate the Target prior to the next load, you will have duplicates.

Are you truncating the Target or is the Source data always "new" each time the Interface is run?

Yes I am Truncating the target table, but also there will be a duplicates in the target.
 We are using three source tables out of which two tables having join condition, and the third table have filter.

Just check the number of rows loaded to C$ table. It the number of rows is as per your expction then you need to look into I$ table and the number of rows.
If the C$ table count is more than the actual count then the problem is with cross join.

For my interface rows are inserted with duplicate values and when ever I checked for the data I$ table and C$ table that table is not existing for me.

You can this in your operator tab. Open the C$ step (Load Data in LKM )and I$ steps ( Insert flow into I$ in IKM) to see the records inserted,update,deleted etc.

16)
How to pass a variable more than one values?


A)You can't.
During 1 session, 1 ODI variable can have only 1 value at a time.
If you need more than 1 value, you will have to do somethink like a loop inside your package, and refresh the variable value each time.