[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2921
  • Last Modified:

Use RMAN restore database validate before restoring database in the same script

Hi All, I have a rman restore script that I would like to execute and I would like to validate the backup before I restore and I'd like to do it in one script is this possible. Below is a simple rman restore that I plan on using.

connect target;
 connect catalog HR89QAT/rcvhcm@RCVHCM;
 shutdown immediate;
 startup mount;
run
{
 ## restore database validate;
  ## if validate invalid or not good then exit otherwise restore database
   allocate channel c5 type 'sbt_tape';
   allocate channel c6 type 'sbt_tape';

    restore database;
    recover database;
    alter database open;

   release channel c5;
   release channel c6;

}


Thanks,
7Souls
0
7Souls
Asked:
7Souls
1 Solution
 
MikeOM_DBACommented:

RMAN does not provide for exception handling, therefore if you 'validate' and it detects as invalid there is no way to stop the script.

You need two scripts: one to validate and the other to restore.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now