这篇文章主要介绍了oracle监听器启动1067错误处理的方法,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获。下面让小编带着大家一起了解一下。
1067错误的出现是因为监听文件listener.ora和tnsnames.ora里面的IP地址和本机的不一样,(网络连接的时候,地址容易发生变化),解决办法可以是修改oracle的配置文件和修改监听配置,开始—>输入Net manager打开监听配置程序。
配置主机名称(自己写的,我的配置的localhost)和端口号,然后在oracle的安装目录中(比如我的F:\oracle\product\10.2.0)中搜索文件listener.ora和tnsnames.ora文件,分别查看和修改这两个文件中的Host项(用net manager配置了主机名称和端口后,listener.ora文件中会自动改变)改为修改的主机名称:tnsnames.ora中要自己修改,好了,这会儿重启OracleOraDb10g_home1TNSListener服务就可以启动了。
启动之后,在连接时又会报出如下错误:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
这会儿是因为没有数据库名(SID),程序不能连接数据库。打开Oracle的 listener.ora 文件:原文如下
# listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
加入如下代码:
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /app/oracle/oracle/product/10.2.0/db_1)
(SID_NAME = ORCL)
)
变成:
#listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /app/oracle/oracle/product/10.2.0/db_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
然后重新启动OracleOraDb10g_home1TNSListener服务就可以了!
感谢你能够认真阅读完这篇文章,希望小编分享oracle监听器启动1067错误处理的方法内容对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,遇到问题就找亿速云,详细的解决方法等着你来学习!
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。