温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-10-21 13:31:14 来源:网络 阅读:279 作者:yujianglei 栏目:关系型数据库

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


动态监听步骤:

服务器端配置如下:

  1. 设置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问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI