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
Oracle LazyDBA home page