perl script scr01.rman
perl script to generate an rman restore script called scr01.rman.
#!/usr/local/bin/perl
if ($#ARGV != 1) {
print "usage: rest.pl startseq endseq\n";
exit;
}
$startseq = $ARGV[0];
$endseq = $ARGV[1];
open(SCRIPT, ">scr01.rman");
print SCRIPT "run {\n";
print SCRIPT "set archivelog destination to '/global/somedir/backup/arch';\n";
print SCRIPT "restore archivelog from sequence $startseq until sequence $endseq;\n";
print SCRIPT "}\n";
close(SCRIPT);
The script can then be run in rman
rman
>connect target /
>connect catalog login/password@rmanrep
>@scr01.rman