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: disable/enable primary keys

Re: disable/enable primary keys

From: Julio Negueruela <julio.negueruela_at_si.unirioja.es>
Date: Wed, 12 May 1999 18:00:14 +0200
Message-ID: <3739A58E.D7BEDF42@si.unirioja.es>

nieuws net escribió:
> =

> Hi
> =

> Anyone with a great script that can generate sql to disable and enable
> the primary key + storage definitions
> =

> e.g.
> =

> alter table xxxx disable primary key;
> =

> alter table enable primary key using index etc.....

I think that you don't need to specify the index clause in a enable statement because indexes aren't dropped when you disable the primary key.
So you can:
select 'alter table '||table_name||' disable constraint '||constraint_name||';' =

  from dba_constraints =

 where constraint_type='P';

and

select 'alter table '||table_name||' enable constraint '||constraint_name||';' =

  from dba_constraints =

 where constraint_type='P';

Regards.
-- =

Julio Negueruela
DBA Servicio Informático

Universidad de La Rioja      -      Spain
Telf: 941-299179     Fax: 941- 299180

mailto:julio.negueruela_at_si.unirioja.es Received on Wed May 12 1999 - 11:00:14 CDT

Original text of this message

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