修改本地配置远程连接oracle数据库

Posted 街角小七

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修改本地配置远程连接oracle数据库相关的知识,希望对你有一定的参考价值。

  当我们需要查看数据库信息时,我们更愿意通过客户端来查看,这样不仅操作方便,而且查看更精准。那么需要远程连接数据库需要在本地修改那些配置呢?以下是我个人的经验,希望大家都指正。

  1、在oracle安装目录\\oracle\\product\\11.2.0\\dbhome_1\\NETWORK\\ADMIN\\tnsnames.ora文件中添加红线以下的配置,可以换行,但不能有间隔。 


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

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


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

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

YT_PX=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.41.1.21)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = matedb)
)
)

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  2、监听本地ip有两种方法

  (1)在\\oracle\\product\\11.2.0\\dbhome_1\\NETWORK\\ADMIN\\listener.ora 文件中监听本地ip                                                                                              

# listener.ora Network Configuration File: E:\\oracle\\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:\\oracle\\product\\11.2.0\\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\\oracle\\product\\11.2.0\\dbhome_1\\bin\\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E:\\oracle\\product\\11.2.0\\dbhome_1)
(SID_NAME = ORCL)
)
)

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

ADR_BASE_LISTENER = E:\\oracle

 

 

 

 

 

 

 

 

 

 

 

 

(2)在菜单栏找到Net Manager 点击进入

 

如下图添加新的监听器监听本地ip 

 

以上是关于修改本地配置远程连接oracle数据库的主要内容,如果未能解决你的问题,请参考以下文章

无法远程连接linux下的oracle,linux下的oracle可以本地访问,求解

PLSQL远程连接Oracle报连接超时,PLSQ本地连接Oracle正常时怎么回事,请大侠给说一下

plsql怎么连接远程oracle数据库

pl/sql配置连接远程数据库oracle,本地没有安装oracle数据库的情况下

cmd连接远程oracle数据库

vc 6.0连接oracle11g