我正在尝试从shell运行sql脚本。我的剧本很好用。它正在连接到数据库并应用sql文件。唯一我无法理解的是,为什么每次都会记录下面的错误消息。
错误消息:
ERROR:
ORA-12545: Connect failed because target host or object does not existShell脚本:
/opt/ORACLE/app/oracle/product/11.2.0/client_1/bin/sqlplus -s <<eoj >>$LOG_FIL 2>&1
${DBUSER1}/${DBPASS}@${hostBillingDBSID}
@${SQLParm} $RPT_FIL
eoj发布于 2014-09-17 22:42:08
试试下面的。
Shell脚本:
#let's include oracle installation in the PATH variable
export PATH=$PATH:/opt/ORACLE/app/oracle/product/11.2.0/client_1/bin
#now just use sqlplus, instead of full path reference.
sqlplus -s ${DBUSER1}/${DBPASS}@${hostBillingDBSID} <<eoj >>$LOG_FIL 2>&1
@${SQLParm} $RPT_FIL
eojuser/password(连接字符串)必须作为命令行参数传递给sqlplus。
https://stackoverflow.com/questions/25900974
复制相似问题