Upgrading a trigger-based Replication Agent 12.5 when the primary Oracle is version 10g

StepsUpgrading a trigger-based Replication Agent 12.5 when the primary Oracle is 10g

  1. Back up the existing Replication Agent instance directory that contains the following configuration file: $SYBASE/rax-12_5/<instance>/<instance>.cfg.

  2. Install the Replication Agent 15.2 software on a machine where it can directly read the Oracle redo logs.

  3. Create a Replication Agent 15.2 instance with a different name and port number than the Replication Agent 12.5 instance. The port and port+1 must be unique on the machine.

    Do not start the instance.

  4. Update the appropriate interfaces file (interfaces for UNIX, sql.ini for Windows) with the new instance name and new port number so that the migration script can isql in to the new Replication Agent 15.2 instance.

  5. Update the Replication Agent 15.2 instance configuration file by running the generation script at $SYBASE/RAX-15_2/bin/gen_RAO_migrate_with_parms.ksh:

    cd $SYBASE/RAX-15_2/bin
    
    ./gen_RAO_migrate_with_parms.ksh mySrcRao myuid mypwd /workdir /path/mySrcRao.cfg ../myTgtRao/myTgtRao.cfg
    
    • mySrcRao is the name of the interfaces or sql.ini file entry for the Replication Agent 12.5.

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

    • mypwd is the password for logging in to the Replication Agent 12.5 instance. If there is no password, 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 migration file is created.

    • /path/mySrcRao.cfg is the full path name of the Replication Agent 12.5 instance configuration file.

    • ../myTgtRao/myTgtRao.cfg is the path name of the Replication Agent 15.2 instance configuration file that was created in step 3.

    The generation script copies to the Replication Agent 15.2 configuration file or creates parameter initialization commands in the migration file for most of the parameters in the Replication Agent 12.5 configuration file. The generated migration script is a file called /<workdir>/<src_instance>_migrate_<date>.cmds. It contains Replication Agent commands that you will later run against the Replication Agent 15.2 instance to perform the following tasks:

    • Initialize the primary database.

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

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

    If the Replication Agent 12.5 and the Replication Agent 15.2 instances are on different machines and both configuration files cannot be accessed at the same time, copy the Replication Agent 12.5 configuration file to a location on the Replication Agent 15.2 instance’s machine where it can be read by the generation script.

    NoteWhen the Korn shell script is running on Windows and the following message appears, you can ignore it:

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

    If the Replication Agent 15.2 instance is on a Windows machine that does not have Korn shell available, copy the generation script and the Replication Agent 15.2 instance’s configuration file to a UNIX machine from which you can log in to the Replication Agent 12.5 instance. This copy of the Replication Agent 15.2 instance’s configuration file is updated by the generation script. After it is updated, copy the configuration file back to the Replication Agent 15.2 instance directory.

    NoteAfter 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 12.5 instance. If you do, these changes will not be applied to the Replication Agent 15.2 instance.

  6. To see what objects will be marked and what LOB columns enabled, examine this 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.

  7. Install the Oracle 10g JDBC driver for JDK 1.6 on the same machine where you installed Replication Agent 15.2, and add the JDBC driver’s path to your CLASSPATH environment variable on this machine, as described in the Replication Agent Installation Guide.

    NoteNo other Oracle drivers are allowed in the CLASSPATH.

  8. Set the RA_JAVA_DFLT_CHARSET environment variable in the RUN_instance script to the name of the Java character set that is equivalent to the one being used at the primary database. See the Replication Agent Administration Guide.

  9. If necessary, override the default maximum amount of memory available to the JRE by setting the RA_JAVA_MAX_MEM environment variable in the Replication Agent 15.2 RUN_instance script. Replication Agent 15.2 does not set the RA_JAVA_MAX_MEM environment variable in the executable or run scripts, which allows the JVM to use its default for the maximum heap size. See the Replication Agent Administration Guide.

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

  11. Set rs_charset to match the Replication Server character set, as described in the Replication Agent Reference Manual.

  12. Test the primary database connection:

    test_connection PDS
    
  13. At the primary Oracle database, grant the Replication Agent 15.2 primary Oracle user (the user specified by the pds_username configuration parameter) the additional required privileges. See “Replication Agent permissions”.

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

  15. In the Replication Agent12.5 instance, verify that it is in Replicating state and allow replication to finish. To verify that replication has completed:

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

      • Operation queue size

      • Operation data hash size

      • Input queue size

      • Output queue size

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

    3. Issue the ra_locator update command so that Replication Agent 12.5 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.

  16. Quiesce the Replication Agent 12.5 instance.

  17. In the Replication Agent 12.5 instance, remove the Replication Agent transaction log:

    pdb_xlog remove, force
    
  18. Shut down the Replication Agent 12.5 instance.

  19. In the primary Oracle database:

    1. Enable supplemental logging of primary key data.

    2. Enable archiving of redo logs.

    3. Archive all non-archived redo logs, and force Oracle to start writing to a clean log. For example:

      alter system archive log current;
      

    See “Replication Agent permissions”.

  20. Run the migration script that was generated in step 5 against the Replication Agent 15.2 instance:

    isql –S <myTgtRAO> -Usa -P -i /<workdir>/<mySrcRao>_migrate_<date>.cmds
    

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

  21. Allow users access to the primary database.

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

    rs_zeroltm source_ds, source_db
    

    Here, source_ds matches the Replication Agent 15.2 instance value for rs_source_ds, and source_db matches the Replication Agent 15.2 instance value for rs_source_db.

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

  23. In the Replication Agent 15.2 instance, resume replication.

  24. Sybase recommends that you change the administration user ID and password in the Replication Agent 15.2 instance from the default values to the same values you used in the Replication Agent 12.5 instance.

  25. Log out of the Replication Agent 15.2 instance.

  26. Update the interfaces or sql.ini file entries if you want the Replication Agent 12. 5 instance name associated with the Replication Agent 15.2 instance machine and port number.