Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: advice on approach for db upgrade script
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jeff Kish schreef:
>> No - just widen the column, and carry on
Yes - that is what I meant. You should know your model, and so the next argument isn't one (as you *know* which columns to widen!)
> 1 - if i do it i need to manually find and alter all the referring columns.
> And if for some reason there is a failure I need to handle that (sounds
> complicated). But if a prerequisite is that the dba uses, say, enterprise
> manager to length the primary key and related columns, then they can do that
> better themselves in one fell swoop.
>> Cannot be a problem - you already fixed that in step 1
>> I'd rather have a table, holding the old and new values. >> Allows for undo, and it seems you have other (referenced tables) >> you need to update, too. >> Use the cuurent value found in the referenced table, >> lookup the new value, using the old, and Bob's your uncle!
Ah - that would be within a packaged procedure, running
over and over again.
Not the case here - you're doing massive data alterations,
modifying (what you call) primary keys. That always carries
the danger of compromising data integrity!
That's why the mantra "never change primary keys" exists, and
I just referred to "(what you call) pk's" - I'm a firm believer
of the mantra, but I do recognize there are some situations,
where (poorly) designed systems need such a change.
Anyway - my experience is you need this table - and it will be a small one: just 2 columns - for later referral (This [value] used to be [that])
> I keep hearing warnings about using temp tables etc. I thought I should stay
> away from them. If I use these don't I need to create them before the
> procedure is run, otherwise it won't see them at compile time will it? Just
> trying to make sure I take a course here with more wisdom than I inherently
> have.
>>> That way I won't use temp or global temporary tables, and I can query and >>> store results. I assume I can query varrays? >>> >> Nope - data is lost when ending the session
DDL does implicit commits - so as soon as you do an 'alter table' you will commit!
Top-posting is one way to shut me up...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
iD8DBQFGS+4ALw8L4IAs830RAkA0AJoCMEbSz73//p0pwZMNKXv6DFgKtACfXcc3
efQuu76gsK1NeMBtEQXCoEE=
=E1x8
-----END PGP SIGNATURE-----
Received on Thu May 17 2007 - 00:54:09 CDT
![]() |
![]() |