How much time required to add constraint(s)

From: Rich <richa03_at_gmail.com>
Date: Thu, 15 Dec 2011 08:37:34 -0800
Message-ID: <CALgGkeC2tYd+f+g4edDjLD3TcZFOD08gBCC67LyQD9d3z4vS=w_at_mail.gmail.com>



Hi list,
I'm trying to determine how much time will be required to build a constraint - something like:
ALTER TABLE <TABLE_NAME> ADD CONSTRAINT <NAME> FOREIGN KEY (<FK_NAME>) REFERENCES <REF_TABLE_NAME> (<REF_COL_NAME) ENABLE;

Testing this, I don't see any operation in v$session_longops, however the test runs for hours.
There are many of these and we have limited amounts of time to do them - we can do them in batches over time, however, we can't exceed our windows due to performance.

I also don't see anything in v$sql_plan for this SQL_ID...

How, exactly, does Oracle build a constraint? Ie, what plan/operations does it use.
Is there any way I can estimate time (blocks read, etc.) prior to building the constraint?

Thanks,
Rich

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 15 2011 - 10:37:34 CST

Original text of this message