Configuring Upstream and Downstream Recovery Appliances

This task configures the protection policies for the protected database on the downstream and upstream Recovery Appliance, and then adds the protection policy to the replication server.

If a protection policy that is used, for example, by the CBR122DR database does not exist on the respective Recovery Appliances, these steps create them. The protection policy name does not have to be unique between the downstream and upstream Recovery Appliances.

To prevent a circular references between RAHADR1 and RAHADR2, the protection policy from RAHADR2 is not added to the replication server while the protection policy from RAHADR1 is added. All databases in the protection policy are replicated.

Note: Because RAHADR2 does not normally accept redo from the CDB122DR database, set the unprotected data window parameter is set to 1.25 days to avoid false alerts from occurring if the CDB122DR database is idle.

  1. Log into SQLPLS as rasys/ra on RAHADR2, the downstream Recovery Appliance. This step and the next few are performed on RAHADR2, unless otherwise stated.
    $ sqlplus rasys/ra
  2. Create the protection policy.
    SQL> exec dbms_ra.create_protection_policy( 
    protection_policy_name => 'cdb122dr_PP', 
    storage_location_name => 'DELTA', 
    recovery_window_goal => numtodsinterval(3,'DAY'), 
    unprotected_window => numtodsinterval(1.25,'DAY'), 
    allow_backup_deletion => 'NO');
    
    PL/SQL procedure successfully completed.
  3. Add the database (for this example) and its protection policy to the list of those protected by the Recovery Appliance.
    SQL> exec dbms_ra.add_db(
    db_unique_name => 'cdb122dr', 
    protection_policy_name=> 'cdb122dr_PP', 
    reserved_space => '1T');
    
    PL/SQL procedure successfully completed.
  4. Grant access to the replication user to the database (for this example).
    SQL> exec dbms_ra.grant_db_access(
    username => 'REPUSER_FROM_HADR1',
    db_unique_name => 'cdb122dr');
    
    PL/SQL procedure successfully completed.
  5. Log into sqlplus as rasys/ra on RAHADR1, the upstream Recovery Appliance. This step and all that follow are performed on RAHADR1.
    $ sqlplus rasys/ra
  6. Create a protection policy. The protection policy name does not have to be unique.
    SQL> exec dbms_ra.create_protection_policy( 
    protection_policy_name =>'cdb122dr_PP', 
    storage_location_name => 'DELTA', 
    recovery_window_goal => numtodsinterval(3,'DAY'), 
    unprotected_window => numtodsinterval(5,'MINUTE'), 
    allow_backup_deletion => 'NO');
    
    PL/SQL procedure successfully completed.
  7. Add the database (for this example) and its protection policy to the list of those protected by the Recovery Appliance.
    SQL> exec dbms_ra.add_db(
    db_unique_name => 'cdb122dr', 
    protection_policy_name=> 'cdb122dr_PP', 
    reserved_space => '1T');
    
    PL/SQL procedure successfully completed.
  8. Grant access to the replication user to the database (for this example).
    SQL> exec dbms_ra.grant_db_access(
    username => 'HADR_LOCAL_VPCUSER',
    db_unique_name => 'cdb122dr');
    
    PL/SQL procedure successfully completed.
  9. Add the protection policy to the replication server. This step is performed on the upstream Recovery Appliance (RAHADR1). This step was not performed on the downstream Recovery Appliance, in order to prevent a circular reference between the two Recovery Appliances.
    SQL> exec dbms_ra.add_replication_server( 
    replication_server_name =>'RAHADR2_REP', 
    protection_policy_name => 'cdb122dr_PP');
    
    PL/SQL procedure successfully completed.