Add On-Premises Database to Recovery Service Using Cloud Protect

The Cloud Protect Fleet Agent registers the on-premises database with Recovery Service to create a protected database.

In SQLcl, run the rcv add database command to automatically detect the database clients and generate a configuration (JSON) file. The configuration file includes the parameters required to add the database to Recovery Service. Then, run the rcv add database command again, along with the configuration file, to register the database with Recovery Service and create the protected database. Oracle recommends that you follow this automated method to add databases to Recovery Service.

Another method is by manually connecting to every database (with SYSBACKUP privileges) and then using the rcv add database command to add each database individually.

Note

Cloud Protect assigns the Oracle defined Bronze protection policy as the default policy for all databases. You can change the default policy in the configuration file before adding the database.

Use these steps to add an on-premises database to Recovery Service.

  1. Log in to the database as the Oracle software owner user (oracle). Verify that the ORACLE_HOME environmental variable is set.

    In this example, the ORACLE_HOME environmental variable points to the directory where the Oracle database client is installed.

    echo $ORACLE_HOME
    /u01/app/oracle/product/19.0.0.0/dbhome_1
  2. Start SQLcl as a oracle user.
    In an Oracle RAC environment, start SQLcl only on the first compute node.
    oracle@host$ /opt/oracle/sqlcl/bin/sql /nolog
    SQL>
  3. Run the rcv add database command along with these options to automatically detect the databases and generate a configuration file.
    • -auto_discover
    • -generate_config_only
    • -compartment_id <COMPARTMENT_OCID>
    • -recovery_service_subnets <SUBNET_OCID>
    SQL> rcv add database -auto_discover -generate_config_only -compartment_id <COMPARTMENT_OCID> -recovery_service_subnets <SUBNET_OCID>
    In this sample output, the rcv add database command generates the add_database.json configuration file which contains the compartment ID and Recovery Service subnet ID values required to create protected database. The Bronze policy is assigned as the default protection policy.
    2025-08-15 09:22:16: Created config JSON /u01/app/oracle/rcv/add_database.json
    2025-08-15 09:22:16: You can onboard a database by running 'rcv add database -config /u01/app/oracle/rcv/add_database.json'
    Sample contents of the add_database.json configuration file.
    
    [
        {
            "dbUniqueName": "DB1",
            "displayName": "DB1",
            "compartmentId": "ocid1.compartment.oc1..aaa...",
            "protectionPolicy": "ocid1.recoveryservicepolicy.region1..aaa...",
            "sbtLibrary": "/u01/app/oracle/product/19.24.0.0/dbhome_2/lib/libra.so",
            "oracleHome": "/u01/app/oracle/product/19.24.0.0/dbhome_2",
            "oracleSid": "DB1",
            "recoveryServiceSubnets": [
                "ocid1.subnet.oc1.phx.aaa..."
            ]
        },
        {
            "dbUniqueName": "DB2",
            "displayName": "DB2",
            "compartmentId": "ocid1.compartment.oc1..aaaaaa...",
            "protectionPolicy": "ocid1.recoveryservicepolicy.region1..aaa...",
            "sbtLibrary": "/u01/app/oracle/product/19.27.0.0/dbhome_1/lib/libra.so",
            "oracleHome": "/u01/app/oracle/product/19.27.0.0/dbhome_1",
            "oracleSid": "DB2",
            "recoveryServiceSubnets": [
                "ocid1.subnet.oc1.phx.aaa..."
            ]
        },
        {
            "dbUniqueName": "DB3",
            "displayName": "DB3",
            "compartmentId": "ocid1.compartment.oc1..aaa...",
            "protectionPolicy": "ocid1.recoveryservicepolicy.region1..aaa...",
            "sbtLibrary": "/u01/app/oracle/product/19.26.0.0/dbhome_3/lib/libra.so",
            "oracleHome": "/u01/app/oracle/product/19.26.0.0/dbhome_3",
            "oracleSid": "DB3",
            "recoveryServiceSubnets": [
                "ocid1.subnet.oc1.phx.aaa..."
            ]
        }
    ]
    SQL>
  4. (Optional) Edit the configuration file to modify the assigned values, if necessary.
    edit /u01/app/oracle/rcv/add_database.json
  5. Run the rcv add database command again and specify the configuration file.
    SQL> rcv add database -config <confgiration file location> 
    In this example, you specify the path for the add_database.json configuration file.
    SQL> rcv add database -config /u01/app/oracle/rcv/add_database.json 
    The Cloud Protect Fleet Agent performs these steps internally:
    • Verifies the prerequisites for adding the database to Recovery Service.
    • Creates a SYSBACKUP user and password, if the SYSBACKUP user does not exist.
      Note

      The SYSBACKUP user and password is required for the Cloud Protect Fleet Agent to establish a named connection to the database. Use this command to connect to the database as the SYSBACKUP user:

      /opt/oracle/sqlcl/bin/sql -name <DB_UNIQUE_NAME>_rcv_conn

      DB_UNIQUE_NAME is the globally unique name of the database.

    • Generates a random password for the VPC user account. The VPC user credentials are required to authenticate database access to the RMAN recovery catalog.
    • Invokes the Recovery Service API to create a protected database resource.
    • Invokes the API every 10 minutes until the protected database enters the Active life cycle state.
    • Extracts the protected database network connection details and updates the configuration file.
    • Registers the database in Recovery Appliance of Recovery Service using RMAN
    • Configures the protected database with Cloud Protect.
    • Cloud Protect maintains data protection.
  6. (Recommended) Enable Real-time data protection.
    1. Use SQLcl to log in to the database as a user with the SYSBACKUP privileges.
      oracle@host$ /opt/oracle/sqlcl/bin/sql -name <DB_UNIQUE_NAME>_rcv_conn

      In this example, you connect to the database c1db1.

      oracle@host$ /opt/oracle/sqlcl/bin/sql -name c1db1_rcv_conn
    2. Run the rcv realtime_redo command.
      SQL> rcv add realtime_redo
      Review the sample output for the database c1db1.
      2025-08-15 10:33:48: Log file: /u01/app/oracle/rcv/dbs/c1db1/log/add_realtime_redo_c1db1.20250815.103348.log
      SQL>
    3. Restart the database for the changes to take effect.