Option 1: No integration points, no legacy data

In this case, the developers have no other systems to think about and no existing data to manage, so they can add the new columns and drop the old column, as shown in Example 5-3.

Example 5-3. The simple case with no integration points and no legacy data

ALTER TABLE customer ADD firstname VARCHAR2(60);

ALTER TABLE customer ADD lastname VARCHAR2(60);

ALTER TABLE customer DROP COLUMN name;

For Option 1, the refactoring is straightforward — DBAs make the relevant change and get on with life.

Option 2: Legacy data, but no integration points

In this scenario, developers assume existing data to migrate to new columns but they have no external systems to worry about. They must create a function to extract the pertinent information from the existing column to handle migrating the data, as shown in Example 5-4.

Example 5-4. Legacy data but no integrators_

ALTER TABLE Customer ADD firstname VARCHAR2(60);

ALTER TABLE Customer ADD lastname VARCHAR2(60);

UPDATE Customer set firstname = extractfirstname (name);

UPDATE Customer set lastname = extractlastname (name);

ALTER TABLE customer DROP COLUMN name;

This scenario requires DBAs to extract and migrate the existing data but is otherwise straightforward.

 
Source
< Prev   CONTENTS   Source   Next >