We load the initial bulk load of some tables (both source and target are Oracle 11g). The process is as follows: 1. crop, 2. drop indices (PK and unique index), 3. bulk insert, 4. create indexes (again PK and unique index). Now I got the following error:
alter table TARGET_SCHEMA.MYBIGTABLE add constraint PK_MYBIGTABLE primary key (MYBIGTABLE_PK) ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
Therefore, it is obvious that the TEMP table space is small for creating PK (the FYI table has 6 columns and about 2.2 billion records). So I did this:
explain plan for select line_1,line_2,line_3,line_4,line_5,line_6,count(*) as cnt from SOURCE_SCHEMA.MYBIGTABLE group by line_1,line_2,line_3,line_4,line_5,line_6; select * from table( dbms_xplan.display );
How to determine how much TEMP table space is needed to create a PC (in my case - 102 GB)? Or will you make an assessment differently?
Optional: PC exists only in the target system. But fair point, so I run your request on the target PC:
explain plan for select MYBIGTABLE_PK from TARGET_SCHEMA.MYBIGTABLE group by MYBIGTABLE_PK ; ------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 13 | 3 (34)| 00:00:01 | | 1 | HASH GROUP BY | | 1 | 13 | 3 (34)| 00:00:01 | | 2 | TABLE ACCESS FULL| MYBIGTABLE | 1 | 13 | 2 (0)| 00:00:01 | -------------------------------------------------------------------------------------------
So how do I read this now?
source share