Oracle 19C 监听无法动态注册实例
环境:
DB:Oracle 19.3.0.0.0
OS:Red Hat Enterprise Linux Server release 7.5 (Maipo)
问题:
Oracle 19C数据库,将主机名由CJCDB修改为CJCOS01,同时修改了listener.ora中主机名信息,但是监听还是无法注册实例。
[oracle@cjcos01 admin]$ pwd
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin
[oracle@cjcos01 admin]$ cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = cjcos01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
问题现象:
[oracle@cjcos01 admin]$ lsnrctl status
......
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cjcos01)(PORT=1521)))
The listener supports no services
The command completed successfully
解决方案:
尝试添加静态监听
[oracle@cjcos01 admin]$ pwd
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin
[oracle@cjcos01 admin]$ cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = cjcdb)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
(SID_NAME = cjcdb)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = cjcos01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
可以静态注册实例了
[oracle@cjcos01 admin]$ lsnrctl status
......
Services Summary...
Service "cjcdb" has 1 instance(s).
Instance "cjcdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
为什么监听可以静态注册实例,不能动态注册实例呢?
可能和local_listener参数有关。
SQL> show parameter local_listener
NAME
TYPE
VALUE
------------------------------------ ----------- ------------------------------
local_listener
string
LISTENER_CJCDB
查看tnsnames.ora中有关LISTENER_CJCDB信息,发现对应的HOST也已经修改过了。
[oracle@cjcos01 admin]$ cat tnsnames.ora
LISTENER_CJCDB =
(ADDRESS = (PROTOCOL = TCP)(HOST =
cjcos01)(PORT = 1521))
由于监听
使用默认的
1521端口,可以将local_listener重置回之前的默认值,即空值。
SQL> alter system set local_listener='';
System altered.
手动注册
SQL> alter system register;
System altered.
监听可以动态注册实例了
[oracle@cjcos01 admin]$ lsnrctl status
......
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cjcos01)(PORT=1521)))
Services Summary...
Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
Instance "cjcdb", status READY, has 1 handler(s) for this service...
Service "9cf4e5aa850e36efe0550e07b87b792a" has 1 instance(s).
Instance "cjcdb", status READY, has 1 handler(s) for this service...
Service "cjcdb" has 2 instance(s).
Instance "cjcdb", status UNKNOWN, has 1 handler(s) for this service...
Instance "cjcdb", status READY, has 1 handler(s) for this service...
Service "cjcdbXDB" has 1 instance(s).
Instance "cjcdb", status READY, has 1 handler(s) for this service...
Service "cjcpdb" has 1 instance(s).
Instance "cjcdb", status READY, has 1 handler(s) for this service...
The command completed successfully
欢迎关注我的微信公众号"IT小Chen",共同学习,共同成长!!!