Big file process with Aggregator stage - New big problem !

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Big file process with Aggregator stage - New big problem !

Post by brunix »

Hi,
We need some suggestion about this problem:

we have to process 30.000 sequential file daily containing totally about 300.000.000 records.

We have to load all records in one Oracle table.
In another table we have to load the same records grouped by two fields.
The aggregated records will be about 50.000.000

What is the best approach to implement this process ?

The aggregator stage can manage 300.000.000 records in few hours ?

The datastage server is installed on a AIX multiprocessor server.
For example to load an hashed file from a sequential file the process work about 20000 rows/sec.

Any suggest will be good,
Brunix
Last edited by brunix on Wed Jul 02, 2008 4:44 am, edited 1 time in total.
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post by Cr.Cezon »

a solution could be to group the 30000 files in n files of a prudent size, and then load it in Oracle.

1.-to group files you can use the unix command cat file* > file_grouped

2.-I think it could be better group in BD than in DS, so first load in table and after do:
insert into table2 select columkey1 , columnkey2 from table
group by columkey1 , columnkey2

regards,
Cristina.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define 'load'. Are there any transformations involved? All inserts? Insert / update / delete?

As noted, I'd probably opt for letting the database perform the aggregation for the second load.
-craig

"You can never have too many knives" -- Logan Nine Fingers
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

chulett wrote:Define 'load'. ....
Hi Chulett,
For load I mean to insert every day 300 millions records in an detail oracle TABLE_1 (this table increase 300 millions daily).
In this load process we only have a lookup to an hashed file with 200.000 records to decode a field for each record in input.
We make a prototype and this job running at 6000 rows/sec so to charge all 300 millions rows we need about 13 hours.

Until this step no problem, we can process instead of one 300 millions records file 6 of 50 millions or 12 of 25 millions records...

The big issue is to have the aggregate TABLE_2 derived from the detail TABLE_1.

This aggregate table have around 50 millions rows. But every day when you insert new records in TABLE_1 you need to update TABLE_2 with new grouped values.

I describe you hour prototype:

SOURCE FILE====>Transformer with lookup |==first link===>aggregate records into an hashed or sequential file ==second link===>insert into TABLE_1

After this job we have a 50 millions records hashed/sequential file and we can use it as source for a job who will insert or update rows in TABLE_2.
I have also try an update or insert new row option but the performance was very bad.

Sorry for my english,
Brunix
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If there are only fully-additive facts (sum, count, min or max) in the aggregate table you can maintain it while inserting rows into the detail table (that is, from the same DataStage job or using some mechanism - such as a trigger or a stored procedure - within Oracle).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

Hi all,
I have a big problem with my aggregators :D .

Since I open this post something has changed.

Now my job is as following :

[img=http://img397.imageshack.us/img397/5893/nuovoimmaginebitmapul8.th.jpg]

I have 10 sequential sorted files in input to 10 aggregators the output of each aggregator insert directly into the same table.

the problem is that evenif I sorted all sequential files the input links to the aggregators increase and the output links to the tabel remain at zero.

After 10-12 million rows the job go in abort with the anonymous message "Abnormal termination of stage Job0303G_Aggr_Voice..Aggr02 detected".
The Aggr02 is the second of 10 aggregators.

Why if I sorted the sequential input the aggregator don't send anything to his output link ?

Please is need help quickly, because we have to put the job in production environment ASAP.

Thanks,
Brunix
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In the aggregator, did you specify the "sort" and "sort order" for any of your columns? If you didn't then the Aggregator stage has no way of knowing that the data is sorted and it doesn't have to store the data in memory for group changes.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right. You need to ensure that the Aggregator knows your input is sorted or it will 'sort' it itself. Again. And go boom when the volume is too high to hold all in memory. Never mind the fact that your job design will run all ten segments at the same time, compounding any memory issue.
-craig

"You can never have too many knives" -- Logan Nine Fingers
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

Yes,
I specify the sort fields and the sort order.
Only one thing, apart sort field and sor order i marked all field like key.
Can it would be this the problem ?
I just try again removing key specification....
In a minutes I reply with the results...
Thanks,
Brunix
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You have to sort the data in a manner that actually supports the grouping being done or it will be ignored. And the stage will bust you if it finds you've lied about the order and abort with the ever appreciated 'row out of sequence' error. :wink:

You can tell you've got the sorting correct when rows flow into and out of the Aggregator stage as the job runs. If they go in but don't come out until everyone is in there, then you've missed something.
-craig

"You can never have too many knives" -- Logan Nine Fingers
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

:cry:
Dear friends,
bad news...
As you can see in the image below

[img=http://img365.imageshack.us/img365/6261/nuovoimmaginebitmapun7.th.jpg]

The job go in abort again.
Now the aggr_01 goes wrong.
The very strange thing is that after the abort the other nine aggregators go until the end, inserting rows in the table !!
How is it possible ?
I don't know what is the possible solution.
Did you think if I divide this job in two jobs of 5 aggregators each one I can resolve ?
Please I trust in you, help me !
Brunix
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

Hi all,
I resolve the problem.
I notice that the aggregator must have minimum the same fields in input and output.
In my job in the output link of the aggregator i miss an unused field.
This caused the error.

Now I put a transformer between aggregator and OCI stage, so the aggregator have the same fields in I/O links and in the transformer I don't map the unused field .

Everything goes good and quickly.

Thanks at all,
Brunix
brunix
Premium Member
Premium Member
Posts: 25
Joined: Fri Aug 26, 2005 3:29 am

Post by brunix »

Hi all,
I resolve the problem.
I notice that the aggregator must have minimum the same fields in input and output.
In my job in the output link of the aggregator i miss (intentionally) an unused field.
This caused the error.

Now I put a transformer between aggregator and OCI stage, so the aggregator have the same fields in I/O links and in the transformer I don't map the unused field .

Everything goes good and quickly.

Thanks at all,
Brunix
Post Reply