Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Disable All constraints from application
The command to disable a constraint is 'alter constraint <constraint_name>
disable;' So running
select 'alter constraint '||constraint_name||' disable;'
from user_constraints
where....
will give you some output you can use to write a script to do what you wish. a similar script can be made to reenable afterwards.
Updating the data dictionary directly is a terrible terrible idea. You wouldn't hex edit the file allocation table on a windows system to delete a file would you?
-- Niall Litchfield Oracle DBA Audit Commission Uk "Davide Gurgone" <mortecerta_NOSPAM__at_libero.it> wrote in message news:l_wlb.331351$R32.10927377_at_news2.tin.it...Received on Wed Oct 22 2003 - 10:16:56 CDT
> Hi All,
> I hope I'm not OT :o!
>
> I've got a problem, I need to disable temporally all constraints in one
> specific schema, but the script I do doesn't work:
>
> UPDATE USER_CONSTRAINTS
> SET STATUS = 'DISABLED'
> WHERE R_OWNER = 'OWNER'
> COMMIT;
>
> I need it to Truncate every table in my shema.
>
> If someone has got another idea, I'm happy to implement it!!!
>
> Thanks all!
>
> Davide
>
>