IBM Books

Replication Guide and Reference


Migrating Data with MIGRATE

The MIGRATE program functions include:

The following sections explain how to migrate the Version 1 registrations and Version 1 subscriptions.

Migrating a Capture Program Process

To migrate the Capture program from Version 1 to Version 5:

  1. Stop the Capture program.

  2. Connect to the source server database by entering:
    DB2 CONNECT TO
    database
    

    where database is the source server database.

  3. Bind the migration program to the migration database and all associated source, target, and control servers.

  4. Enter the following command:
    ASNMIG MIGRATE D=
    mig_db S=
    v1_data_serv (V=
    ver)
    

    Where:

    mig_db
    Name of the migration database where the global control tables are stored. This is a required parameter.

    v1_data_serv
    Name of the Version 1 source server, known as the source server in Version 5. This is a required parameter.

    ver
    Version of the migration data that you want to migrate. If you do not specify this parameter, ASNMIG selects the latest version number. This is an optional parameter.

    You can specify only one migration database, source server, and version.

  5. Examine the migration report (MIGRATE.RPT) to determine if the program executed successfully.

  6. Make sure the Version 5 Capture program is installed on the source server. To install the program, see Quick Beginnings for your particular platform.

  7. Bind the Version 5 Capture program as described in "Configuring the Capture Program for Windows NT and Windows 95" for Windows NT and Windows 95, and in "Configuring the Capture Program for OS/2" for OS/2.

  8. Warm start the Version 5 Capture program as described in "Starting Capture for Windows NT and Windows 95" for Windows NT and Windows 95, and in "Starting Capture for OS/2" for OS/2.

When you run ASNMIG MIGRATE for a source server where Capture might run, MIGRATE performs the following actions:

  1. Connects to the source server that you specify.

  2. Drops the critical section table, if an Apply program process has not locked it, and then creates it with the Version 5 Data Definition Language (DDL). If the critical section table is locked, ASNMIG attempts up to 400 times to drop it. There is one critical section table per registered source.

  3. Creates the ASN.IBMSNAP_WARM_START table if it does not exist. Otherwise, the rows in all warm start tables are deleted. That is, all Version 1 and Version 5 warm start tables are empty after migration.

  4. Alters the ASN.IBMSNAP_CCPPARMS table to add a new PRUNE_INTERVAL column.

  5. Alters the ASN.IBMSNAP_UOW table to add two new columns: IBMSNAP_REJ_CODE and IBMSNAP_APPLY_QUAL.

  6. Creates the Version 5 ASN.IBMSNAP_REGISTER and ASN.IBMSNAP_PRUNCNTL tables.

  7. Creates the Version 1 ASN.IBMSNAP_CD_CNTL1 table for saving Version 1 registrations.

  8. Copies from the Version 1 ASN.IBMSNAP_CD_CNTL and ASN.GLOBAL_CD_CNTL tables to the Version 5 ASN.IBMSNAP_REGISTER table.

  9. Copies from the Version 1 ASN.IBMSNAP_CD_CNTL table to the ASN.IBMSNAP_CD_CNTL1 table.

  10. For each registered source:

    1. If the length of the pruning control table name is 18 characters, MIGRATE changes the first character of the pruning control table name to "M". If the length of the pruning control table name is less than 18 characters, creates a backup Version 1 pruning control table with a 1 appended to the original pruning control table name.

    2. Copies from the original pruning control table to the backup table individually.

    3. Copies the Version 1 pruning control table to the Version 5 pruning control table.

    4. Drops the Version 1 pruning control tables.

    5. Creates the Version 1 pruning control view based on the Version 5 pruning control table.

    6. Copies the SOURCE_OWNER, SOURCE_TABLE, and SOURCE_VIEW_QUAL values for a view registered source from the ASN.GLOBAL_CD_CNTL table. They are resolved in the BUILDDB and PREPARE actions.

  11. Drops the Version 1 ASN.IBMSNAP_CD_CNTL table, and then creates the Version 1 ASN.IBMSNAP_CD_CNTL view based on the join of entries in the Version 1 ASN.IBMSNAP_CD_CNTL1 and Version 5 ASM.IBMSNAP_REGISTER tables. It gets the names of the pruning control view from ASN.IBMSNAP_CD_CNTL1 and the critical section name as a constant.

Migrating an Apply Program Process

To migrate Version 1 subscriptions to Version 5:

  1. Stop the Version 1 Apply instances currently executing on the target servers to be migrated.

  2. Connect to the target server database by entering:
    DB2 CONNECT TO
    database
    

    where database is the target server database.

  3. Bind the migration program, if you have not done so, to the migration database and all associated source, target, and control servers.

  4. Enter the following command:
    ASNMIG MIGRATE D=
    mig_db T=
    rout_serv C=
    v5_ctrl_serv U=
    sub_id (V=
    ver)
    

    Where:

    mig_db
    Name of the migration database where the global control tables are stored. This is a required parameter.

    rout_serv
    Server where the Version 1 routing table resides. This is a required parameter.

    v5_ctrl_serv
    Version 5 control server, which contains the control tables for the Apply program process. This is a required parameter.

    sub_id
    Subscriber ID of an Apply program process. This is a required parameter.

    ver
    Version of the migration data that you want to migrate. If you do not specify this parameter, ASNMIG selects the latest version number. This is an optional parameter.

    You can specify only one control server, subscriber ID, migration database where the routing table server resides, and version.

  5. Examine the migration report (MIGRATE.RPT) to determine if the program executed successfully.

  6. Make sure the Version 5 Apply program is installed on the correct server. To install the program, see Quick Beginnings for your particular platform.

  7. Bind the Version 5 Apply program as described in "Configuring the Apply Program for Windows NT and Windows 95" for Windows NT and Windows 95, and in "Configuring the Apply Program for OS/2" for OS/2.

  8. Start the Version 5 Apply program as described in "Starting Apply for Windows NT and Windows 95" for Windows NT and Windows 95, and in "Before You Start theApply Program" for OS/2.

When you run ASNMIG MIGRATE for a target server where Apply might run, MIGRATE performs the following actions:

  1. Connects to the Version 5 control server.

  2. Creates the following Version 5 common subscription control tables at the Version 5 control server:

  3. Connects to the server where the routing table resides, and retrieves all Version 1 control server names.

  4. For each Version 1 control server:

    1. Copies the Version 1 userid.IBMSNAP_REF_CNTL table at the Version 1 control server to the Version 5 ASN.IBMSNAP_SUBS_SET, ASN.IBMSNAP_SUBS_MEMBR, and ASN.IBMSNAP_SUBS_STMTS tables at the IBM Replication control server.

    2. Copies the Version 1 userid.IBMSNAP_REF_COLS table at the Version 1 control server to the Version 5 ASN.IBMSNAP_SUBS_COLS table at the Version 5 control server.

    3. Copies the Version 1 userid.IBMSNAP_TRAIL tables at the Version 1 control server to the Version 5 ASN.IBMSNAP_APPLYTRAIL table at the Version 5 control server.

  5. If more than one Version 1 control server exists, the MIGRATE action collapses multiple Version 1 control servers into a single Version 5 control server. The subscription definitions from each Version 1 control server are copied to the single IBM Replication control server.

  6. If auto-registration is detected at the target server, MIGRATE instructs you to enter the following command to migrate the ASN.IBMSNAP_CD_CNTL and userid.ASN. timestampPC tables before the migration of this Apply program process is complete:
    ASNMIG MIGRATE D=
    mig_db S=
    v1_copy_serv (V=
    ver)
    

    Auto-registration occurs when the subscriber's COPY_OWNER and COPY_TABLE in the userid.IBMSNAP_REF_CNTL table are the same as the SOURCE_OWNER and SOURCE_TABLE in the ASN.IBMSNAP_REGISTER table at the target server.

  7. Creates userid.IBMSNAP_ROUTING1, copies data from userid.IBMSNAP_ROUTING to it, then drops userid.IBMSNAP_ROUTING. This prevents you from inadvertently running the Version 1 Apply program process after you migrate to Version 5.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]