Symantec logo

Migrating the role of primary site to the remote site

After configuring the replication objects within VCS, you can use VCS commands to migrate the role of the cluster on the primary site to the remote cluster. In the procedure below, VCS takes the replicated Oracle RAC database service group, oradb1_grp, offline on the primary site and brings it online on the secondary site; the secondary site now assumes the role of the primary site.


  Note   The hagrp -switch command cannot migrate a parallel group within a cluster or between clusters in a global cluster environment.


  1. From the primary site, take the Oracle service group offline on all nodes.

    # hagrp -offline oradb1_grp -any

    Wait for VCS to take all Oracle service groups offline on the primary site.

  2. Verify that the RLINK between the primary and secondary is up to date. Use the vxrlink -g command with the status option and specify the RLINK for the primary cluster (rlk_rac_clus102_priv_rac1_rvg, in this example). You can use the command from any node on the primary cluster. For example:

    # vxrlink -g oradatadg status rlk_rac_clus102_priv_rac1_rvg

  3. On Secondary make sure that CRS is up, add listener resource using netca. Make changes to tnsnames.ora.

    Example tnsnames.ora (Here vrts is the database name)

    LISTENERS_VRTS =

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP)(HOST = mercury-vip)(PORT = 1521))

    (ADDRESS = (PROTOCOL = TCP)(HOST = jupiter-vip)(PORT = 1521))

    )

    VRTS2 =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = jupiter-vip)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = vrts)

    (INSTANCE_NAME = vrts2)

    )

    )

    VRTS1 =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = mercury-vip)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = vrts)

    (INSTANCE_NAME = vrts1)

    )

    )

    VRTS =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = mercury-vip)(PORT = 1521))

    (ADDRESS = (PROTOCOL = TCP)(HOST = jupiter-vip)(PORT = 1521))

    (LOAD_BALANCE = yes)

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = vrts)

    )

    )

  4. Register the database using srvctl command. (On Secondary)

    # srvctl add database -d <database_name> -o <oracle_home> -p <spfile-on-shareddisk>

    To prevent automatic database instance restart, change Management policy for the database (automatic, manual) to MANUAL using srvctl command:

    # srvctl add database -d <db-name> -p <location-of-parameter-file> -y manual

  5. Register the instances using srvctl command. Execute the following command on each node:

    # srvctl add instance -d <database_name> -i <instance_name> -n <node-name>

  6. Create directories adump, bdump, cdump, dpdump, hdump, udump in $ORACLE_HOME/admin/<db_name>.
  7. Create pfile on each node as follows:

    # echo "SPFILE=<location of spfile on shared volume>" >>$ORACLE_HOME/dbs/init<db_name><instance-number>.ora

  8. On the secondary site, bring the Oracle service group online on all nodes:

    # hagrp -online oradb1_grp -any

  9. Verify CRS resources by executing the command crs_stat -t. All resources should be online.
  10. Make sure that All CRS resources are online, and switch back the group OracleRAC to primary. Use the following command to switch back the oradb1_grp to original primary site:

    # hagrp -offline oradb1_grp -any

  11. Make sure that "oradb1_grp" is offline and execute the following command on Original Primary cluster to bring the "oradb1_grp" online.

    #hagrp -online oradb1_grp -any