Skip to Main Content

The command "rman target / list backup of archivelog all" does not run within a script

LSanchezSep 19 2014 — edited Sep 21 2014

Hello all. I'm new to Oracle products and I'm not a DBA. I'm a student working on campus through the work study program. I have a bit of programming knowledge but not much SQL experience. I'm writing a bash script and everything seems to be working ok except for one command: "rman target / list backup of archivelog all". I tried to run the command within a run block in a command file but that didn't work. I tried running the command by itself. Yet I'm still having issues running it.

Does anyone have any idea what the issue might be? The oraenv program is called prior to any rman commands being run. This is just a snippet of the script but none of the other parts have anything to do with rman. What I've posted is the only part of the script experiencing issues.

Does anyone know how I can run "rman target / list backup of archivelog all" within a bash script and then store the output so it can be parsed? The goal is to parse the output for sequence numbers and then find the largest one.

Thank you

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00552: syntax error in command line arguments

RMAN-01009: syntax error: found "list": expecting one of: "append, auxiliary, catalog, checksyntax, cmdfile, log, msgno, nocatalog, pipe, script, send, target, timeout, using, @, ;"

RMAN-01007: at line 2 column 1 file: command line arguments

This is the portion of the script being worked with:

echo "run{" > $rman_catalog

echo "shutdown abort;" >> $rman_catalog

echo "startup nomount;" >> $rman_catalog

echo "restore controlfile from '/backup/$ORACLE_SID_L/$(ls /backup/$ORACLE_SID_L/ | grep -ie "^[c]" | grep $dateGiven)';" >> $rman_catalog

echo "alter database mount;" >> $rman_catalog

echo "catalog start with '/backup/$ORACLE_SID_L/$ORACLE_SID_U/backupset/$dateGiven/';" >> $rman_catalog

echo "}" >> $rman_catalog

rman target / cmdfile=$rman_catalog log=$rman_catalog_log

rman target / list backup of archivelog all

Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Oct 19 2014
Added on Sep 19 2014