The procedure in this section describes how to copy tables from one location to another. If you want to migrate only certain rows and/or columns of a table, see Migrating Certain Rows and Columns.
Before you begin, review the following:
For more information about system catalog tables, see the SQL Reference or consult your XDB Server Administrator.
Make sure the Catalog Browser and the Schema Viewer are open.
Open the Browser by selecting the
Catalog Browser button on the toolbar. Open the Schema Viewer by selecting
New from the
File menu.
For more information about using the Catalog Browser, see The Catalog Browser.
When you select Show Dependent or Show Referenced, dependent and referenced tables (respectively) are automatically placed in the Schema Viewer along with arrowed lines showing their foreign key/primary key relationships.
If all the rows of the referenced table are migrated, Migrate processes the DDL and DML so that the referential integrity constraints are not violated. However, if the user intends to restrict the domain of data being processed by Migrate, the domain (subset of the rows) must be defined by using the Define Query command on the Object menu. Queries can then be constructed against the referenced and dependent tables to ensure that only the rows matching the search criteria will be migrated. This will guarantee that foreign key values in the referenced and the dependent tables are consistent with each other. See Migrating Certain Rows and Columns for more information.
In this field... | Specify the following... |
---|---|
AuthID | The name to be used as the creator of the destination table.
If you want Migrate to use the source table's Auth ID by default, select the Default To Source checkbox next to the Auth ID text box in the Default Options dialog box before you select Table Options; Migrate will then automatically populate this field with the proper default value. Otherwise, you will need to specify an Auth ID by typing it in text box. |
Table | The name of the table to which you will be migrating the data. If this table doesn't exist, Migrate will create it for you. |
Tbl Space | The table space name for the target table to which you will be migrating the data.
If you want Migrate to use the name of the source table space by default, select the Default To Source checkbox next to the Tbl Space text box in the Default Options dialog box before you select Table Options; Migrate will then automatically populate this field with the proper default value. Otherwise, you will need to specify a table space name by typing it in this text box. |
Database | The database name for the target table where you will be migrating the data.
If you want Migrate to use the name of the source database from which the source table is selected by default, select the Default To Source checkbox next to the Database text box in the Default Options dialog box before you select Table Options; Migrate will then automatically populate this field with the proper default value. Otherwise, you will need to specify a database name by typing it in this text box. If this field is left blank, the default database name "DSNDB04" is used. |
Select... | If you want Migrate to... |
---|---|
Abort | End the migration. |
Append Data | Append the migrated records to the existing table. |
Replace Data | Replace all records in the existing table with the migrated records (all data in the existing table will be deleted). |
Replace Table | Drop the existing table and create a new table with the migrated records. |
For information about the Update No Insert, Update Insert, and Delete Match options, see the instructions for Replicating Data.
Select... | If you want Migrate to... |
---|---|
All Rows | Copy all records from the source table to the destination. |
No Data | Copy no records from the source table to the destination. You might use this option to create an "empty" destination table (which will have a structure identical to the source) into which you can selectively copy records using Migrate's query feature.
The behavior of this option depends on the following: If the destination table does not exist, an "empty" table is created. If the destination table exists, and the Replace Data or Replace Table option is used, the destination table's existing records are deleted and no records are copied (an "empty" table is created). If the destination table exists, and the Append Data option is used, no records are copied to it. |
First N Rows | Copy the first N records from the source table to the destination. |
Every Nth Row | Copy every N records from the source table to the destination. |
Select this option... | To request... |
---|---|
Generate SQL | A copy of the SQL script used to execute the migration. (This script contains the DDL statements used to define the destination table, but does not contain the individual INSERT statements for each migrated record.)
In the text-entry field next to the checkbox, type the name of the file to which you want the script written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new SQL script. |
Post Execution Report | A report that lists the tables that were migrated.
In the text-entry field next to the checkbox, type the name of the file to which you want the report written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new report. You can specify the same file name for the Post Execution Report and the Error File to combine these two reports into one file. |
Error File | A report that lists any errors encountered during the migration. If there are no errors during the migration, this error file will be empty.
In the text box, type the name of the file to which you want the errors written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new report. You can specify the same file name for the Error File and the Post Execution Report to combine these two reports into one file. |