How to use Multiple instance to load a single table

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
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

How to use Multiple instance to load a single table

Post by nkln@you »

Hi All,
i have to load some 10 million of recs into a table. Right now i am doing with Truncate and Load. but this job is taking 7 Hrs to complete. I switched to Ora Bulk Loader(automatic) Plus IPC but still it takes 3.5 Hrs. i read about multiple instances and now i am wondering whether i can use this to my advantage. My strategy would be to load some 4-5 sequential files using link partitioner stage and then i will have a job which wil load my table from one sequential file. And If i run multiple instancesof this job then the data load might be fast. But the only thing is am i allowed to run multiple instances against a same table(oracle 9i)? If not What are the other alternatives i have.
Thanks in Advance
Aim high
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is nothing stopping you running multiple instances of your job (without the truncate being called by each instance). But the bottleneck might be the speed with which Oracle can load the data as a whole and not per process. I am pretty sure that just splitting up your load into separate streams won't speed up things; the jobs will be competing for locks and might even slow each other down depending upon your data sort order. If your Oracle database is partitioned you could ensure that each load stream only hits one partition to see if you get speed benefits.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

AFAIK, the only way to run multiple bulk loads against one table is if the table is partitioned and each load is against a specific partition. Otherwise...

Each one can also truncate their own target partition as part of the load.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I missed the bulk load part, was just thinking in terms of a normal load. I think the bulk loader in Oracle might take an exclusive table lock as well, but can't recall exactly.
dsscholar
Premium Member
Premium Member
Posts: 195
Joined: Thu Oct 19, 2006 2:45 pm

Post by dsscholar »

I think craig's idea is good.. I had implemented similar stuff in my project and it works...

Instead of having a big data file, have multiple flat files based on a key, in my case it was employee_id, partition the table on this key, and then run multiple instances of the same job to load this data in the table, use the key in the where clause.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

When i was thinking about running multiple instance of the job, i wd change my strategy to Insert Rows Without clearing. Sorry if i mislead u all. I will give the truncate command in the Before Job Subroutine. But the probelm is how to partition the incoming records into say 5 flat files? Is there any query like that? And can i load all th flat files in the same job using Link partitioner? If not What are the other alternatives i have?
Aim high
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can use the link partitioner to do this in the same job. Make sure that you do specify the job properties, Performance Tab, "Row Buffer -> Interprocess" so that these are all fired off as separate processes at runtime.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

Hi ArndW
i am not a premium member. So am not able to view ur reply. But from whatever u i got, i will have a link partitioner where i will be loading 5 seq. files at simultaneously(after enabling inter process row buffer) making few columns as the key so that all the seq. files have different data. Now how to load the table using these 5 sql files. The probelm is i have to run a job using a sequencer. So how do we run the multiple instances of a job from a sequencer?
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

JobX.invocationID1
JobX.invocationID2
JobX.invocationID3
JobX.invocationID4
JobX.invocationID5
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply