The SQL*Plus statement needs to go BEFORE the define statement and you
haven't closed the EOF.
Michael Peel
-----Original Message-----
From: Thiyagaraj
[mailto:oracledba-ezmlmshield-x49880775.[Email address protected]
Sent: 30 April 2007 17:26
To: LazyDBA Discussion
Subject: ORA-00923
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 is confidential and may be privileged.
It may only be read, copied and used by the intended recipient.
If you have received it in error please contact the sender immediately
by return e-mail. Please then delete the e-mail and any copies of it
and do not use or disclose its contents to any person.
**********************************************************************
Registered Office: Farncombe House, Broadway, Worcestershire, WR12 7LJ
AccuRead Limited Registered Number: 3076187 England
GSL UK Limited Registered Number: 3333860 England
Global Solutions Limited Registered Number: 3189802 England
**********************************************************************
Oracle LazyDBA home page