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

Posted on 2007-08-01
Last Modified: 2013-12-19
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;
 ## 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;


Question by:7Souls
    1 Comment
    LVL 29

    Accepted Solution


    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
    The viewer will learn how to start File History, a MACINTOSH like backup utility built into windows 8, on your Windows 8 computer. To open the File History control panel swipe from the right  side to get the search menu or position the cursor in the…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now