728x90


Problem(Abstract)

How to manually change the type of the data replication server in a High-Availability Data Replication (HDR) pair; from Primary to Secondary and vice versa.

Resolving the problem

INTRODUCTION

You can change the data replication server type of an IBM® Informix® Dynamic Server (IDS) instance in an HDR pair from Primary to Secondary and Secondary to Primary. 


BEFORE YOU BEGIN

The steps below will only work when data replication has been started with DRAUTO set to 0 (manual), which is the default, in the $ONCONFIG file.

You will need to open two session windows, the first session to connect to the Primary server, and the second session to connect to the Secondary server. After you log in as user informix, set up your environment to administer the database server, you must also check to ensure the Primary server and Secondary server are up and operational.


STEPS

The following steps will show you how to manually change the current Primary server to a new Secondary server, and the current Secondary to a new Primary.

Check server status and message log after each command to ensure the server is in the correct state before the next step. Failing to do so can result in data replication pair out of synchronization and shall require re-establishing the pair from archive.


On the current Primary server

1. Run this command to check the database server status:

onstat -

The output must contain this:

-- on-Line (Prim) -- Up

Note: If it does not show the above then you must correct it before proceeding to the next steps.

2. Shut down the current Primary server, run the following command:

onmode -ky



    On the current Secondary server

    1. Run this command to change the DR current type Secondary to DR new type Standard:
      onmode -d standard
    Check the message log for these messages:
      DR: new type = standard
      On-Line Mode
    2. Run this command to change DR type from Standard to Primary:
      onmode -d primary <secondary dbserver name>*

         *<secondary dbserver name> is the former primary database server name.

    Check the message log for messages similar to these:
      DR: new type = primary, secondary server name = <secondary dbserver name>
      DR: Trying to connect to secondary server = <secondary dbserver name>
      DR: Cannot connect to secondary server
      DR: Turned off on primary server

    Run this command to check the database server status:
      onstat -

    The output should contain this:
       -- on-Line (Prim) -- Up

    Your former Secondary is now Primary and online.


    3. Shut down the new Primary server, run the following command:

    onmode -ky



    On the former Primary server (now Off-Line)

    1. Run this command to start up the former Primary server in physical recovery mode:
      oninit -PHY

    Check the message log for these messages:
      Recovery Mode

    The server status should contain:
      -- Fast Recovery -- Up

    2. You can now change the DR type to Secondary, execute the following command:
      onmode -d secondary <primary dbserver name>*

        *<primary dbserver name>is the former Secondary database server name.
    The command above may take a few minutes to complete. You will see messages in the message log like these:
      DR: new type = secondary, primary server name = <primary dbserver name>
      DR: Trying to connect to primary server = <primary dbserver name>
      DR: Cannot connect to primary server
      DR: Turned off on secondary server


    On the new Primary server

    1. Run this command to start up the new Primary server:

    oninit

    The message log will show something like:
      On-Line Mode
      DR: Sending log <log number> (current), size <value> pages, <value> percent used
      DR: Sending Logical Logs Completed
      DR: Primary server operational
      Run this command to check the database server status:

      onstat -


      The output should contain this:

       -- on-Line (Prim) -- Up

        The new Primary and new Secondary server are online and synchronized. They are ready to accept transactions for processing.


        Steps in summary:

        Instance A (currently Primary)Instance B (currently Secondary)
        1. onmode -ky(server should be up)
        2. onmode -d standard
        3. onmode -d primary <pri_server_name>
        4. onmode -ky
        5. oninit -PHY
        6. onmode -d secondary <sec_server_name>
        (now a Secondary server)
        7. oninit (now a Primary server)


        http://www-01.ibm.com/support/docview.wss?uid=swg21220123

        728x90

        + Recent posts