Downgrading a log-based Replication Agent 15.2 to a trigger-based Replication Agent 12.5

This procedure assumes that you are using a Replication Agent 15.2 instance. If the Replication Agent 12.5 instance no longer exists, create one using the Replication Agent 12.5 ra_admin or administrator command, and then follow the procedure in this section, using the $SYBASE/RAX-15_2/bin/gen_RAO_migrate_with_parms.ksh script, instead of the $SYBASE/RAX-15_2/bin/gen_RAO_migrate.ksh script described next.

The difference between the two generation scripts is that the gen_RAO_migrate_with_parms.ksh script copies parameter values in addition to initializing the primary database and the Replication Agent, whereas the gen_RAO_migrate.ksh script assumes all parameters are already configured.

NoteIf you modified the interfaces or sql.ini file entries during your upgrade, you need to create a new entry (using a different name) to access the Replication Agent 12.5 instance.

StepsDowngrading from Replication Agent 15.2 to version 12.5

  1. To generate the downgrade script, run the $SYBASE/RAX-15_2/bin/gen_RAO_migrate.ksh file:

    cd $SYBASE/RAX-15_2/bin
    
    ./gen_RAO_migrate.ksh mySrcRao myuid mypwd /workdir
    
    • mySrcRao is the name of the interfaces or sql.ini file entry for the Replication Agent 15.2 instance.

    • myuid is the user ID for logging in to the Replication Agent 15.2 instance.

    • mypwd is the password for logging in to the Replication Agent 15.2 instance. If no password exists, use two double-quotes with nothing in between ("").

    • workdir is the path name of a directory to use as a work area and where the <src_instance>_migrate_<date>.cmds file is created.

    The script generates a file called /<workdir>/<src_instance>_migrate_<date>.cmds, which contains Replication Agent commands that you will later run against the Replication Agent 12.5 instance to perform the following tasks:

    • Initialize the primary database.

    • Initialize the Replication Agent 12.5 instance (including incrementing the database generation ID).

    • Re-mark all the tables, procedures, and LOB columns that were marked in the Replication Agent 15.2 instance.

    The script does not modify any of the Replication Agent 12.5 parameters except pdb_auto_run_scripts, pdb_dflt_column_repl, and pdb_convert_datetime, which will all be set to the same values as configured in the Replication Agent 15.2 instance.

    NoteIf the following message appears when running the Korn shell script on Windows, you can ignore it:

    tail: write error on standard output: The pipe is being closed.
    

    After the migration script is generated, do not mark, unmark, enable, or disable any of the tables, LOB columns, or procedures. Also, do not modify any parameters in the Replication Agent 15.2 instance. If you do, these changes will not be applied to the Replication Agent 12.5 instance.

  2. To see which objects will be marked and which LOB columns will be enabled, examine the following generated file: /<workdir>/<src_instance>_migrate_<date>.cmds

    If you want to change what is marked or enabled, you can make changes to this file. For example, you can set pdb_convert_datetime to true for some tables and procedures and to false for others.

  3. Start and log in to the Replication Agent 15.2 instance.

  4. Test the primary database connection:

    test_connection PDS
    
  5. Prevent users (other than the Replication Agent pds_username 15.2 user) from any further access to the primary database.

  6. Verify that the Replication Agent 15.2 instance is in Replicating state and allow replication to finish. To verify that replication has completed:

    1. Periodically issue the ra_statistics command, watching until the following statistics are zero (0):

      • Input queue size

      • Output queue size

    2. When they are both zero, make note of the Last QID Sent from the last set of statistics.

    3. Issue the ra_locator update command so that Replication Agent retrieves the truncation point from Replication Server.

    4. Wait, and then issue the ra_locator command and compare the displayed locator with that of the Last QID Sent. If they are different, wait and repeat this step.

  7. Quiesce the Replication Agent 15.2 instance.

  8. In the Replication Agent 15.2 instance, de-initialize the Replication Agent:

    pdb_xlog remove, force
    
  9. Shut down the Replication Agent 15.2 instance.

  10. Be sure that the appropriate Oracle JDBC driver is in your CLASSPATH. The one required for Replication Agent 15.2 will not work with older versions of Replication Agent for Oracle.

    NoteNo other Oracle drivers are allowed in the CLASSPATH.

  11. Run the script that was generated in Step 1 above against the Replication Agent 12.5 instance, for example:

    isql –S <myTgtRAO> -Umyuid -Pmypwd -i /<workdir>/<mySrcRao>_migrate_<date>.cmds
    
    • myTgtRAO is the name of the Replication Agent 12.5 instance.

    • workdir is the path name of the directory that was used as a work area and where the <src_instance>_migrate_<date>.cmds file was created.

    • mySrcRao is the name of the interfaces or sql.ini file for the path to the Replication Agent 15.2 instance.

    The script initializes the primary database and the Replication Agent (including incrementing the database generation ID), and re-marks all the tables, procedures, and LOB columns that were marked in the Replication Agent 15.2 instance.

  12. Allow users access to the primary database.

  13. Log in to the RSSD and set the Replication Server’s locator to zero:

    rs_zeroltm source_ds, source_db
    

    Here, source_ds and source_db match the Replication Agent 12.5 instance values for the rs_source_ds and rs_source_db parameters.

    NoteThe rs_source_ds and rs_source_db values were migrated from Replication Agent 15.2 and should not be changed.

  14. In the Replication Agent 12.5 instance, resume replication.

  15. Log out of the Replication Agent 12.5 instance.

  16. If you created a new interfaces or sql.ini entry when you upgraded to Replication Agent 15.2, update the entry so the Replication Agent 15.0 instance name is again associated with the old Replication Agent 12.5 instance machine and port number.

  17. Revert the Oracle logging properties back to your desired setup in the primary database.

  18. Revoke any additional privileges that were granted to the Replication Agent primary database user for the upgrade in the primary database.