oracle - 监听器不支持任何服务

标签 oracle oracle11g

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

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

我的 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

我的 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)
    )
  )

输入时 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

输入时 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

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

我的 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

最佳答案

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

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

你可以在没有监听器的情况下启动数据库;来自 Oracle 帐户和您的 ORACLE_HOME , ORACLE_SIDPATH设置你可以做:

sqlplus /nolog

然后从 SQL*Plus 提示符:
connect / as sysdba
startup

或者通过网格基础设施,从网格帐户,使用 srvctl start database command :
srvctl start database -d db_unique_name [-o start_options] [-n node_name]

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

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

关于oracle - 监听器不支持任何服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24857858/

相关文章:

java - 为什么 Hibernate 转而使用 LONG 而不是 CLOB?

nhibernate - LINQ-to-NHibernate 中不区分大小写的Where 子句如何与Oracle 提供程序一起使用?

java - 从匿名 pl/sql 获取 varchar 数组时出现 "ORA-03115: unsupported network datatype or representation"错误

mysql - 多设备间数据同步

Java 神谕搜索

sql - 在 PL/SQL 中将绑定(bind)变量与动态 SELECT INTO 子句结合使用

sql - 比较 Oracle 11g 中 2 个不同行的 2 个不同列

sql - 在 group by 子句中使用 min 和 max

sql - 分层查询 : from dual is ok, 但来自物理表的是 "ORA-01436"

oracle - 如何打破触发事件?