天天看點

使用lsnrctl status指令區分動态注冊,靜态注冊

unknow:靜态注冊

ready或blocked:動态注冊

a、如果先啟動監聽,後啟動資料庫

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "orcl" has 2 instance(s).

  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

從顯示資訊可以看出這種情況下既有動态注冊又有靜态注冊

 (Service "PLSExtProc" 是在 listener.ora 檔案中為資料庫執行個體預設配置的,允許PL/SQL包通路外部程式;

    Service "orcl" 也是在 listener.ora 檔案中配置,是每個資料庫連接配接使用的标準模式;

    Service "orclXDB" 是Oracle 9i以後版本建立資料庫時預設包含的XML DB特性,提供http、ftp等服務,在初始化文spfile(或pfile)中定義)

b、重新開機監聽

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service..

Service "orcl" has 1 instance(s).

  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

Service "orcl1" has 1 instance(s).

  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

從顯示資訊可以看出這種情況下動态注冊監聽失敗

c、删除listener.ora,重新開機監聽

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MICROSOF-3033D5)(PORT=1521)))

The listener supports no services

The command completed successfully

從顯示資訊可以看出這種情況下動态注冊監聽和靜态注冊監聽都失敗

等待片刻(1min)。。。。

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

從顯示資訊可以看出這種情況下動态注冊監聽成功,pomn定時向監聽器注冊

d、修改listener.ora為SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (PROGRAM = extproc)

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = D:\oradata\orcl)

    )

  )重新開機監聽

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

從顯示資訊可以看出這種情況下動态注冊監聽失敗,靜态注冊資料庫執行個體失敗

等待片刻(1min)。。。。

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

從顯示資訊可以看出這種情況下動态注冊監聽成功,pomn定時向監聽器注冊

總結

重新開機監聽并不一定都造成動态注冊監聽的失敗:如果listener.ora檔案被删除時,這種現象隻是暫時的,oracle中pmon程序會定時像監聽器動态注冊(個人觀點)