Home » Infrastructure » Unix » spool error (oracle 11.2.0)
spool error [message #594331] Tue, 27 August 2013 08:34 Go to next message
noname34
Messages: 6
Registered: August 2013
Location: visakhapatnam
Junior Member
Hi Friends,

Am facing issues executing the following script

#!/bin/bash
cd /home/oracle
. orcl.env
sqlplus / as sysdba <<EOF
spool /u01/app/oracle/trial.txt
select * from v$flash_recovery_area_usage;
spool off
exit;
EOF

The o/p for the following is

1 SQL> select * from v;
2 select * from v
3 *
4 ERROR at line 1:
5 ORA-04044: procedure, function, package, or type is not allowed here
6
7
8 SQL> spool off
.

The expected o/p is the output of the select query, but its not working so.
I suppose it is not taking characters from the '$' symbol.

Would be greatful if anybody could help me with this .

Thanks & Advance.
Re: spool error [message #594332 is a reply to message #594331] Tue, 27 August 2013 08:35 Go to previous messageGo to next message
noname34
Messages: 6
Registered: August 2013
Location: visakhapatnam
Junior Member
It,s a shell script which i am trying to execute.
Re: spool error [message #594333 is a reply to message #594331] Tue, 27 August 2013 08:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
I suppose it is not taking characters from the '$' symbol.


It is almost that; you have to escape the $ with \: \$
I don't see the relation with your title.

Regards
Michel
Re: spool error [message #594338 is a reply to message #594333] Tue, 27 August 2013 08:55 Go to previous message
noname34
Messages: 6
Registered: August 2013
Location: visakhapatnam
Junior Member
oops. sorry for the silly error, but thanks a lot Michel for the solution.

Thanks & Regards,
Ash
Previous Topic: need to exit if report file is not found
Next Topic: Oracle installation issue on solaris
Goto Forum:
  


Current Time: Thu Nov 21 10:21:43 CST 2024