首先找到你的oracle安装目录,在此目录下找:
oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
我们需要在此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)
)
)
ORCL3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.61.1.21)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = matedb)
)
)
ORCL3 是我所添加的配置,hos=”远程地址链接“,port=”端口号“,默认1521