Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Disable All constraints from application
Are you sure 'alter constraint' exists? I had to use 'alter table...'
"Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote in message
news:3f969f68$0$251$ed9e5944_at_reading.news.pipex.net...
> 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...
> > 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
> >
> >
>
>
Received on Wed Oct 22 2003 - 13:37:50 CDT