Performance issue to Update data [message #664556] |
Sat, 22 July 2017 09:05 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
newuser
Messages: 3 Registered: December 2009 Location: pune
|
Junior Member |
|
|
I have a one table which is storing last 15yrs of data around 300 millions of rows
Create table tbl
(col_id numeric,
col_name varchar2(100),
column_data1 numeric,
column_date2 numeric,
column_dt date,
-
-
-);
There is no indexes on table but have the range partition on column_dt.
I want to update the data a on specific condition (combination of column_date1 and column_date2 or say column_data1 = 111 and column_date2 = 222)
note - tables have remaining combination of data.
I have tried create table
tbl_bk as select * from bk;
but facing performance issue.
please suggest what is fastest and efficient way to update such large table?
|
|
|
|
Re: Performance issue to Update data [message #664558 is a reply to message #664556] |
Sat, 22 July 2017 09:52 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
newuser
Messages: 3 Registered: December 2009 Location: pune
|
Junior Member |
|
|
1. Out of the 300 million rows, how many rows are to be UPDATED? ---- around 100 millions
2. want to perform below update
update tbl
set column_data1 = 555
where column_data1 = 111
and column_data2 = 222;
please suggest fastest and easiest way
|
|
|
|
|
|
|
Re: Performance issue to Update data [message #664604 is a reply to message #664575] |
Mon, 24 July 2017 08:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
What version of the database do you have. Version 11 and above has a new ONLINE clause for index creation that will allow all your users to continue to use the table (insert, update, delete) until the index creation is completed. Just start it and walk away until it's done.
CREATE INDEX tbl_i1 ON tbl (column_data1,column_data2) ONLINE;
|
|
|