gpt4 book ai didi

database - Oracle TNS 问题?

转载 作者:太空狗 更新时间:2023-10-30 01:49:45 26 4
gpt4 key购买 nike

我有错误吗?我的 pl/Sql Developer 说我的 oracle 数据库找不到服务描述符但是当我检查监听器时我得到这个错误。

LSNRCTL> start
Starting tnslsnr: please wait...

Service OracleOraDb10g_home1TNSListener already running.
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error



LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 61: Unknown error

我的listener.ora的内容是

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Oracle10g)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)
)
)

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)

和tnsnames.ora 的内容是这样的

# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.

VMOBILE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)

VMOBILEMASTER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = ORCL)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

请给我这些晚上的最后期限。请帮忙。

最佳答案

这可能是一个配置问题,这意味着我们很难远程解决。您需要检查的两件事是

  1. LISTENER.ORA 文件中的条目与您的TNSNAMES.ORA 文件匹配
  2. hosts 文件中的信息是正确的。

这是您尝试连接的本地数据库还是远程数据库?

编辑

hosts 文件(在 windows 环境下)在类似

的地方
C:\WINDOWS\system32\drivers\etc

显然这取决于您的环境设置方式(不同的驱动器号或其他)。

编辑

您需要监听器文件中的 GLOBAL_DBNAME 来匹配 tnsnsames 文件中的 SERVICE_NAME 即 ORCL

关于database - Oracle TNS 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2736377/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com