Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: disable/enable primary keys
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
![]() |
![]() |