2 ziyuetian ziyuetian 于 2013.09.26 17:20 提问

SHELL中连接oracle错误

SHELL脚本如下:
su - $NCC_USER -c bash <<SQLEND | awk 'BEGIN {}'

sqlplus /NOLOG
CONNECT / AS SYSDBA

SET NULL N
SET LIN 2048

SELECT * from table_name;

EXIT

SQLEND

大部分机器执行都没问题,现有一台机器执行到 CONNECT / AS SYSDBA 时报错,
报错内容如下:
Connected to an idle instanc

e.SQL> SQL> SQL> SQL> SQL>

oracle监听正常启动 lsnrctl status执行结果如下:
[oracle@LYproATMP ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 26-9月 -2013 16:06:39

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LYproATMP)(PORT=1521)))

STATUS of the LISTENER

Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 11-8月 -2013 11:13:54
Uptime 46 days 4 hr. 52 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /grg/oracle/OracleHome/network/admin/listener.ora
Listener Log File /grg/oracle/OracleHome/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "xxxx" has 1 instance(s).
Instance "xxxx", status READY, has 1 handler(s) for this service...
Service "xxxx" has 1 instance(s).
Instance "xxxx", status READY, has 1 handler(s) for this service...
Service "xxxx" has 1 instance(s).
Instance "xxxx", status READY, has 1 handler(s) for this service...

The command completed successfully

请大侠帮帮忙

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!