In recent years, with the rapid development of Internet technology, the application of databases has become more and more widespread. The Oracle database is a widely used database. However, during the use of the Oracle database, various problems will also be encountered. One of the most common problems is that the listening service that starts Oracle cannot be started. This article will detail the causes and solutions to this problem.
1. Cause of the problem
The listening service of Oracle database is a very important component. It is the bridge between the Oracle database instance and the client. If the listening service cannot be started, it will result in the inability to connect to the Oracle database instance. So what is the cause of this problem?
2. Solution to the problem
After determining the cause of the problem, we need to take corresponding solutions. Below, we will introduce several ways to solve this problem.
Method 1: Check the status of the listening service
First, we need to check the status of the listening service. Under the Windows operating system, you can check the status of the listening service through the following steps:
If you see output similar to the following information, the listening service has been started:
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 08-JAN -2022 22:16:29
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT= 1521)))
Alias LISTENER_VERSION_1
Version TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
Start Date 28-DEC- 2021 20:18:39
Uptime 11 days 1 hr. 57 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app \oracle\product\11.2.0\dbhome_2\network\admin\listener.ora
Listener Log File C:\app\oracle\diag\tnslsnr\DESKTOP\Test\alert\log.xml
Listening Endpoints Summary ...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance( s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCLXDB" has 1 instance(s).
Instance "ORCL", status READY , has 1 handler(s) for this service...
Service "testdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testxdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully.
If you see output similar to the following information, the listening service has not been started:
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 08-JAN-2022 22:17:43
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
TNS -12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
Solution: If the listening service The status is startup, no operation is required. If the status of the listening service is stopped or suspended, you need to start the listening service.
Under the Windows operating system, you can start the Oracle listening service through the following steps:
Method 2: Check the port occupancy
If the Oracle listening service cannot be started, it may be because the port is occupied. You can check the port occupancy through the following steps:
TCP 127.0.0.1:1521 0.0.0.0:0 LISTENING
If you see something similar to The above output information indicates that the port is occupied.
Solution: You can release the port through the following steps:
taskkill /pid 1234 /f
Method 3: Check TNS name resolution
If you see the following output when running the "lsnrctl status" command:
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 08-JAN-2022 22:17:43
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL= TCP)(HOST=127.0.0.1)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
This may be caused by a TNS name resolution error.
Solution: You can check TNS name resolution by following these steps:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) )
)
The TNS name here is "ORCL".
Method 4: Check the listening service configuration
If none of the above methods solve the problem, it may be caused by an incorrect configuration of the listening service. You can check the listening service configuration through the following steps:
Summary
It is a common problem that the listening service of Oracle cannot be started. There are many reasons for this problem, which may be caused by incorrect status of the listening service, port occupation, TNS name resolution error, or incorrect configuration of the listening service. To solve this problem, you can check the status of the listening service, check the port occupancy, check TNS name resolution, and check the configuration of the listening service. When solving this problem, different approaches are required depending on the specific situation. Through the introduction of this article, I believe that readers can better solve the problem of unable to start the listening service of Oracle.
The above is the detailed content of [Summary] Reasons and solutions for the oracle monitoring service to fail to start. For more information, please follow other related articles on the PHP Chinese website!