listener配置小练习

前端之家收集整理的这篇文章主要介绍了listener配置小练习前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

作业:1521 1526环境里存在一个数据库实例A实现:1521监听A数据库A数据库的信息主动注册到1526监听器上并且通过easy connect和sqlplus sys/oracle@网络服务名 as sysdba 方式验证解析:保证数据库处于open状态,数据库sid=WDD service_name=wsweididi.dba.oracle.com1 配置listener.ora,如下,lsnr1配置了1521端口是静态监听 lsnr2是1526端口是动态监听LSNR2 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1526)) ) )LSNR1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1521)) ) )SID_LIST_LSNR1= (SID_LIST= (SID_DESC= (SID_NAME=WDD) (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1) (GLOBAL_DBNAME=wsweididi.dba.oracle.com) ) )2 配置tnsnames.oraLSNR2 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.195.60)(PORT = 1526)) ) )3 此时可以启动静态监听了,如下可以看到静态监听启动成功,1521端口监听数据库WDD信息lsnrctl start lsnr1 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.195.60)(PORT=1521)))Services Summary...Service "wsweididi.dba.oracle.com" has 1 instance(s). Instance "WDD",status UNKNOWN,has 1 handler(s) for this service...The command completed successfully4 由于动态监听是从1526端口接收到的,而数据库默认不找寻找1521以外的其他端口注册数据库,除非修改了local_listener的值alter system set local_listener='LSNR2';5 启动动态监听lsnr2lsnrctl start lsnr2Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.195.60)(PORT=1526)))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",has 1 handler(s) for this service...The command completed successfully如果发现是no service状态,可以到数据库里alter system register;进行连接验证,客户端的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/oracle@WDD12 sqlplus system/oracle@WDD23 sqlplus system/oracle@172.16.195.60:1521/wsweididi.dba.oracle.com4 sqlplus system/oracle@172.16.195.60:1526/wsweididi.dba.oracle.com

猜你在找的Oracle相关文章