oracle 侦听器不支持任何服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24857858/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 05:42:31  来源:igfitidea点击:

The listener supports no services

oracleoracle11g

提问by Simo03

I installed Oracle Database 11gR2 as well as Oracle Grid Infrastructure on a Linux box, then I created the orcldatabase.

我在 Linux 机器上安装了 Oracle Database 11gR2 和 Oracle Grid Infrastructure,然后我创建了orcl数据库。

I have always been able to connect to my database using SQL*Plus or OEM. But lately, I'm facing an issue when typing the command lsnrctl status, and so I'm not able to connect to the database.

我一直能够使用 SQL*Plus 或 OEM 连接到我的数据库。但是最近,我在键入命令时遇到问题lsnrctl status,因此无法连接到数据库。

My listener.orafile:

我的listener.ora文件:

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = pc.company.com)(PORT = 1521))
    )
  )
ADR_BASE_LISTENER = /u01/app/oracle

My tnsnames.ora file :

我的 tnsnames.ora 文件:

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = pc.company.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.example.com)
    )
  )

When typing lsnrctl status, I get the following :

打字时lsnrctl status,我得到以下信息:

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-JUL-2014 03:35:48

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                21-JUL-2014 03:25:58
Uptime                    0 days 0 hr. 9 min. 50 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/pc151/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pc.company.com)(PORT=1521)))
The listener supports no services
The command completed successfully


When typing sqlplus / as sysdbathen startup, I get this :

sqlplus / as sysdba然后打字时startup,我得到这个:

ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-29701: unable to connect to Cluster Synchronization Service

And the srvctl start databasecommand fails to start the database up too.

并且该srvctl start database命令也无法启动数据库。

My oratabfile is the following :

我的oratab文件如下:

#Backup file is  /u01/app/oracle/product/11.2.0/dbhome_1/srvm/admin/oratab.bak.pc150 line added by Agent
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/oracle/product/11.2.0/grid:N
orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N          # line added by Agent

回答by Alex Poole

The database registers its service name(s) with the listener when it starts up. If it is unable to do so then it tries again periodically - so if the listener starts after the database then there can be a delay before the service is recognised.

数据库在启动时向侦听器注册其服务名称。如果无法这样做,则它会定期再次尝试 - 因此,如果侦听器在数据库之后启动,则在识别服务之前可能会有延迟。

If the database isn't running, though, nothing will have registered the service, so you shouldn't expect the listener to know about it - lsnrctl statusor lsnrctl serviceswon't report a service that isn't registered yet.

但是,如果数据库未运行,则不会有任何内容注册该服务,因此您不应期望侦听器知道它 -lsnrctl status或者lsnrctl services不会报告尚未注册的服务。

You can start the database up without the listener; from the Oracle account and with your ORACLE_HOME, ORACLE_SIDand PATHset you can do:

你可以在没有监听器的情况下启动数据库;从 Oracle 帐户并使用您的ORACLE_HOME,ORACLE_SIDPATHset 您可以执行以下操作:

sqlplus /nolog

Then from the SQL*Plus prompt:

然后从 SQL*Plus 提示符:

connect / as sysdba
startup

Or through the Grid infrastructure, from the grid account, use the srvctl start databasecommand:

或者通过网格基础设施,从网格帐户,使用srvctl start database命令

srvctl start database -d db_unique_name [-o start_options] [-n node_name]

You might want to look at whether the database is set to auto-start in your oratabfile, and depending on what you're using whether it should have started automatically. If you're expecting it to be running and it isn't, or you try to start it and it won't come up, then that's a whole different scenario - you'd need to look at the error messages, alert log, possibly trace files etc. to see exactly why it won't start, and if you can't figure it out, maybe ask on Database Adminsitrators rather than on Stack Overflow.

您可能想查看数据库是否在您的oratab文件中设置为自动启动,以及它是否应该自动启动取决于您使用的内容。如果您期望它正在运行但它没有运行,或者您尝试启动它但它不会出现,那么这是一个完全不同的场景 - 您需要查看错误消息,警报日志,可能是跟踪文件等,以确切了解它为什么无法启动,如果您无法弄清楚,可以询问数据库管理员而不是堆栈溢出。



If the database can't see +DATAthen ASM may not be running; you can see how to start that here; or using srvctl start asm. As the documentation says, make sure you do that from the grid home, not the database home.

如果数据库看不到,+DATA那么 ASM 可能没有运行;你可以在这里看到如何开始;或使用srvctl start asm. 正如文档所说,请确保您从网格主页而不是数据库主页执行此操作。

回答by Sherzad Zahid

for listener support no services you can use the following command to set local_listener paramter in your spfile use your listener port and server ip address

对于侦听器支持没有服务,您可以使用以下命令在 spfile 中设置 local_listener 参数,使用您的侦听器端口和服务器 IP 地址

alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.101)(PORT=1520)))' sid='testdb' scope=spfile;

更改系统设置 local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.101)(PORT=1520)))' sid='testdb' scope=spfile;

回答by saidi adda

you need to reconfigure your tnsnames.ora so that it can point to your hostname after that listener will be able to pick the new hostname. after which check the status of your listener lsnrctl status and start listener lsnrctl start then register your listener. Alter system register

您需要重新配置您的 tnsnames.ora,以便它可以在该侦听器能够选择新主机名之后指向您的主机名。之后检查您的侦听器状态 lsnrctl status 并启动侦听器 lsnrctl start 然后注册您的侦听器。修改系统寄存器

回答by Saroj Bhumbla

Check local_listener definition in your spfile or pfile. In my case, the problem was with pfile, I had moved the pfile from a similar environment and it had LISTENER_sid as LISTENER and not just LISTENER.

检查 spfile 或 pfile 中的 local_listener 定义。就我而言,问题出在 pfile 上,我已经从类似的环境中移动了 pfile,它的 LISTENER_sid 作为 LISTENER 而不仅仅是 LISTENER。

回答by Vinod Walia

You need to add your ORACLE_HOMEdefinition in your listener.ora file. Right now its not registered with any ORACLE_HOME.

您需要ORACLE_HOME在 listener.ora 文件中添加您的定义。现在它没有注册任何ORACLE_HOME.

Sample listener.ora

示例 listener.ora

abc =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = abc.kma.com)(PORT = 1521))
    )
  )

SID_LIST_abc =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /abc/DbTier/11.2.0)
      (SID_NAME = abc)
    )
  )