Oracle 19C 監聽無法動態註冊例項

chenoracle發表於2020-04-05

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",共同學習,共同成長!!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2684545/,如需轉載,請註明出處,否則將追究法律責任。

相關文章