Вы находитесь на странице: 1из 4

1.

Re: Implementing type2 scd in informatica

For implementing SCD type-2, we need to have lookup on the target table. We need to check
whether that data is present in the lookup, If not we need to insert the data in one Target
instance. If the data is found, then we need to lookup whether we are having the same data
what we have received in sq. If yes, leave the data in the target untouched, Else, insert the data
and change the version number to +1.

Hi All,

I m new to this SAP DS.As per the below link i m trying to achieve SCD type 2 for
my DB Teradata.

https://wiki.sdn.sap.com/wiki/display/BOBJ/Slow%20Changing%20Dimension
%20Type%202

My Target table is already having the below data

key_id,cust_id,cust_name,city,valid_from,valid_to,curr_ind
1,2001,Garnier soft serv,San Jose,1/17/2006,12/31/9999,Y

After inserting 3 records into my source table

insert into SCD_SRC values(1,'Adobe software','Sun City','2006-12-20');


insert into SCD_SRC values(2001,'Garnier soft serv','Los Angeles','2006-12-20');
insert into SCD_SRC values(4001,'Requisite Online','San Francisco','2006-12-20');
My Job Design
-----------------------

Source Tab ---> Query --> TC --> HP --> KG --> Target Tab

But when i m trying to run the job it's stuck due to to some reason.And i have followed
all the steps mentioned in the above link.But when i have tried in the oracle DB it's
running fine but not in teradata.

Awaiting for valuable response!

Thanks
SP

Back to top
Hi Werner,

PLease find the details of job design........with all information

Job design --- SRcC tab -->Query --> TC --> HP --> KG --> Target Tab

source table structure--------------------------


CREATE SET TABLE DUTLsb.SCD_SRC ,FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
customer_id INTEGER NOT NULL,
customer_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
city VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
valid_from DATE FORMAT 'YYYY-MM-DD')
UNIQUE PRIMARY INDEX ( customer_id );
Records in Source Table
--------------------------------
Custid Cust_nm City Valid_from
-------------------------------------------------------------------------------------
1 Adobe software Sun City 12/20/2006
2,001 Garnier soft serv Los Angeles 12/20/2006
4,001 Requisite Online San Francisco 12/20/2006

Target table Structure


--------------------------
CREATE SET TABLE DUTLsb.SCD_TRG ,FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
key_id INTEGER NOT NULL,
customer_id INTEGER,
customer_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
city VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
valid_from DATE FORMAT 'YYYY-MM-DD',
valid_to DATE FORMAT 'YYYY-MM-DD',
current_ind CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC)
UNIQUE PRIMARY INDEX ( key_id )
INDEX ( customer_id ,customer_name ,city ,valid_from );

Records in Target Table


------------------------------
Key _id Custid Cust_nm City Valid_from Valid_to Cur_ind
-------------------------------------------------------------------------------------
1 2001 Garnier soft serv San Jose 1/17/2006 12/31/9999 YWhen i will run the job ,
the target table will populate all the 3 records from source table and finally it should
have 4 records with TYPE 2 history capture.

In Table comparison I have mentioned cust_id as "Input Primary Key columns" and
cust_nm,city,valid_from defined as "Compare columns".And comparison method is
"Row-by-Row select".In HP the same list of columns mentioned for compare
columns.

In target load property I have defined the Normal Load.

Please share your valuable inputs.

How to analyze whether to use scd1 or scd2 from the business requirement? Give a
example.
How to implement scd1 using mapping parameters?

Quote from: london_wannable on November 01, 2007, 03:17:33 am


How to analyze whether to use scd1 or scd2 from the business requirement? Give a
example.

How to implement scd1 using mapping parameters?

If the business requires only the current data for a dimension, SCD1 should be employed.
Eg., Currency dimension - only the latest information is sufficient.
However, if the business requires historical data for the dimention, SCD2 should be employed.
Eg., Customer dimension, as the information about current and past customers is required.

To implement SCD1 in Informatica, a simple mapping using a source, source qualifier,


expression, lookup, router and update strategy is sufficient - there's no need of using mapping
parameters.
The second way of implementing SCD1 by simply chaging the session property update-else-
insert to true and using a source, source qualifier and target.
There is another way of implementing SCD1 by using a source, source qualifier, dynamic
lookup, filter, update strategy and target.

Hope that helps.

If most people said what’s on their minds, they’d be speechless.

Just giving a brief desription about SCD's with some examples -


Type 1 SCD overwrites old data with new data, and therefore does not track historical data at
all. This type is most appropriate when correcting certain types of data errors, such as the
spelling of a name.

   For eg –
   The Dept_name “Accounts” will be over written with the new Dept_name “Finance”
   
Type 2 SCD tracks the historical data by creating multiple records in the dimensional tables
with separate keys.
   For Eg -
   Or the historical value stored by creating a separate row in the following manner –
  
Type 3 SCD tracks the changes by creating the separate columns. Where the original table
structure in Type 1 and Type 2 was very similar, Type 3 will add additional columns to the
tables.
Hope this will help to some extent...

And regarding the usage of Mapping parameters in SCD Type 1 need to get clarified... soon will
be back with the info..

Example:
The address of a custumer may change in rare case. The address of a custumer
never changes frequently.

There are 3 types of SCD.

Type1- Here the most recent changed data is stored


Type2- Here the recent data as well as all past data (historical data) is stored
Type3- Here partially historical data and recent data are stored. it means, it stores
most recent update and most recent history.

As datawarehouse is a historical data, so type2 is more useful for it.

Вам также может понравиться