Restore On-Premises Database Using Backups from Recovery Service

Use SQLcl to prepare the RMAN environment for restores using backups stored in Recovery Service.

  1. Use SQLcl to log in to the database as a user with SYSBACKUP privileges.
    /opt/oracle/sqlcl/bin/sql -name <DB_UNIQUE_NAME>_rcv_conn

    In this example, you connect to the database c1db1.

    /opt/oracle/sqlcl/bin/sql -name c1db1_rcv_conn
  2. Run the rcv show restore_range command to view the restore range of the database for backups stored in Recovery Service.
    SQL> rcv show restore_range
  3. Run the rcv configure rman_env command to generate a the rcv_restore_template.rman script.
    rcv configure rman_env
    Review the sample output. In this example, the rcv configure rman_env command creates the rcv_restore_template.rman script.
    2025-09-17 23:41:35: Generated template backup script /u01/app/oracle/rcv/dbs/c1db1/rman_env/rcv_restore_template.rman
    2025-09-17 23:41:35: Edit script with RMAN commands to execute.
    2025-09-17 23:41:35: To run script: source /u01/app/oracle/rcv/dbs/c1db1/rman_env/rman_env.sh
    2025-09-17 23:41:35: rman target / catalog /@c1db1_DBRS cmdfile /u01/app/oracle/rcv/dbs/c1db1/rman_env/rcv_restore_template.rman
    2025-09-17 23:41:35: rcv configure rman_env completed successfully
  4. Edit the RMAN script template rcv_restore_template.rman to include the required RMAN commands.
  5. Source the RMAN environment script and connect RMAN to the target database and the recovery catalog.
    In this example, you source the rman_env.sh script and then connect RMAN to the target database c1db1.
    [oracle@host ~] source /u01/app/oracle/rcv/dbs/c1db1/rman_env/rman_env.sh
    [oracle@host ~] rman target / catalog /@c1db1_DBRS cmdfile /u01/app/oracle/rcv/dbs/c1db1/rman_env/rcv_restore_template.rman
    
    Recovery Manager: Release 19.0.0.0.0 - Production
    ...
    connected to target database: C1DB1 (DBID=1111401884)
    ...
    RMAN>

    You can now use regular RMAN commands to RESTORE or LIST backups.

    See Oracle Database Backup and Recovery Reference to learn about RMAN commands.