重新启动服务器后出现ORA-12514错误

 zifei84589 发布于 2023-02-06 09:30

我在服务器上安装了oracle 11g,而.Net oracle客户端将访问数据库.
直到昨天我使用此连接字符串从客户端连接:

User ID=dbcplas;Password=pwd123;Data Source=(DESCRIPTION = (ADDRESS =(PROTOCOL = TCP)(HOST = 172.17.26.7)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl.cplas3.com)))  

直到昨天我才能在同一个客户端中使用Oracle SQL Developer.
今天早上我们重新启动服务器进行维护.重新启动服务器后,我无法从客户端.Net应用程序或sqldeveloper登录.
我能够通过sql plus服务器系统登录.
除此之外,我无法通过任何其他方式登录.
服务器端sql-developer也无法正常工作.
我从服务器上给出了以下详细信息:

lsnrctl服务:

    C:\Users\Administrator>lsnrctl services

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-JAN-2014 15:
:45

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.26.7)(PORT=1521
)
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
The command completed successfully

lsnrctl状态:

C:\Users\Administrator>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-JAN-2014 15:20
:42

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.26.7)(PORT=1521))
)
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date                07-JAN-2014 13:17:40
Uptime                    0 days 2 hr. 3 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   E:\app\administrator\product\11.2.0\dbhome_1\network\a
dmin\listener.ora
Listener Log File         e:\app\administrator\diag\tnslsnr\cplas3\listener\aler
t\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.17.26.7)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully  

LISTENER.ORA

# listener.ora Network Configuration File: E:\app\administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = E:\app\administrator\product\11.2.0)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:E:\app\administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.26.7)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = E:\app\administrator  

SQLNET.ORA

# sqlnet.ora Network Configuration File: E:\app\administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


TNSFILES.ORA

    # tnsnames.ora Network Configuration File: E:\app\administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.

    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )

    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.26.7)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl.cplas3.com)
        )
      ) 

tnsping结果 - orcl.cplas3.com

C:\Users\Administrator>tnsping orcl.cplas3.com

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-JAN-2
014 15:30:44

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
E:\app\administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

TNS-03505: Failed to resolve name

tnsping结果 - orcl

C:\Users\Administrator>tnsping orcl

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-JAN-2
014 15:31:22

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
E:\app\administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.2
6.7)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.cpl
as3.com)))
OK (1560 msec)

错误:
来自.Net应用程序:
ORA-12514 TNS:监听器当前不知道连接描述符中的服务请求.

为什么lsnrctl status不显示orcl的状态?
我尝试启动orcl服务.但它的说法已经开始..
可能是什么问题?

1 个回答
  • 从注释看来,默认local_listener参数可能是尝试使用新网络适配器中的动态IP,因此它不使用侦听器使用的相同地址.解决此问题的最简单方法可能是手动设置该参数:

    alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.26.7)(PORT=1521))' scope=memory;
    alter system register;
    

    或者我认为你可以使用更短的版本,但我现在无法验证:

    alter system set local_listener = '172.17.26.7:1521' scope=memory;
    alter system register;
    

    如果可行 - 即lsnrctl services现在显示orcl- 并且您对此感到满意,请更改memoryboth并重新执行,以便在下次数据库重新启动时保持不变.

    另一个版本是在中定义监听器tnsnames.ora,然后使用该别名作为local_listener值; 如果静态IP发生变化,这可能会更容易进行更改,因为您只需要更改listener.oratnsnames.ora(以及所有客户端),您不必直接修改数据库参数.如果你有不同的人来管理数据库和那些文件,这可能是有用的,这是不太可能的; 但可能有点整洁.

    2023-02-06 09:35 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有