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

Home -> Community -> Usenet -> c.d.o.server -> Re: moving indexes from tablespace A to B

Re: moving indexes from tablespace A to B

From: Doug Harris <dharris_at_linktek.ca>
Date: 1997/05/09
Message-ID: <01bc5c79$deff4200$2605bfce@dougathome.ottawa.linktek.com>#1/1

fuocor_at_novachem.com wrote in article <863126384.29067_at_dejanews.com>...
> The problem is that the primary constraint indexes still are in
> tablespace A. The dump contains the alter table command with the primary
> key option. Does anyone know how I can move these indexes to the new
> tablespace B without writing tons of scripts. Or anyone have a script to
> create the scripts from data dictionary

First run the script produced by:

select 'alter table '||table_name||' disable constraint '||constraint_name||';'

   from user_constraints
   where constraint_type='P';

Then run:

select 'alter table '||table_name||' enable constraint '||constraint_name||' using index tablespace NEW_TS;'

   from user_constraints
   where constraint_type='P';

   You will still need to use exp/imp with indexfile=whatever to move those indexes not bound to constraints.

-- 
Doug Harris
Sr. Database Administrator
Linktek Corporation
Received on Fri May 09 1997 - 00:00:00 CDT

Original text of this message

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