Registering the Protected Database on the Upstream Recovery Appliance

This task configures the wallet, adds VPC user credentials, tests those credentials, and registers the protected database with the upstream Recovery Appliance. If it is a RAC database, the steps need to be performed on each host where the protected database runs.

The operations and naming conventions used here are equivalent to those in Enterprise Manager.
  1. Configure the sqlnet.ora file that will be used by RMAN to connect to the correctRecovery Appliance. Go to the proper directory.
    $ cd ${ORACLE_HOME}/network/admin
  2. Edit the sqlnet.ora file and ensure the following parameters are set correctly:
    SQLNET.WALLET_OVERRIDE = true
    
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    
    WALLET_LOCATION =
      (SOURCE =
        (METHOD = FILE)
        (METHOD_DATA =
          (DIRECTORY = /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/zdlra)
        )
      )
    
    SQLNET.EXPIRE_TIME = 10
  3. Create a replication wallet that stores each of the VPC user credentials. Perform this step only if the replication wallet doesn't already exist. On each host:
    $ mkstore -wrl file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/zdlra -
    createALO
  4. Create credential aliases for each of the three credentials that will be used by RMAN. On each host, run the mkstore command. Enter the appropriate password when prompted.
    $ mkstore -wrl file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/zdlra -
    createCredential dr_rahadr2 hadr_local_vpcuser hadr2_L0cal_Pa55w0rd
    
    $ mkstore -wrl file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/zdlra -
    createCredential dr_rahadr1 hadr_local_vpcuser hadr1_L0cal_Pa55w0rd
    
    $ mkstore -wrl file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/zdlra -
    createCredential dr_rahadr hadr_common_vpcuser c0mm0n_Pa55w0rd
  5. Verify the credentials are working correctly by logging into each target using only the credential alias. On each host, run the following:
    $ sqlplus /@dr_rahadr1
  6. Register the protected database with the Recovery Appliance in RAHADR1. On one of the hosts, run:
    $ rman target / catalog /@dr_rahadr1
    
    RMAN> register database;
  7. Perform a test backup of the current control file to Recovery Appliance hadr1 (RAHADR1). On one of the protected database hosts, perform a backup of the current control file.
    $ rman target / catalog /@dr_rahadr1
    
    RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_%U' PARMS
    "SBT_LIBRARY=/u01/app/oracle/product/12.2.0.1/dbhome_1/lib/libra.so,
    ENV=(RA_WALLET='location=file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/z
    dlra credential_alias=dr_rahadr1')";
    
    RMAN> backup device type sbt current controlfile tag 'controltest';
    
    Starting backup at 05-JUN-18
    allocated channel: ORA_SBT_TAPE_1
    channel ORA_SBT_TAPE_1: SID=2320 instance=cdb122dr1 device type=SBT_TAPE
    channel ORA_SBT_TAPE_1: RA Library (RAHADR1)
    SID=6DE9FE3D49ED4598E05311F3850AC59F
    allocated channel: ORA_SBT_TAPE_2
    channel ORA_SBT_TAPE_2: SID=2516 instance=cdb122dr1 device type=SBT_TAPE
    channel ORA_SBT_TAPE_2: RA Library (RAHADR1)
    SID=6DE9FE48D84C48C8E05311F3850A89BE
    channel ORA_SBT_TAPE_1: starting full datafile backup set
    channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
    including current control file in backup set
    channel ORA_SBT_TAPE_1: starting piece 1 at 05-JUN-18
    channel ORA_SBT_TAPE_1: finished piece 1 at 05-JUN-18
    piece handle=CDB122DR_2kt4m80u_1_1 tag=CONTROLTEST comment=API Version
    2.0,MMS Version 3.17.1.26
    channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:15
    Finished backup at 05-JUN-18
    Starting Control File and SPFILE Autobackup at 05-JUN-18
    piece handle=c-3244939197-20180605-00 comment=API Version 2.0,MMS Version
    3.17.1.26
    Finished Control File and SPFILE Autobackup at 05-JUN-18
  8. List the backup set just created. Verify there are two copies of the control file, one on Recovery Appliance hadr1 (RAHADR1) and the other on Recovery Appliance hadr2 (RAHADR2).
    RMAN> list backupset tag CONTROLTEST;
    
    List of Backup Sets
    ===================
    BS Key Type LV Size
    ------- ---- -- ----------
    220 Full 138.75M
    Control File Included: Ckp SCN: 9076177 Ckp time: 05-JUN-18
    Backup Set Copy #1 of backup set 220
    Device Type Elapsed Time Completion Time Compressed Tag
    ----------- ------------ --------------- ---------- ---
    SBT_TAPE 07:00:21 05-JUN-18 NO CONTROLTEST
    List of Backup Pieces for backup set 220 Copy #1
    BP Key Pc# Status Media Piece Name
    ------- --- ----------- ----------------------- ----------
    221 1 AVAILABLE Recovery Appliance (RAHADR1)
    CDB122DR_2kt4m80u_1_1
    Backup Set Copy #2 of backup set 220
    Device Type Elapsed Time Completion Time Compressed Tag
    ----------- ------------ --------------- ---------- ---
    SBT_TAPE 07:00:21 05-JUN-18 NO CONTROLTEST
    List of Backup Pieces for backup set 220 Copy #2
    BP Key Pc# Status Media Piece Name
    ------- --- ----------- ----------------------- ----------
    246 1 AVAILABLE Recovery Appliance (RAHADR2)
    RA_SBT_CDB122DR_3244939197_230_2kt4m80u_1_2_220