首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

oracle连接出现ora-12154,与虚拟机Oracle连接出现ora-12154问题的解决方法

谈到ora-12154问题,网上有一大堆解决方法,原因基本统一:tns或listener配置不正确。对于listener配置不正确的一般较少发生,大多数人都是按照默认配置一路“下一步”过来的,基本都是orcl的服务名,如果说本地可以连通orcl,别的机子就连不通那应该跟listener关系不大。大部分都是tns配置不正确。我遇到的现象是:在本机建了一个2003的虚拟机,虚拟机里面装了oracle10g,默认配置。本机只装了oracle10g的客户端,当我以前用本机连接局域网内数据库的orcl服务(数据库与局域网内数据库一样)时没有问题,但是在连接虚拟机中的orcl服务却连不通,总是报ora-12154错误。而虚拟机内,plsql却可以连接虚拟机oracle,但是不能连接本机所在局域网内的oracle。

02

一次访问问题排查-涉及TNS-03505、ORA-12154、TNS-12560、动态注册、防火墙、tnsping跟踪等

建了一个库,想通过Oracle Net访问,需要配置监听器和tnsnames.ora,接下来碰到一系列的问题。。。 1. 添加监听器配置,listener.ora文件默认包括: LISTENER =   (DESCRIPTION_LIST =     (DESCRIPTION =       (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))     )   ) ADR_BASE_LISTENER = /opt/app/ora11g 为了新建监听器名称,添加如下: DCSOPEN =   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.101.19.57)(Port = 1521))) 或 DCSOPEN =   (DESCRIPTION_LIST =     (DESCRIPTION =       (ADDRESS = (PROTOCOL = TCP)(HOST = dcsopen2Node)(PORT = 1521))     )   ) ADR_BASE_DCSOPEN = /opt/app/ora11g 或 DCSOPEN =   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.101.19.57)(Port = 1521))) SID_LIST_DCSOPEN =   (SID_LIST =     (SID_DESC =       (SID_NAME = PLSExtProc)       (ORACLE_HOME = /opt/app/ora11g/product/11.2.0/dcsopen)       (PROGRAM = extproc)     )     (SID_DESC =       (GLOBAL_DBNAME = dcsopen)       (ORACLE_HOME = /opt/app/ora11g/product/11.2.0/dcsopen)       (SID_NAME = dcsopen)     )   ) ADR_BASE_DCSOPEN = /opt/app/ora11g 或 DCSOPEN =   (DESCRIPTION_LIST =     (DESCRIPTION =       (ADDRESS_LIST =         (ADDRESS = (PROTOCOL = TCP)(HOST = 172.101.19.57)(PORT = 1521))       )       (ADDRESS_LIST =         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))       )     )   ) SID_LIST_DCSOPEN =   (SID_LIST =     (SID_DESC =       (SID_NAME = PLSExtProc)       (ORACLE_HOME = /opt/app/ora11g/product/11.2.0/dcsopen)       (PROGRAM = extproc)     )   ) ADR_BASE_DCSOPEN = /opt/app/ora11g 2. 添加本机的tnsnames.ora文件配置: dcsopen =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.101.19.57)(PORT = 1521))     )     (CONNECT_DATA =       (SERVICE_NAME = dcsopen)     )   ) 3. 使用tnsping dcsopen测试,报错: ora11g>tnsping dcsopen TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 08-JAN-2015 00:38:55 Copyright (c) 1997, 2009, Oracle.  All rights reserved. Used parameter files: /opt/app/ora11g/product/11.2.0/dcsopen/network/admin/sqlnet.ora TNS-03505: Failed to resolve name 4. 使用sqlplus登

03
领券