Escolar Documentos
Profissional Documentos
Cultura Documentos
com/groups/technical-functional/informatica-
l/how-to-maintain-only-1-year-historical-data-in-dimension-from-current-date-907
743
How to maintain only 1 year historical data in dimension from current date
==========================================================================
step4)
-------
delete all data from current_day_data or truncate this table (will be
faster).
last_day_data current_day_data history
archieve
02-feb-2005 to 01-feb-2006
01-jan-2001 to 01-feb-2005
step5)
-------
load today's data ie 02-feb-2005 to current_day_data
last_day_data current_day_data history
archieve
02-feb-2006 02-feb-2005 to 01-feb-2006
01-jan-2001 to 01-feb-2005
step6)
-------
insert data of minimum date from history ie 02-feb-2005 to last_day_data
step7)
-------
delete minimum date record from history ie of 02-feb-2005 or drop the
partition having records of 02-feb-2005, which will be faster.
last_day_data current_day_data history
archieve
02-feb-2005 02-feb-2006 03-feb-2005 to 01-feb-2006
01-jan-2001 to 01-feb-2005
note : to use history table (dimension) for lookup, you have to create
view having following query
create view history_view as
select * from history
union all
select * from last_day_data
union all
select * from current_day_data
How to maintain only 1 year historical data in dimension from current date
==========================================================================
Asked by rama_krishna | posted Jan 24, 2006 | Replies (4)
0
Please Sign-in or Register to vote
Hi Shashi,
I am not sure which part is right!
But it can be achived in Informatica easilly.
I assume that you have two tables an History and a current dimension table to st
ore one year data.
I believe you already have an interface to load this Dimension table.
Assuming that Oracle is DB
1. To store data in History/archive table :
Select records from current Dimension table use ADD_MONTHS ('01-JAN-2006', -12).
Insert these records to History table.
2. remove records from Dimension table :
It should delete records less than ADD_MONTHS ('01-JAN-2006', -12).
Both of theese queries can be written in Post session SQL of the interface to lo
ad dimension table.
You can replace '01-JAN-2006' with sysdate or the any required date.
Regards,
Ramakrishna