ORACLE 多实例监听的配置

多实例监听的配置

三种情况:

1、一个监听在一个IP一个端口上监听多个实例

2、一个监听在一个IP不同端口上监听多个实例

3、多个监听监听多个实例

情况1:

listener.ora文件:

sql 复制代码
# listener.ora Network Configuration File: E:\app\product.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_ORCL =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (SID_NAME = ORCL)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = NHL)
      (SID_NAME = NHL)
    )
  )
ORCL =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
  )

tnsnames.ora文件:

sql 复制代码
# tnsnames.ora Network Configuration File: E:\app\product.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
NHL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = NHL)
    )
  )
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

情况2:

listener.ora文件:

sql 复制代码
# listener.ora Network Configuration File: E:\app\product.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_ORCL =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (SID_NAME = ORCL)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = NHL)
      (SID_NAME = NHL)
    )
  )
ORCL =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1522))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
  )

tnsnames.ora文件:

sql 复制代码
# tnsnames.ora Network Configuration File: E:\app\product.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
NHL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = NHL)
    )
  )
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

情况3:

listener.ora文件:

sql 复制代码
# listener.ora Network Configuration File: E:\app\product.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_ORCL =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (SID_NAME = ORCL)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = NHL)
      (SID_NAME = NHL)
    )
  )
SID_LIST_TEST =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = TEST)
      (SID_NAME = TEST)
    )
)
ORCL =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
  )
TEST =
   (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1523))
    )

tnsnames.ora文件:

sql 复制代码
# tnsnames.ora Network Configuration File: E:\app\product.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
NHL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = NHL)
    )
  )
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
TEST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

改完配置并启动。

相关推荐
师太,答应老衲吧33 分钟前
SQL实战训练之,力扣:2020. 无流量的帐户数(递归)
数据库·sql·leetcode
Channing Lewis2 小时前
salesforce case可以新建一个roll up 字段,统计出这个case下的email数量吗
数据库·salesforce
毕业设计制作和分享3 小时前
ssm《数据库系统原理》课程平台的设计与实现+vue
前端·数据库·vue.js·oracle·mybatis
ketil273 小时前
Redis - String 字符串
数据库·redis·缓存
Hsu_kk4 小时前
MySQL 批量删除海量数据的几种方法
数据库·mysql
编程学无止境4 小时前
第02章 MySQL环境搭建
数据库·mysql
knight-n4 小时前
MYSQL库的操作
数据库·mysql
包饭厅咸鱼5 小时前
QML----复制指定下标的ListModel数据
开发语言·数据库
生命几十年3万天5 小时前
redis时间优化
数据库·redis·缓存
Elastic 中国社区官方博客5 小时前
释放专利力量:Patently 如何利用向量搜索和 NLP 简化协作
大数据·数据库·人工智能·elasticsearch·搜索引擎·自然语言处理