Home » SQL & PL/SQL » SQL & PL/SQL » Adding column to the table which have the huge data (Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production)
Re: Adding column to the table which have the huge data [message #665690 is a reply to message #665677] Fri, 15 September 2017 06:29 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Revathi.orafaq wrote on Fri, 15 September 2017 07:57

Any how our itself requirement is for the existing rows we need the default value and new rows we don't require any default value .
In that case why aren't you just using an update statement?
Re: Adding column to the table which have the huge data [message #665691 is a reply to message #665559] Fri, 15 September 2017 06:39 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
I'm puzzled. You keep worrying about the time this operation will take. Keeping in mind that it should be a one-time operation, so the time it takes to complete a sql statement shouldn't be that critical. Now, keep in mind that it has already been shown that you can complete the entire thing in very much less than 10 hours tht you mentioned, by 1) issuing all the changes for a given table in one statement, and 2) opening multiple sessions to process multiple tables in parallel. Now, ask yourself this: How much time have you already spent on this thread? Why haven't you simply followed the suggestions and already completed the task? The fact that you have not done so suggests there's some other constraint that you haven't revealed.
Re: Adding column to the table which have the huge data [message #665806 is a reply to message #665691] Thu, 21 September 2017 05:51 Go to previous messageGo to next message
Revathi.orafaq
Messages: 21
Registered: September 2017
Junior Member

Hi All ,

Thanks for your help & suggestions.
With the help of your advices we are able to apply the release with in expected time .

Thanks a lot .
Revathi.T
Re: Adding column to the table which have the huge data [message #665808 is a reply to message #665806] Thu, 21 September 2017 07:35 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
It would be nice if you were to give your final solution so that people looking up the problem in the forum has an idea on what works
Re: Adding column to the table which have the huge data [message #665817 is a reply to message #665808] Fri, 22 September 2017 07:51 Go to previous message
Revathi.orafaq
Messages: 21
Registered: September 2017
Junior Member
As per the Forum suggestions we applied multiple solutions .
One of the best solution is adding NOT NULL constraint to the add the column with some DEFAULT value
(If it is applicable as per the business).

Previously most the DEFAULT value alters doesn't have NOT NULL Constraint for Partitioned table.
After adding the NOT NULL we saw a lot time difference to execute.

For some tables applied the Multi column adding logic but we didn't go for PARALLEL HINT .

Once again thanks to FORUM

Thanks
Revathi.T
Previous Topic: PL/SQl query to build a list of interval days
Next Topic: sub totals in sql
Goto Forum:
  


Current Time: Sat Apr 20 07:41:31 CDT 2024