Restore On-Premises Database Using Backups from Recovery Service
Use SQLcl to prepare the RMAN environment for restores using backups stored in Recovery Service.
- Use SQLcl to log in to the database as a user with
SYSBACKUPprivileges./opt/oracle/sqlcl/bin/sql -name <DB_UNIQUE_NAME>_rcv_connIn this example, you connect to the database
c1db1./opt/oracle/sqlcl/bin/sql -name c1db1_rcv_conn - Run the
rcvshowrestore_rangecommand to view the restore range of the database for backups stored in Recovery Service.SQL> rcv show restore_range - Run the
rcvconfigurerman_envcommand to generate a thercv_restore_template.rmanscript.rcv configure rman_envReview the sample output. In this example, thercv configure rman_envcommand creates thercv_restore_template.rmanscript.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 - Edit the RMAN script template
rcv_restore_template.rmanto include the required RMAN commands. - Source the RMAN environment script and connect RMAN to the target database and
the recovery catalog.In this example, you source the
rman_env.shscript and then connect RMAN to the target databasec1db1.[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
RESTOREorLISTbackups.See Oracle Database Backup and Recovery Reference to learn about RMAN commands.