- 论坛徽章:
- 0
|
脚本如下:
#!/bin/sh
CMD_STR="
/u01/app/oracle/product/9.2.0/bin/sqlplus /nolog <<EOF
connect / as sysdba
select * from v\$session ;
exit;
EOF
"
echo "$CMD_STR"
/bin/sh -c "$CMD_STR"
执行的结果:
[oracle@kalei rman]$ ./mytest1.sh
/u01/app/oracle/product/9.2.0/bin/sqlplus /nolog <<EOF
connect / as sysdba
select * from v$session ;
exit;
EOF
SQL*Plus: Release 9.2.0.4.0 - Production on ÐÇÆÚÈÕ 7ÔÂ 9 18:25:57 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> Connected.
SQL> select * from v
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
[oracle@kalei rman]$
怎么会这样呢? |
|