我想使用Unix shell script
连接数据库,但我无法连接
下面提到代码
export ORACLE_HOME="oracle"
value=`/oracle/bin/sqlplus -S user/pwd@SHM4EQ << EOF
SET LINESIZE 300
SET PAGESIZE 300
SET HEADING OFF
SELECT * form dual
EOF`
答案 0 :(得分:0)
尝试这样...
#!/bin/bash
LogDirectory='/var/tmp/logs'
DataDirectory='/var/tmp/data'
DBUSER='scott'
DBUSERPASSWORD='tiger'
DBSID='oracle'
sqlplus -s ${DBUSER}/${DBUSERPASSWORD}@${DBSID} <<EOF
set linesize 32767
set feedback off
set heading off
select * from dual;
EOF