I have .sh script with this block:

sqlplus -S / as sysdba <<EOFILE

set feedback off
set lines 2000
set pages 20000
col db_size for a15
alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS';

select * from ( select "START_TIME", "END_TIME", INPUT_BYTES_DISPLAY db_size from v$RMAN_BACKUP_JOB_DETAILS order by "END_TIME" DESC) where ROWNUM <= 5;



But output is this error:

select * from ( select "START_TIME", "END_TIME", INPUT_BYTES_DISPLAY db_size from v order by "END_TIME" DESC) where ROWNUM <= 5 * ERROR at line 1: ORA-04044: procedure, function, package, or type is not allowed here

I know there is problem with accessing to v$RMAN_BACKUP_JOB_DETAILS but how should i solve this?

I tried:


Can someone help me? Thanks

1 Answer 1


Try: sqlplus -S / as sysdba <<'EOFILE' ...

Putting quotes tells the shell to not interpret the contents of the here document: it does not try to interpret $XXX in the here document as a shell variable.

  • Man, it worked!! Thanks a lot. Can you easily explain me difference between EOFILE a 'EOFILE'.
    – lear1
    Commented Apr 6, 2020 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.