Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: disabling foreign keys
"Peter Morris" <no_spam.ple_at_se.com> wrote in message
news:9f2nlp$bc8$1_at_lyonesse.netcom.net.uk...
> I want to write a script that disables all foreign keys at once.
> I have tried the following
>
> update
> user_constraints
> set
> status = 'DISABLED'
> where
> constraint_name like 'ITX%FK_' ;
>
this is a bad idea.
>
> (all foreign key names follow a regular pattern)
> This produces an error message : insufficient privileges.
>
lucky for you that oracle gave you an error message, rather than trashing your dictionary.
> I think the problem is that I have insufficient priveliges set
> to do this. Our sysadmin says that it can't be done at all.
> Is he right? If so, is there any other way of doing it?
>
if your sysadmin means not updating the dictionary views, then, yes he is right. just take a look at the view text (source) for user_constraints.
alter table mytable_name disable constraint myconstraint_name ; Received on Wed May 30 2001 - 21:09:33 CDT