Configuring Replication for Backup and Redo Failover

After you configure the primary and the alternate Recovery Appliances, you perform tasks similar to setting up replication from the alternate to the primary appliance. In this scenario, the alternate appliance has the upstream role and the primary appliance has the downstream role.

Task 1: Configure an Oracle wallet on the alternate Recovery Appliance

On the alternate Recovery Appliance, use the mkstore utility to create an Oracle auto-login wallet and add the credentials for the replication user you created in "Task 1: Create a VPC user account and a replication user account on the primary Recovery Appliance". The alternate Recovery Appliance requires these credentials when it logs in to the primary Recovery Appliance.

To configure an auto-login wallet on the alternate Recovery Appliance:

  1. Run the following command to create an Oracle wallet in the /dbfs_repdbfs/REPLICATION directory:

    mkstore -wrl /dbfs_repdbfs/REPLICATION -createALO
    

    The mkstore utility creates a file named cwallet.sso in the designated location.

  2. Run the following command to add the replication user credentials:

    mkstore -wrl wallet_location -createCredential serv_name rep_user pwd
    

    The placeholders are defined as follows:

    • wallet_location is the directory in which you created the wallet in the previous step.

    • serv_name is the Oracle network service name that you use in an EZ Connect descriptor to identify the primary Recovery Appliance on the Oracle network.

    • rep_user is the user name of the replication user account. This user was created in Task 1: Create a VPC user account and a replication user account on the primary Recovery Appliance . The replication user is not created on the alternate.

    • pwd is the secure password of the replication user rep_user.

    For example, the following command adds credentials for the net service name rapribrf-scan.acme.com using port 1522 and a database name of rapri, and the replication user name repuser_from_alternate:

    mkstore -wrl /dbfs_repdbfs/REPLICATION -createCredential \
    "rapribrf-scan.acme.com:1522/rapri" "repuser_from_alternate" "pwd"
    
  3. Verify that the credentials were properly added for this user by running the following command:

    mkstore -wrl /dbfs_repdbfs/REPLICATION -listCredential
    
    Oracle Secret Store Tool : Version 12.1.0.1 Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    List credential (index: connect_string username)
    1: rapribrf-scan.acme.com:1522/rapri repuser_from_alternate

    The results do not display the password.

Task 2: Create the replication server configuration on the alternate Recovery Appliance

For the primary Recovery Appliance to which this alternate Recovery Appliance will forward backups after an outage, create a replication server configuration by executing DBMS_RA.CREATE_REPLICATION_SERVER.

This task assumes the following:

To create the replication server configuration:

  1. With SQL*Plus or SQL Developer, connect to the alternate Recovery Appliance metadata database as RASYS.

  2. Run the DBMS_RA.CREATE_REPLICATION_SERVER procedure for the primary Recovery Appliance.

    The following example creates the replication server configuration named raprimary_rep for the primary Recovery Appliance:

    BEGIN
      DBMS_RA.CREATE_REPLICATION_SERVER (
        replication_server_name => 'raprimary_rep',
        sbt_so_name      => '/u01/app/oracle/product/12.1.0.2/dbh1/lib/libra.so',
        catalog_user_name       => 'RASYS',
        wallet_alias            => 'rapribrf-scan.acme.com:1522/rapri',
        wallet_path             => 'file:/dbfs_repdbfs/REPLICATION');
    END;
    
  3. Confirm the creation of the replication server configuration. The replication_server_name is converted to upper-case and stored as such. Therefore queries with the name should also be upper-case.

    For example, run the following query:

    SELECT COUNT(*) should_be_one 
    FROM   RA_REPLICATION_SERVER
    WHERE  REPLICATION_SERVER_NAME = 'RAPRIMARY_REP';
    
    SHOULD_BE_ONE
    -------------
    1
    

    If the configuration was created correctly, then the return value is 1.

Task 3: Associate the alternate Recovery Appliance with the protection policy for Backup and Redo Failover

Specify the primary Recovery Appliance to which the alternate Recovery Appliance forwards backups after an outage by assigning the replication server configuration to a protection policy.

This task assumes the following:

To associate the replication server configuration with the Backup and Redo Failover protection policy:

  1. Ensure you are connected to the metadata database on the alternate Recovery Appliance as the Recovery Appliance administrator.

  2. Run the DBMS_RA.ADD_REPLICATION_SERVER procedure for the Backup and Redo Failover protection policy and replication server configuration.

    For example, execute the following PL/SQL program:

    BEGIN
      DBMS_RA.ADD_REPLICATION_SERVER (
       replication_server_name => 'raprimary_rep',
       protection_policy_name  => 'alt_brf');
    END;