SQLPlus Command Line In-line Set Commands
You should not put SET and SELECT in the same line, they are seperate commands. For example this works:

$ alias db='sqlplus -s user/password'

$ db &lt;&lt;&lt; 'set heading off
set timing on
set echo off
select * from dual;'

X

Elapsed: 00:00:00.00


If you insist on using a one-liner, you could try this:

$ echo -ne 'set heading off\nset timing on\nset echo off\nselect * from dual;' | db

X

Elapsed: 00:00:00.00