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)
    )
  )

改完配置并启动。

相关推荐
侧耳倾听111几秒前
使用内存数据库来为mapper层的接口编写单元测试
数据库·单元测试
ifanatic18 分钟前
[每周一更]-(第138期):MySQL 子查询详解:原理、应用及优化方案
数据库·mysql
TDengine (老段)34 分钟前
TDengine 中的日志系统
java·大数据·数据库·物联网·时序数据库·tdengine·iotdb
kfepiza1 小时前
Debian编译安装mysql8.0.41源码包 笔记250401
数据库·笔记·mysql·debian·database
tjfsuxyy1 小时前
SqlServer整库迁移至Oracle
数据库·oracle·sqlserver
老王笔记2 小时前
MySQL统计信息
数据库·mysql
无名之逆2 小时前
[特殊字符] Hyperlane 框架:高性能、灵活、易用的 Rust 微服务解决方案
运维·服务器·开发语言·数据库·后端·微服务·rust
爱的叹息3 小时前
MongoDB 的详细解析,涵盖其核心概念、架构、功能、操作及应用场景
数据库·mongodb·架构
爱的叹息3 小时前
华为高斯(GaussDB)数据库中 Range、List、Hash三种分区方式 的完整SQL示例及增删改查操作,并附上总结对比表格
数据库·哈希算法·gaussdb