theboyaply
theboyaply
发布于 2021-05-11 / 420 阅读
0
0

Oracle - tnsnames.ora和listener.ora

概述

如果修改oracle的ip地址,需要同时修改tnsnames.oralistener.ora这两个文件,并在修改后重启OracleServiceORCLOracleOraDb10g_home1TNSListener两个服务使修改生效。

文件所在位置,oracle安装目录下的:\oracle\product\10.1.0\Db_1\NETWORK\ADMIN

如果这两个文件的配置信息不正确,可能会导致oracle服务和监听服务无法启动。

tnsnames.ora

记录oracle的服务地址和服务名称

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.19.70)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

listener.ora

记录oracle监听地址

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oracle\product\10.1.0\Db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = Oracle8)
      (SID_NAME = ORCL)
    )
  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.19.70)(PORT = 1521))
  )

-- end --


评论