Oracle 侦听器未运行且无法启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26236967/
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
Oracle listener not running and won't start
提问by Pranav Nath
I am getting the following errors while from the lsnrctl status
command:
从lsnrctl status
命令中我收到以下错误:
C:\Users\pna105>lsnrctl stat
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 08-OCT-2014 17:53
:55
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
It was working fine before restart but now it is not working and I also can't access my Oracle homepage.
它在重新启动前运行良好,但现在无法正常工作,而且我也无法访问我的 Oracle 主页。
My tnsnames.ora
is:
我的tnsnames.ora
是:
ORACLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORACLE)
)
)
LISTENER_ORACLE =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
My listener.ora
is: (Here were error due to brackets misplaced adding few spaces resolved the problem TNS-12518)
我的listener.ora
是:(由于括号错位而导致错误添加了几个空格解决了问题 TNS-12518)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = ORACLE)
(ORACLE_HOME = C:\app\PNA105\product.2.0\dbhome_1)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\app\PNA105\product.2.0\dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\PNA105\product.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\PNA105\product.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\PNA105
Following is the output of lsnrctl start
command
以下是lsnrctl start
命令的输出
C:\Users\pna105>lsnrctl start
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 08-OCT-2014 18:26
:22
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
Following is the Last entry needed from log file.
以下是日志文件所需的最后一个条目。
Started with pid=14784
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Listener completed notification to CRS on start
09-OCT-2014 15:46:01 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=INL007306$))
(SERVICE_NAME=oracle)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57389)) *
establish * oracle * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
64-bit Windows Error: 203: Unknown error
Dynamic address is already listened on (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
(HOST=127.0.0.1)(PORT=1521)))
09-OCT-2014 15:46:06 * service_register * oracle * 0
Thu Oct 09 15:46:11 2014
09-OCT-2014 15:46:11 * service_update * oracle * 0
09-OCT-2014 15:46:12 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=INL007306$))
(SERVICE_NAME=oracle)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57393)) *
establish * oracle * 0
09-OCT-2014 15:46:12 * service_update * oracle * 0
09-OCT-2014 15:46:13 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=INL007306$))
(SERVICE_NAME=oracle)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57394)) *
establish * oracle * 0
Tried to resolve TNS-12518 and listener started but still not able to access Oracle home page
尝试解决 TNS-12518 和监听器启动但仍然无法访问 Oracle 主页
output of lnsrctl stat
lnsrctl stat 的输出
C:\Users\pna105>lsnrctl stat
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 09-OCT-2014 17:16
:56
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 09-OCT-2014 15:45:58
Uptime 0 days 1 hr. 30 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\PNA105\product.2.0\dbhome_1\network\admin\li
stener.ora
Listener Log File c:\app\pna105\diag\tnslsnr\INL007306\listener\alert\lo
g.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ORACLE" has 2 instance(s).
Instance "ORACLE", status UNKNOWN, has 1 handler(s) for this service...
Instance "oracle", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "oracleXDB" has 1 instance(s).
Instance "oracle", status READY, has 1 handler(s) for this service...
T he command completed successfully
命令成功完成
采纳答案by Piotr Kepka
1.Check the Environment variables (must be set for Systemand not for user):
1.检查环境变量(必须为系统而不是用户设置):
ORACLE_HOME = C:\oraclexe\app\oracle\product.2.0\server
ORACLE_SID = XE
2.Check if you have the right definition in listener.ora
2.检查listener.ora中的定义是否正确
XE =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
3.Restart the service (Services > OracleServiceXE)
3.重启服务(Services > OracleServiceXE)
After that you may see a new service called OracleXETNSListenerXE.
There is already an old OracleXETNSListener.
之后,您可能会看到一个名为 OracleXETNSListenerXE 的新服务。
已经有一个旧的 OracleXETNSListener。
I started both and then I was able to make a successful connection.
我开始了两者,然后我能够成功建立连接。
Edit:
编辑:
If everything is running but you still can't connect, check if there is no error: ORA-12557: TNS:protocol adapter not loadable.
如果一切都在运行但仍然无法连接,请检查是否没有错误:ORA-12557: TNS:protocol adapter not loadable。
To correct the error go back to the Environment variables and this time edit the one called: Path. Be sure that C:\oraclexe\app\oracle\product\11.2.0\server\binis somewhere at the beginning, definitely before any other path pointing to a different version of the Oracle DB.
要更正错误,请返回环境变量,这次编辑名为:Path 的变量。确保C:\oraclex\app\oracle\product\11.2.0\server\bin位于开头的某个位置,绝对在指向不同版本 Oracle DB 的任何其他路径之前。
回答by Imre
I had the same problem. Solution in my case: run CMD as ADMINISTRATOR. then type and execute: "lsnrctl start" wait about 2 minutes then should work. (in my case was only 50 seconds, but just to be on the safe side)
我有同样的问题。在我的情况下的解决方案:以管理员身份运行 CMD。然后输入并执行:“lsnrctl start”等待大约 2 分钟然后应该可以工作。(在我的情况下只有 50 秒,但只是为了安全起见)
回答by Muneeb Mirza
I solved it by updating listener.ora file inside oracle directory oraclexe\app\oracle\product\11.2.0\server\network\ADMIN.
我通过更新 oracle 目录 oraclexe\app\oracle\product\11.2.0\server\network\ADMIN 中的 listener.ora 文件解决了这个问题。
Why did it happen to me was because I changed my system name but inside listener.ora there was old name for HOST.
为什么发生在我身上是因为我更改了系统名称,但在 listener.ora 中,HOST 的名称是旧名称。
This might be one of the reasons... for those who still face such issue might think of this possibility as well.
这可能是原因之一......因为那些仍然面临此类问题的人可能也会想到这种可能性。
回答by Tsionel Oksana
I had the same problem on 11.201 on Windows. After: additional install 11.203 64bit server and client in new folders. PATH environment variable was changed right after install. Error in listener appeared after listener service restart. In my case there was a night time and number of windows updates, so windows server restart helped us. Also I cleaned listener.log file according to http://pavandba.com/tag/tns-12560-tns-protocol-adapter-error/, it was surprisingly big.
我在 Windows 上的 11.201 上遇到了同样的问题。之后:在新文件夹中额外安装 11.203 64 位服务器和客户端。PATH 环境变量在安装后立即更改。监听器服务重启后监听器出现错误。在我的情况下,有一个晚上的时间和 Windows 更新的数量,所以 Windows 服务器重启帮助了我们。我还根据http://pavandba.com/tag/tns-12560-tns-protocol-adapter-error/清理了 listener.log 文件,它非常大。
回答by MrLymy
Check that ORACLE_HOME environment variable is pointing to the correct oracle home. In my case it was changed by another software installation.
检查 ORACLE_HOME 环境变量是否指向正确的 oracle home。在我的情况下,它被另一个软件安装改变了。
回答by Mike Alex
Same happened to me after I changed computer name. To fix that, just locate listener.ora file and replace old computer name with the new one
我更改计算机名称后也发生了同样的情况。要解决这个问题,只需找到 listener.ora 文件并将旧的计算机名称替换为新的
回答by manix
In my case, I tried to start the listener via console:
就我而言,我尝试通过控制台启动侦听器:
> lsnrctl star
This command printed the following error:
此命令打印以下错误:
TNS-12560: TNS:protocol adapter error
TNS-00583: Valid node checking: unable to parse configuration parameters
So, I performed the following actions:
因此,我执行了以下操作:
- Check if Oracle
listener.ora
orsqlnet.ora
file contains special characters - Check if Oracle
listener.ora
or sqlnet.ora` file are in wrong format or syntax - Check if Oracle
listener.ora
orsqlnet.ora
file have some left justified parenthesis which are not accepted by oracle parser.
- 检查 Oracle
listener.ora
或sqlnet.ora
文件是否包含特殊字符 - 检查 Oracle
listener.ora
或 sqlnet.ora` 文件的格式或语法是否错误 - 检查 Oracle
listener.ora
或sqlnet.ora
文件是否有一些 oracle 解析器不接受的左对齐括号。
Have a look at these files and check the proper syntax. If possible remove/rename sqlnet.ora and try to restart the listener. Or remove/rename both listener.ora or sqlnet.ora file and recreate it properly. These will defenitely resolve the issue.
查看这些文件并检查正确的语法。如果可能,删除/重命名 sqlnet.ora 并尝试重新启动侦听器。或者删除/重命名 listener.ora 或 sqlnet.ora 文件并正确重新创建它。这些将绝对解决问题。
回答by Garima Kushwaha
In my case somehow windows listener service had stopped working so I was not able to connect to Qracle using SQL Developer. However I was able to connect through sqlplus
.
就我而言,Windows 侦听器服务以某种方式停止工作,因此我无法使用 SQL Developer 连接到 Qracle。但是我能够通过sqlplus
.
Below solution worked for me:
以下解决方案对我有用:
First, ensure that your listener service is running.
首先,确保您的侦听器服务正在运行。
C:\Documents and Settings\ME>lsnrctl status
If the listener service is not running, re-start the listener service using the Windows task manager or use the DOS command line utility to re-start the Windows service with the net start
command:
如果侦听器服务未运行,请使用 Windows 任务管理器重新启动侦听器服务或使用 DOS 命令行实用程序使用以下命令重新启动 Windows 服务net start
:
C:\Documents and Settings\ME>net start OracleOraDb10g_home1TNSListener
Try to start the listener service using lsnrctl
from DOS prompt.
尝试使用lsnrctl
从 DOS 提示符启动侦听器服务。
lsnrctl start
回答by Jaewon Lee
I encounter similar problem when installing oracle 11gR2 on Windows 2012 server. the problem is solved when I run cmd.exe as Admistrator privilege and run "lsnrctl start LISTENER".
我在 Windows 2012 服务器上安装 oracle 11gR2 时遇到了类似的问题。当我以管理员权限运行 cmd.exe 并运行“lsnrctl start LISTENER”时,问题就解决了。
回答by Sai Viswanath VKS Palaparthi
I encountered the same problem and reason being: Mine is a personal windows PC. And i have modified the computer name and the same did not reflect in listener.ora. Updating ORACLE_HOME\network\ADMIN\listener.ora with updated host name fixed the issue.
我遇到了同样的问题,原因是:我的是个人 Windows PC。而且我已经修改了计算机名称,并且在 listener.ora 中也没有反映。使用更新的主机名更新 ORACLE_HOME\network\ADMIN\listener.ora 修复了该问题。