Oralce exp提示ORA-12541: TNS:no listener

在Redhat上使用exp命令备份Oracle数据文件,命令:
exp username/password@orcl10g owner=username file=/bakup/username_db_20140821.dmp log=username_20140821_log rows=y

提示:
EXP-00056: ORACLE error 12541 encountered
ORA-12541: TNS:no listener
EXP-00000: Export terminated unsuccessfully

侦听配置文件 /app/oracle/product/10.2.0/db_1/network/admin/listener.ora 是没有问题的,侦听也是正常运行的,PL/SQL客户端一直正常连接。

#lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 21-AUG-2014 10:38:03

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

TNS-01106: Listener using listener name LISTENER has already been started

#lsnrctl status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 – Production
Start Date 03-AUG-2014 14:48:08
Uptime 17 days 20 hr. 8 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.198.1.104)(PORT=1521)))
Services Summary…
Service “orcl10g” has 1 instance(s).
Instance “orcl10g”, status UNKNOWN, has 2 handler(s) for this service…
The command completed successfully

#tnsping orcl10g
TNS Ping Utility for Linux: Version 10.2.0.1.0 – Production on 21-AUG-2014 10:43:48

Copyright (c) 1997, 2005, Oracle. All rights reserved.

Used parameter files:
/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = notax)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl10g)))
TNS-12541: TNS:no listener

 

百度上搜了半天,和exp相关的很少,和linux相关的很少,改用google,搜到的第一个结果就解决了:

exp username/password owner=username file=/bakup/username_db_20140821.dmp log=username_20140821_log rows=y

去掉实例名(sid name)就可以了。具体原因还没确定,先这么用着吧。

2014-08-21_114301