Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: constraint modification
Hi,
I think, this might cause a problem in production environments - there is a race condition. Your data can get screwed if you do that in multi-user mode. Better shut down the listener or go into single- user mode before doing that.
So, having this alter constraint .. working might not be a bad idea. Perhaps Oracle can put this on the wish-list for a next release.
Mind you, this 'd be a downtime of only a few minutes.
Karsten
In article <385B1941.7390AA4B_at_nospambigfoot.com>,
Doug Cowles <dcowles_at_nospambigfoot.com> wrote:
> This is a multi-part message in MIME format.
> --------------CD580D650285BAE336DC961C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Oh well.
>
> Sybrand Bakker wrote:
>
> > No, sorry
> >
> > Hth
> >
> > --
> > Sybrand Bakker, Oracle DBA
> > Doug Cowles <dcowles_at_nospambigfoot.com> wrote in message
> > news:385A706F.6ADF7ED2_at_nospambigfoot.com...
> > > Is there any way to take an existing foreign key constraint and
modify
> > > it to also
> > > be on delete cascade or on delete set null without recreating the
> > > constraint from scratch?
> > >
> > > For example -
> > > create table A( a number);
> > > alter table A add constraint apk primary key (a);
> > > create table B( b number);
> > > alter table B add constraint bfk foreign key (b) references A(a);
> > >
> > > SQL>alter table B modify constraint bfk on delete cascasde;
> > > alter table B modify constraint bfk on delete cascasde
> > > *
> > > - > SQL comand not properly ended
> > >
> > > alter table B modify b add constraint bzy foreign key(b)
references A(a)
> > > on delete
> > > cascade;
> > > -> Such a constraint already exists in the table..
> > >
> > > alter table B modify b on delete cascade
> > > -> invalid datatype
> > >
> > > etc.,
> > >
> > > any way to do this?
> > >
> > > - Dc.
> > >
>
> --------------CD580D650285BAE336DC961C
> Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
> Content-Transfer-Encoding: 7bit
> Content-Description: Card for Doug Cowles
> Content-Disposition: attachment; filename="vcard.vcf"
>
> begin: vcard
> fn: Doug Cowles
> n: Cowles;Doug
> org: IBM
> email;internet: dcowles_at_nospambigfoot.com
> title: DBA
> note: Please remove nospam from e-mail to reply.
> x-mozilla-cpt: ;0
> x-mozilla-html: FALSE
> version: 2.1
> end: vcard
>
> --------------CD580D650285BAE336DC961C--
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Dec 20 1999 - 08:23:29 CST