0

I'm trying to issue commands to RMAN (oracle's backup manager utility) through a .bat file (though I hope the syntax is similar.) I'm very new to RMAN and even newer to .bat files, but copying the format I've found from examples online, I made:

rman target system/password
run {
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
}

But when I attempt to run that as a .bat file, it just launches an rman window and does nothing else until I manually enter exit;, at which point it gives errors for the remaining lines being sent directly to the command line.

What am I doing wrong?

Edward Peters
  • 3,623
  • 2
  • 16
  • 39
  • 1
    Put it in a file. `rman target system/password < filewithrman.txt`. If that doesn't work read the help and see if there is a command line switch, eg for FTP `ftp -s filename.txt`. Try `Rman /?` to see if it supports command line help. –  Mar 15 '16 at 00:27
  • Okay - so, have one .bat script, that references a set of rman commands in a .txt file? Is that an rman-specific thing, or a general .bat thing? – Edward Peters Mar 16 '16 at 00:27
  • 1
    `rman TARGET / @cmdfile1` (this is unix, presume Windows is similar) from help at https://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmcnctg.htm. It a general thing for a small range of programs that are interactive at the command prompt. So 99% don't do this. In windows FTP and Diskpart do it. –  Mar 16 '16 at 00:35

0 Answers0