RMAN restore using Shell Script
I have a shell script that I use to refresh staging environment using RMAN restore, it is a cluster database, my rest of the script works fine but it only gets interrupted at 'SET UNTIL' clause in RMAN.I tried to use 'SET UNTIL SCN' method to recover database and I used the following query to fetch SCN # once database gets mount :
select next_change# from v\$backup_archivelog_details where sequence#=(select max(sequence#) from v\$backup_archivelog_details);
Above method works sometimes but sometimes it gives below error :
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 20985 and starting SCN of 82905356818The