listener 配置小练习之方法二

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了listener 配置小练习之方法二相关的知识,希望对你有一定的参考价值。



作业:1521 1526
环境里存在一个数据库实例A

实现:
1521监听A数据库
A数据库的信息主动注册到1526监听器上
并且通过easy connect和sqlplus sys/[email protected]网络服务名 as sysdba 方式验证

下面我想用另一种方式来实现:数据库WDD都是动态向1521  1526注册数据库
1 编辑listener.ora配置文件
LSNR2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1526))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1521))
    )
  )

2 编辑tnsnames.ora配置文件
LSNR2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1526))
    )
  )

3 数据库设置local_listener
alter system set local_listener=‘LSNR2‘;这里的LSNR2跟tnsnames里的名字是相同的
4 启动监听
lsnrctl start lsnr2
如果看到如下信息,证明配置正确
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.195.60)(PORT=1526)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.195.60)(PORT=1521)))
Services Summary...
Service "WDDXDB.dba.oracle.com" has 1 instance(s).
  Instance "WDD", status READY, has 1 handler(s) for this service...
Service "wsweididi.dba.oracle.com" has 1 instance(s).
  Instance "WDD", status READY, has 1 handler(s) for this service...
The command completed successfully
5 客户端验证
客户端tnsnames配置文件
WDD1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = wsweididi.dba.oracle.com)
    )
  )


 
WDD2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1526))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = wsweididi.dba.oracle.com)
    )
  )
验证
1 sqlplus system/[email protected]
2 sqlplus system/[email protected]
3 sqlplus system/[email protected]:1521/wsweididi.dba.oracle.com
4 sqlplus system/[email protected]:1526/wsweididi.dba.oracle.com



以上是关于listener 配置小练习之方法二的主要内容,如果未能解决你的问题,请参考以下文章

python练习题返回列表中的第二小的元素的下标

递归小练

listener配置小练习

方法使用小练

nginx学习之——虚拟主机配置

javaWeb学习之Listener监听