Oracle 11g RAC环境下单实例非缺省监听及端口配置(四)
x1.orasrv.com)(PORT = 1523))
)
(CONNECT_DATA =
(SERVICE_NAME = cnbo.orasrv.com)
)
)
--启动新的监听器
[oracle@linux1 ~]$ lsnrctl start LISTENER_NEW
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-AUG-2013 16:02:14
................
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux1.orasrv.com)(PORT=1523)))
Services Summary...
Service "cnbo.orasrv.com" has 1 instance(s).
Instance "cnbo", status UNKNOWN, has 1 handler(s) for this service... --注意状态为UNKNOWN,表明是静态注册
The command completed successfully
--我们看看grid用户缺省监听的状态,此时实例cnbo依旧被注册
[grid@linux1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-AUG-2013 15:55:33
..........
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.21)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.31)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "cnbo.orasrv.com" has 1 instance(s).
Instance "cnbo", status READY, has 1 handler(s) for this service...
Service "cnboXDB.orasrv.com" has 1 instance(s).
Instance "cnbo", status READY, has 1 handler(s) for this service...
The command completed successfully
--下面检查一下local_listener参数
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
db_name string cnbo
SQL> show parameter local_lis -->
参数没有做任何设置
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener string
--从上面的情形来看,尽管没有设置local_listener参数,此时实例依旧被注册到监听
--在此时我们已经可以通过tnsnames连接到数据库,也就是说客户端发起的连接最终还是通过监听器LISTENER_NEW,而不是缺省的监听器
--对于这个情形在非RAC环境的Oracle 10g,11g 可以不用设置local_listener,也不会注册到缺省监听器
--但grid用户下的缺省监听器提供的cnbo服务着实别扭,下面为还是添加监听器信息到tnsnames.ora
[oracle@linux1 ~]$ echo "
> LISTENER_NEW =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = linux1.orasrv.com)(PORT = 1523))
> )">>$ORACLE_HOME/network/admin/tnsnames.ora
-->设置local_listener
SQL> alter system set local_listener='LISTENER_NEW';
--下面的缺省监听状态下不再看到cnbo实例
[grid@linux1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-AUG-2013 16:06:38
.........
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.21)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.31)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
The command completed successfully
4、后记
a、在Oracle 11g RAC环境下使用dbca创建单实例数据库会