oracle动态注册和静态注册监听器

57次阅读
没有评论

共计 1545 个字符,预计需要花费 4 分钟才能阅读完成。

自动写代码机器人,免费开通

  oracle 动态注册和静态注册的区别:动态监听不需要在 listener.ora 文件中记录关于数据的任何信息,只需要将监听器的配置信息写入到该文件。例如:

 LISTENER =
 (DESCRIPTION_LIST =
  (DESCRIPTION =
  (ADDRESS=(PROTOCOL = IPC) (KEY=EXTPRO1))
  (ADDRESS=(PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
 )

客户端的 tnsnames.ora 配置信息,需要加入每个 service_name, 其他的任何东西不需要改动,例如

 YUCESHI1 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test1)
  )
  )
YUCESHI2 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test2)
  )
  )
YUCESH3 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test3)
  )
  )

动态监听步骤:

服务器端配置如下:

设置 service_names:

  alter system  set  service_names=test1,test2,test3;

 2. 编写 listener.ora 文件:

  LISTENER =
  (DESCRIPTION_LIST =
  (DESCRIPTION =
  (ADDRESS=(PROTOCOL = IPC) (KEY=EXTPRO1))
  (ADDRESS=(PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
    )

 3. 重新启动 oracle 实例,这样做才能使 service_names 生效。(前提是 oracle 处于 open 状态下才执行)

  conn /as  sysdba;

  shutdown immediate;

  startup;

客户端配置:

 1. 编辑 tnsnames.ora, 保存后立即生效。

  YUCESHI1 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test1)
  )
  )
YUCESHI2 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test2)
  )
  )
YUCESH3 =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = test3)
  )
  )

以上动态注册配置完毕。以上改为静态注册步骤。

只需要在服务器端修改 listener.ora

 

 

向 AI 问一下细节

丸趣 TV 网 – 提供最优质的资源集合!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-12-18发表,共计1545字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)