oracle 侦听器无法启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18300464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Listener failed to start
提问by phalanx
I have a virtual Machine on VMWare Player: Oracle 11g on Linux Centos. Since I haven't used it for 2 years, I don't remember almost anything,and when I try to startup the db it says listener is down, and when I try to start listener it says:
我在 VMWare Player 上有一个虚拟机:Linux Centos 上的 Oracle 11g。由于我已经 2 年没有使用它了,我几乎什么都不记得了,当我尝试启动数据库时,它说监听器已关闭,当我尝试启动监听器时,它说:
TNSLSNR for Linux Version 11.2. 0.1.0 - Production
System Parameter file is /oracle/product/11gR2/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/srvlinux/listener/alert/log.xml
Error listening on: (ADRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adater error
TNS-00512: Address already in use
Linux Error: 98: Address already in use
What do I have to configure exactly? Thanks in advance.
我必须准确配置什么?提前致谢。
EDIT:
编辑:
netstat -tulpn | grep :1521
netstat -tulpn | 格雷普:1521
tcp 0 0 :::1521 :::* LIST
EN 3369/tnslsnr
EDIT:
编辑:
lsnrctl status
lsnrctl 状态
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-DEC-2012 16:09:54
sqlplus / as sysdba
sqlplus / 作为 sysdba
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
回答by Alex Poole
ORA-12162 usually means you don't have ORACLE_SID
set - not that it's wrong, but it hasn't been set at all, or has not been exported (depending on your shell). That doesn't tell you anything about whether the database is up, and doesn't imply the listener is down - so don't know if you got a different message from a different connection attempt. Clearly the listener is up on port 1521, from the details you added to the question.
ORA-12162 通常意味着您没有ORACLE_SID
设置 - 不是说它错了,而是根本没有设置,或者尚未导出(取决于您的外壳)。这并没有告诉您有关数据库是否已启动的任何信息,也不意味着侦听器已关闭 - 所以不知道您是否从不同的连接尝试中得到不同的消息。根据您添加到问题的详细信息,显然监听器在端口 1521 上启动。
If you're using something Bourne-y (sh, ksh, bash etc.) you need to set and export your ORACLE_SID
:
如果您使用的是 Bourne-y(sh、ksh、bash 等),则需要设置和导出您的ORACLE_SID
:
export ORACLE_SID=my_sid
If you can't remember the SID you can go grep -ef | grep ora_pmon_
; if that shows anything then the SID is the end of the process name, and the database is up. If it doesn't then look at the output of lsnrctl status
and see if anything is registered, or look in $ORACLE_HOME/dbs
- files in there might include the SID in their names too.
如果你不记得 SID,你可以去grep -ef | grep ora_pmon_
;如果显示任何内容,则 SID 是进程名称的结尾,并且数据库已启动。如果没有,则查看输出lsnrctl status
并查看是否已注册任何内容,或者查看$ORACLE_HOME/dbs
- 那里的文件也可能在其名称中包含 SID。
You might also need to export ORACLE_HOME
if you haven't already, but it sounds like you have, probably from your .profile
/.bashrc
etc.
export ORACLE_HOME
如果您还没有,您可能还需要,但听起来您已经拥有,可能来自您的.profile
/.bashrc
等。