Table Locking in Oracle

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
IBMDS4KK
Participant
Posts: 20
Joined: Tue Sep 10, 2013 5:50 am

Table Locking in Oracle

Post by IBMDS4KK »

Hi,

We have 3 jobs and in all 3 jobs target table is same. After successfully finished of each job, one record will insert in target table. Means total 3 records. But 3 jobs are different. Is there any possibility of locking the table while inserting 3 records at a time from 3 jobs.

please suggest!
Kiran Kumar

...ALL IS WELL...
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Re: Table Locking in Oracle

Post by thompsonp »

I am confused.
All 3 jobs have the same target table. After each finishes you want to insert one record into the target table. Are these the same target table? Do the jobs already insert data into the target table when they are running?

What is the requirement to lock the table? Is this lock designed to stop something else happening at the same time?

Have you considered performing the insert through a package that controls the locking?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They're asking if there will be a locking issue in this scenario, not looking for a way to lock the table. The answer is no, you'll be fine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What I'm reading is a desire to take a table level lock for the duration of all three jobs running. Basically, the answer is no, because the three jobs will use separate connections (separate database user numbers), and they can't all own the same lock.

If you want to build transactions of this kind you need all the logic in one job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
IBMDS4KK
Participant
Posts: 20
Joined: Tue Sep 10, 2013 5:50 am

Post by IBMDS4KK »

Hi,

Thanks for all.
Kiran Kumar

...ALL IS WELL...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... you've got three people with varying answers and interpretations of your post. Out of curiousity what was the actual resolution to your question?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply