Should be inside the here-document:
/u01/app/oracle/bin/sqlplus "/ as sysdba" <<EOF
define dir='/u02/coldtest'
set feedback off heading off verify off
set pagesize 0 linesize 200
.........
EOF
"Thiyagaraj " <oracledba-ezmlmshield-x49880775.[Email address protected]
wrote on 04/30/2007 12:25:47 PM:
> Hi,
>
> The below solaris script gives me error messages.
>
>
> Script:
>
> ORACLE_BASE=/u01/app/oracle
> export ORACLE_BASE
> ORACLE_HOME=/u01/app/oracle
>
> ORACLE_SID=xxx
> export ORACLE_SID
> export ORACLE_HOME
>
> define dir='/u02/coldtest'
> set feedback off heading off verify off
> set pagesize 0 linesize 200
>
>
> /u01/app/oracle/bin/sqlplus "/ as sysdba" <<EOF
>
> spool /u02/coldtest/coldbackup.sh
> select 'host cp '|| name ||' :&dir' from v$datafile order by 1;
> select 'host cp '|| member ||' :&dir' from v$logfile order by 1;
> select 'host cp '|| name ||' :&dir' from v$controlfile order by 1;
> select 'host cp '|| name ||' :&dir' from v$tempfile order by 1;
>
> spool off;
>
>
> Error:
>
>
> bash-2.05$ sh coldscript.sh
> coldscript.sh: define: not found
>
> SQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 30 21:54:35 2007
>
> Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
>
>
> Connected to:
> Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
> JServer Release 9.2.0.1.0 - Production
>
> SQL> SQL> SQL> Enter value for dir: old 1: select 'host cp '|| name
||'
> :&dir' from v order by 1
> new 1: select 'host cp '|| name ||' :select 'host cp '|| member ||'
:&dir'
> from v order by 1;' from v order by 1
> select 'host cp '|| name ||' :select 'host cp '|| member ||' :&dir' from
v
> order by 1;' from v order by 1
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
>
> SQL> Enter value for dir: old 1: select 'host cp '|| name ||' :&dir'
from
> v order by 1
> new 1: select 'host cp '|| name ||' :select 'host cp '|| name ||'
:&dir'
> from v order by 1;' from v order by 1
> select 'host cp '|| name ||' :select 'host cp '|| name ||' :&dir' from v
> order by 1;' from v order by 1
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
>
> SQL> SQL> SQL> SQL> Disconnected from Oracle9i Enterprise Edition
Release
> 9.2.0.1.0 - 64bit Production
> JServer Release 9.2.0.1.0 - Production
>
>
>
>
> Please help me ,since this is urgent.
>
> Thanks
>
> -Raaj
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
---
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
Oracle LazyDBA home page