Database Update Wizard
Schema Change WIzard

Running the Database Update Wizard and Schema Change Wizard on Different Database Servers

This topic contains the following sections:

See Also

Oracle Destination Databases

Microsoft SQL Server Destination Databases

General Notes

Old Name

New Name

size

afm_size

image

image_file

use

 use1

The names were changed to avoid words that are reserved in some of the servers. ("Size" is a reserved word in Oracle; "use" and "image" are reserved words in Microsoft SQL Server.)

UPDATE afm_scmpref SET afm_db_version_num = 113

Data Copy Issues

Copying Data with Circular References

The Database Update Wizard ignores the afm_flds.validate_data value when checking for circular references. As a result, the Database Update Wizard may report circular references on fields that are not really validated. If there are data in tables with this condition, then the Database Update Wizard does not import all data.

The solution is as follows:

  1. Prior to running the Database Update Wizard to copy data, remove the afm_flds.ref_table value from any fields that have circular references, even if they have afm_flds.validate_data set to '0' (“No”).

    Two typical offending fields are afm_atyp.pop_layer and dp.approving_mgr.

    For these two fields, the circular dependency message goes away if you run the following statements from ISQL before running the Database Update Wizard to copy data.

UPDATE afm_flds SET ref_table = NULL WHERE table_name = 'dp' AND field_name = 'approving_mgr';
UPDATE afm_flds SET ref_table = NULL WHERE table_name = 'afm_atyp' AND field_name = pop_layer';
COMMIT;

  1. Next, run the Database Update Wizard to export and import data.
  2. Close the Database Update Wizard,and add the ref_table values back in:

UPDATE afm_flds SET ref_table = 'em’ WHERE table_name = 'dp' AND field_name = 'approving_mgr';
UPDATE afm_flds SET ref_table = 'afm_layr' WHERE table_name = 'afm_atyp' AND field_name = pop_layer';
COMMIT;

Note that the following query will enumerate fields with circular references.

SELECT af0.table_name, af0.field_name, af0.ref_table, af1.field_name, af1.ref_table, af2.field_name, af2.ref_table, COUNT(*)
FROM afm_flds af0, afm_flds af1, afm_flds af2, afm_flds af3, afm_flds af4, afm_flds af5
WHERE af1.table_name = af0.ref_table AND af2.table_name = af1.ref_table AND af3.table_name = af2.ref_table
AND af4.table_name = af3.ref_table AND af5.table_name = af4.ref_table AND af5.ref_table = af0.table_name
AND af0.ref_table IS NOT NULL AND af1.ref_table IS NOT NULL AND af2.ref_table IS NOT NULL
AND af3.ref_table IS NOT NULL AND af4.ref_table IS NOT NULL AND af5.ref_table IS NOT NULL
GROUP BY af0.table_name, af0.field_name, af0.ref_table, af1.field_name, af1.ref_table, af2.field_name, af2.ref_table
ORDER BY af0.table_name, af0.field_name;

When interpreting the results of the above query, discard any table-field combinations that include references to previously listed table-fields, as only one link in the circular listing needs to be temporarily removed.

Custom Databases

If your custom database contains circular references, you cannot use the Database Update Wizard to import those data. The Transfer In option imports validating tables before the validated tables so as to be able to insert records while validation constraints are in force. In the case of circular tables, there is no correct order to do this.

If you are unsure as to whether your database contains circular references, see the section Copying Data with Circular References above for more detailed information.

If you do have a circular reference in your data, you can remove the circular constraint, import your data, then reapply the constraints. (See the section Copying Data with Circular References above for how to do this.) Alternately, you may wish to use your database server utilities – such as the Oracle Data Manager or the Microsoft Data Transformation Services -- which import data with circular references. These tools import the data in bulk, then reinstate the constraints.