Truncat partition - resource busy [message #473993] |
Wed, 01 September 2010 21:26  |
RMSoares
Messages: 46 Registered: September 2010 Location: Lisboa
|
Member |
|
|
Hi,
i have one procedure that run at same time for two different partition.
In the begin of the processes i do the truncate partition and after that the insert of data in the partition.
Since i have two processes running at the same time, i will fill up data in two different partition.
But it occurred one error :
"ORA-00054: resource busy and acquire with NOWAIT specified"
The problem is caused by the truncate partition. I'm doing two simultaneous execution of the same process, but when one process is doing the truncate other is insert data.
How can i do the truncate of this two partition, or insert in to, without get any error. I think the two simultaneous insert is not a problem.
So how can i lock the table in the first truncate and after that release the table for the next truncate ?
Any ideas ? Any other ideas ?
regards
|
|
|
|
Re: Truncat partition - resource busy [message #474008 is a reply to message #473998] |
Thu, 02 September 2010 00:44   |
 |
Michel Cadot
Messages: 68767 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: I'm doing two simultaneous execution of the same process, but when one process is doing the truncate other is insert data.
How can i do the truncate of this two partition, or insert in to, without get any error.
Very simple, comment the insert statements, after all you don't care if something is inserted or not as you will immediately remove (truncate) it.n ;l)
Quote:So how can i lock the table in the first truncate and after that release the table for the next truncate ?
Use GTT (Global Temporary Table) instead of permanent and no more truncate.
Now the question is, why do you need a temporary table? Most often the answer is: becasue you bad (Oracle) coded.
Regards
Michel
[Updated on: Thu, 02 September 2010 00:46] Report message to a moderator
|
|
|
|
|
Re: Truncat partition - resource busy [message #474034 is a reply to message #473993] |
Thu, 02 September 2010 02:58  |
RMSoares
Messages: 46 Registered: September 2010 Location: Lisboa
|
Member |
|
|
You said :
"Very simple, comment the insert statements, after all you don't care if something is inserted or not as you will immediately remove (truncate) it.n ;l)"
It's not correct, i will insert 100000 rows in each partition
I will try the GTT (Global Temporary Table)
Why i need the temporary table? well i'm doing massive transformation to a Data Mart, where i used same process that could be executed at the same time, to different partition.
Actually only two partition, but the number of partition will be increase.
Why i don't do everything in only one process ? Because it will be a very complex process and will be very difficult the is maintenance.
thanks for your support
|
|
|