Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Move table online and update the indexes at the same time.

Re: Move table online and update the indexes at the same time.

From: Alexandre Gorbatchev <agorbatchev_at_amadeus.net>
Date: Tue, 27 Jul 2004 07:48:43 +0200
Message-ID: <OFE487EAA9.2907E80B-ONC1256EDE.001EE0E8-C1256EDE.001FEC7E@amadeus.net>


We would definitely test it properly before doing in production but just wanted to know where the possible problems are. By the way, when is the lock required - in the beginning or in the end? I move the table for several reasons:
1.) CREATE TABLE ... AS SELECT produces the table which is much smaller (sometimes 2-3 times). We are trying to reduce the space usage with it. So it seems the tables are space.
2.) Change storage clause - FREELIST, FREELIST GROUP or move to ASSM (not sure, because it seems there are several bugs that we might hit in our environment)
3.) Physical layout reorganization. Some tables are in wrong tablespaces.

Thanks for your help.

Alex

From: Tanel Põder <tanel.poder.003_at_mail.ee>@freelists.org on 27-07-2004 01:36 ZE3
Please respond to oracle-l_at_freelists.org Sent by: oracle-l-bounce_at_freelists.org

To:
<oracle-l_at_freelists.org>

cc:

Subject:
Re: Move table online and update the indexes at the same time.

> Tanel,
> Thanks for the reply.
> It's 9i. I thought about table redefinition but I am not sure how it
> affect the performance. Second, I wonder if there a need to get a lock
on
> the table just for a split of a second. We do not have any chance
locking
> the table since there are always several transactions using it.
> What is your experience? Since it appeared only in 9i I am a bit worried
> about using it.

I've never used it in production myself, but as much I've heard, it does have its problems and limitations - thus extensive testing would be needed.
It will increase your load, since it basically creates a materialized view log for your table (and you have to clone the table manually + build the indexes + apply the changes incrementally later on).

Redefinition package will require a lock for short time on your table if used properly. The temporary locking could be implemented by deferring your
transactions for a short time if possible and/or having a tight pl/sql loop
which retries the operation until it succeeds.

Btw, in 10g there is a "ddl_wait_for_locks" parameter which you can set to true on your session level - that way Oracle will execute DDL commands in wait mode, thus waiting until all incompatible locks on given object are released, instead of erroring out immediately.

Btw, why are you trying to move your tables?

Tanel.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------




----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jul 27 2004 - 00:46:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US