日期:2014-05-16  浏览次数:20724 次

请教一个sqlplus的问题
使用批处理执行文件sql时,如果出现用户名、密码或者tns错误会提示如下信息等待键盘输入,有什么办法不等待键盘输入直接退出批处理呢?
SQL*Plus: Release 11.2.0.1.0 Production on Wed May 8 11:14:15 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: 
ERROR:
ORA-12546: TNS:permission denied


Enter user-name: 
ERROR:
ORA-12546: TNS:permission denied


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
oracle?sqlplus

------解决方案--------------------
--使用-L参数即可。只尝试登陆一次,而不是在出错时提示。
sqlplus scoot/tiger@orcl1 -l