Unable to extend temp segment [message #638193] |
Fri, 05 June 2015 14:13 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Hi Experts,
I am trying to insert 481554905 rows with following command:-
INSERT INTO T_HISTTMP1 SELECT /*+ PARALLEL(H) */ * FROM T_HISTTMP1_NOT_PART H ORDER BY CTU_BUS_DATE;
I am getting the following errors:-
ERROR at line 1:
ORA-12801: error signaled in parallel query server P009, instance danur:ct000011 (1)
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
Please suggest if there is any ways to avoid this error.
Thanks,
Varun
|
|
|
|
Re: Unable to extend temp segment [message #638195 is a reply to message #638194] |
Fri, 05 June 2015 14:58 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Thanks John for the response.
The only issue is that Order by clause is needed since data is inserted into the partitions in order, and
later data doesn't wind up in earlier partitions,
as that would screw us up down the road when it came time to purge partitions.
I wonder what could be done in such case?
Thanks,
Varun
|
|
|
|
|
|
|
|
|
|
Re: Unable to extend temp segment [message #638398 is a reply to message #638278] |
Wed, 10 June 2015 10:46 |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
varunvir wrote on Mon, 08 June 2015 21:26Hi Blackswan,
Thanks for the response.
Why removing the hint would help getting rid of this error?
Thanks,
Varun Your hint is making the unnecessary sort use more temp space than it would if run serailly. And the hint is in any case useless, because it applies only to the SELECT, not the INSERT.
|
|
|
|
Re: Unable to extend temp segment [message #638401 is a reply to message #638400] |
Wed, 10 June 2015 13:56 |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
The ORDER BY clause forces Oracle to load the dataset into memory to sort it (ORDER BY). Hence the use of the TEMP tablespace. If you don't ORDER BY Oracle will simply read block by block, eliminating the sorting overhead.
|
|
|
|
|
|
|
|
Re: Unable to extend temp segment [message #638448 is a reply to message #638446] |
Thu, 11 June 2015 14:49 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
So If I have a table a that has 10 million record and I do
select * from table a;
So where would oracle save these records before displaying, I assume in the memory.
What if memory is not enough to hold all those records? or
is it a different mechanism involved?
Thanks,
Varun
|
|
|
|
Re: Unable to extend temp segment [message #638460 is a reply to message #638448] |
Fri, 12 June 2015 03:10 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
varunvir wrote on Thu, 11 June 2015 20:49So If I have a table a that has 10 million record and I do
select * from table a;
So where would oracle save these records before displaying, I assume in the memory.
What if memory is not enough to hold all those records? or
is it a different mechanism involved?
Thanks,
Varun
It's a different mechanism - which is described in the guide John linked to above.
|
|
|
|