Oracle Monitoring RMAN: report need backup
A) Oracle replied to my SR that it is not supported run the SQLs manually. This is not entirely correct but I expected something like that.

B) The second command report unrecoverable can be queried with SQL. The result is even more accurate than from RMAN.

select file#, unrecoverable_change#, unrecoverable_time from v$datafile;


RMAN's report unrecoveryble will only report files which contain content which are unrecoveryble after the latest backup. This SQL reports unrecoverable things in general. Normally we do not try to make the database only recoverable after the latest backup.

C) For both commands I wrote a "screen reader". Here are some code snippets:

## Execute RMAN command report need backup
RMANOUT=$(rman target / &lt;&lt; EOF 2&gt;&amp;1
report need backup;
exit
EOF
)

## Execute RMAN command report unrecoverable
RMANOUT=$(rman target / &lt;&lt; EOF 2&gt;&amp;1
report unrecoverable;
exit
EOF
)

# Filter file list
DATAFILES=$(echo -e "${RMANOUT}" | sed '1,/---/d' | sed '/Recovery Manager complete./d' | sed 's/RMAN&gt;//g' | sed '/^[[:space:]]/d')


## Parse all files
while IFS=$'\n' read -a ROW
do
  # Convert lines into array (separator " ")
  IFS=' ' read -a VAL &lt;&lt;&lt; ${ROW[0]}

  # No files reported
  if [ "${VAL}" == "" ]; then break; fi

  # Do whatever you like! In my case generate XMLdoc
  XMLDOC="${XMLDOC}&lt;ROW&gt;&lt;DBID&gt;${DBID}&lt;/DBID&gt;&lt;INST_ID&gt;${INST_ID}&lt;/INST_ID&gt;&lt;FILE_ID&gt;${VAL[0]}&lt;/FILE_ID&gt;&lt;BACKUP_CNT&gt;${VAL[1]}&lt;/BACKUP_CNT&gt;&lt;FILE_NAME&gt;${VAL[2]}&lt;/FILE_NAME&gt;&lt;/ROW&gt;"
done &lt; &lt;(echo -e "${DATAFILES}")