Oracle動態監聽註冊測試

jqs發表於2008-04-18

1.把listener.ora 刪除會有什麼後果?

2.ORA-12514:TNS:監聽程式當前無法識別連線描述中請求的服務是怎麼回事?

[@more@]
資料庫版本:Oracle10.2.0.1
埠:1521
刪除listener.ora
啟動監聽
$ lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:49:31
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/oracle/db/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Log messages written to /u01/oracle/db/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully
啟動正常,但告訴你沒有services
$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:49:36
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully
檢視狀態也是,提示沒有services
此時如果透過client端連線資料庫會有如下的錯誤提示:
ORA-12514:TNS:監聽程式當前無法識別連線描述中請求的服務
大約1分鐘後,檢視監聽狀態
$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:51:13
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 1 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
Services Summary...
Service "MDDJ" has 1 instance(s).
Instance "MDDJ", status READY, has 1 handler(s) for this service...
Service "MDDJ_XPT" has 1 instance(s).
Instance "MDDJ", status READY, has 1 handler(s) for this service...
Service "mdzj" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...
Service "mdzjXDB" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...
Service "mdzj_XPT" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...

The command completed successfully
測試連線,發現連線正常。
檢視資料庫中的local_listener與remote_listener
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
remote_listener string
SQL>
============================
動態監聽註冊
    1.不是透過listener.ora檔案的,
    2.是透過PMON程式自動進行的,所以前面有一定時間的延遲,才能使用
3.如果是非預設埠,必須設定local_listener
============================

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

相關文章