关闭

ORG-12514:TNS:监听进程不能解析在连接描述符中给出的SERVICE_NAME解决方案

标签: oracle
1592人阅读 评论(0) 收藏 举报
分类:

一、使用PLSQL连接ORACLE数据库时,报错信息如下:

"ORG-12514:TNS:监听进程不能解析在连接描述符中给出的SERVICE_NAME"



二、解决办法:

修改tnsnames.ora配置

如:我本地的为:

路径=D:\Program Files\oracle\Oracle9iClient\ora92\network\admin\tnsnames.ora

修改之前:

# TNSNAMES.ORA Network Configuration File: D:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

#XIEHENG_192.168.16.20 =
#  (DESCRIPTION =
#    (ADDRESS_LIST =
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.20)(PORT = 1521))
#    )
#    (CONNECT_DATA =
#      (SID = XIEHENG)
#      (SERVER = DEDICATED)
#    )
#  )

## 配置说明:
# --XIEHENG_192.168.16.20指的是网络服务名,可用SID_HOST来命名(按个人习惯)
# --HOST指Oracle服务器的机器名或IP
# --PORT指端口,默认为1521
# --XIEHENG指的是Oracle的SID
# --SERVER = DEDICATED  不用改

# 请参照以下连接的例子

XIEHENG_192.168.16.20 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.20)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = XIEHENG)
      (SERVER = DEDICATED)
    )
  )

GCBORA_192.168.1.3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = GCBORA)
      (SERVER = DEDICATED)
    )
  )

修改之后:

# TNSNAMES.ORA Network Configuration File: D:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

#XIEHENG_192.168.16.20 =
#  (DESCRIPTION =
#    (ADDRESS_LIST =
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.20)(PORT = 1521))
#    )
#    (CONNECT_DATA =
#      (SID = XIEHENG)
#      (SERVER = DEDICATED)
#    )
#  )

## 配置说明:
# --XIEHENG_192.168.16.20指的是网络服务名,可用SID_HOST来命名(按个人习惯)
# --HOST指Oracle服务器的机器名或IP
# --PORT指端口,默认为1521
# --XIEHENG指的是Oracle的SID
# --SERVER = DEDICATED  不用改

# 请参照以下连接的例子

222.222.222.222 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 222.222.222.222)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
  
rddb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 主机地址)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

REMOTE153 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 主机地址)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )

重启PLSQL:

选择相应的数据库,输入用户名和密码即可!


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:439521次
    • 积分:5308
    • 等级:
    • 排名:第5370名
    • 原创:160篇
    • 转载:203篇
    • 译文:0篇
    • 评论:26条
    最新评论