建立資料庫連線失敗ORA-12514的分析解決過程
平臺:
OS:CentOS release 6.5 (Final)
DB:oracle 12.1.0
SQL*Plus: Release 12.1.0.2.0 Production on Sat Dec 3 17:51:59 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
12514, 00000, "TNS:listener does not currently know of service requested in connect descriptor"
// *Cause: The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a service name for a service (usually a database service)
// that either has not yet dynamically registered with the listener or has
// not been statically configured for the listener. This may be a temporary
// condition such as after the listener has started, but before the database
// instance has registered with the listener.
// *Action:
// - Wait a moment and try to connect a second time.
// - Check which services are currently known by the listener by executing:
// lsnrctl services <listener name>
// - Check that the SERVICE_NAME parameter in the connect descriptor of the
// net service name used specifies a service known by the listener.
// - If an easy connect naming connect identifier was used, check that
// the service name specified is a service known by the listener.
// - Check for an event in the listener.log file.
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 17:49:18
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 03-DEC-2016 17:30:28
Uptime 0 days 0 hr. 18 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
2)對比另一臺裝有oracle資料庫的host2上的lsnrctl的資訊
3)是否是因為我先建立(且啟動了)的listener,後建立的DB例項,導致資料庫例項沒有被註冊到監聽
參考了http://blog.itpub.net/24492954/viewspace-765551/
新增了DataBase Service後,重啟:
4)透過alter system register來臨時註冊服務
5)刪掉netmgr靜態註冊的Database Service。重啟監聽。再手動alter system register註冊
lsnrctl stop
lsnrctl start
6)檢視日誌來定位
重啟tnslsnr之前,刪除log.xml
重啟tnslsnr之前,刪除listener.log
並無進展
7)對比host2和host3
發現host2多一個sqlnet.ora檔案
[laolv@centhost2 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
新增sqlnet.ora到host3也不起作用,因為sqlnet.ora是為客戶端服務的/置於客戶機的,並不是為listener程式所用。
8)Oracle監聽器無法動態註冊例項的服務
參考
http://blog.csdn.net/weiwangsisoftstone/article/details/38082487
http://www.itpub.net/thread-1921723-1-1.html 帖子:個人懷疑計算機名為localhost時只能動態註冊到127.0.0.1的ip上面,所以導致上面監聽配置檔案中10.98.0.122時獲取不到動態註冊,為了驗證這個想法,個人修改了計算機名,再修改hosts檔案後重啟計算機後動態註冊已經有了,為了驗證這個問題,有時間個人再把計算機名重新改回localhost再驗證下.
在http://blog.csdn.net/weiwangsisoftstone/article/details/38082487中有檢測/etc/hosts,我懷疑是(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.147)(PORT = 1521))中的HOST應該使用機器名而不能使用IP
lsnrctl stop
lsnrctl start
[laolv@centhost3 admin]$ lsnrctl status
-------------------------------------------------------點到此位置,以下為可選內容------------------------------------------------------------------
9)分析host=centos3行,host=192.168.1.147 不行的原因
參考“監聽器trace file中”,我設定成host=192.168.1.147,檢視listener.log和trace日誌、tracsst分析trace後得到的資訊,依舊沒定位出原因。
·反向思維:既然知道“host=centos3行”,那就設定成host=centos3,lsnrctl reload一下,檢視trace日誌和使用tracsst分析一下trace日誌。
tailf ora_20228**.trc:
2016-12-04 11:24:53.717415 : nlstdtp_trace_pfile: -> PARAMETER TABLE LOAD RESULTS FOLLOW <-
2016-12-04 11:24:53.717545 : nlstdtp_trace_pfile:Successful parameter table load
2016-12-04 11:24:53.717608 : nlstddp_dump_ptable: -> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-
2016-12-04 11:24:53.717656 : nlstddp_dump_ptable: LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = centhost3)(PORT = 1521))) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
2016-12-04 11:24:53.717715 : nlstddp_dump_ptable: ADR_BASE_LISTENER = /opt/oracle
2016-12-04 11:24:53.717767 : nlstddp_dump_ptable: TRACE_LEVEL_LISTENER = 16
2016-12-04 11:24:53.717819 : nlstddp_dump_ptable: TRACE_TIMESTAMP_LISTENER = true
2016-12-04 11:24:53.717909 : nlstdtp_trace_pfile:--- PARAMETER SOURCE INFORMATION ENDS ---
2016-12-04 11:24:53.718027 : nsglldsec:entry
2016-12-04 11:24:53.718274 : nsglldsec:exit
TNSLSNR for Linux: Version 12.1.0.2.0 - Production on 04-DEC-2016 11:24:53
Copyright (c) 1991, 2014, Oracle. All rights reserved.
2016-12-04 11:24:53.719602 : nlstddt_do_alter_trace:--- TRACE CONFIGURATION INFORMATION FOLLOWS ---
2016-12-04 11:24:53.719663 : nlstddt_do_alter_trace:New trace stream is /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_20228_139696976258496.trc
2016-12-04 11:24:53.719722 : nlstddt_do_alter_trace:New trace level is 16
2016-12-04 11:24:53.719772 : nlstddt_do_alter_trace:--- TRACE CONFIGURATION INFORMATION ENDS ---
2016-12-04 11:24:53.720559 : nlstddl_do_alter_log:--- LOG CONFIGURATION INFORMATION FOLLOWS ---
2016-12-04 11:24:53.720693 : nlstddl_do_alter_log:Existing log stream is identical to desired "/opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml"; ignoring alter
2016-12-04 11:24:53.720750 : nlstddl_do_alter_log:--- LOG CONFIGURATION INFORMATION ENDS ---
reload後還是The listener supports no services (alter system register後也是The listener supports no services)
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 09:58:53
Uptime 0 days 1 hr. 35 min. 17 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_20228_139696976258496.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
·那就重啟:
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
The command completed successfully
LSNRCTL> start
Starting /opt/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 11:37:04
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 11:37:04
Uptime 0 days 0 hr. 0 min. 55 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orclrman" has 1 instance(s).
Instance "orclrman", status READY, has 1 handler(s) for this service...
Service "orclrmanXDB" has 1 instance(s).
Instance "orclrman", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
取listener.log、ora_22421_140508226909632.trc、 ora_22421_140508226909632.trm到本地再分析
[laolv@centhost3 trc]$ trcasst ora_22421_140508226909632.trc > ora_22421_140508226909632.trcasst
host=192.168.1.147 ,host=centhost3 的前後trcasst 分析資訊
2016-12-04 11:37:16.104003 : nsglgrDoRegister:Creating new instance: "orclrman".
2016-12-04 11:37:16.104032 : nscontrol:entry
2016-12-04 11:37:16.104046 : nttctl:entry
2016-12-04 11:37:16.104059 : nscontrol:cmd=7, lcl=0x0
2016-12-04 11:37:16.104070 : nscontrol:normal exit
2016-12-04 11:37:16.104102 : nsglgrDoRegister:inst loads: ld1:0 mld1:10240 ld2:1 mld2:472
2016-12-04 11:37:16.104115 : nsglgrDoRegister:instance flags - req:0 cur:16
2016-12-04 11:37:16.104162 : nsglgrDoRegister:Creating new service: "orclrmanXDB".
2016-12-04 11:37:16.104182 : nsglgrDoRegister:service:orclrmanXDB flag:3 goodness:0 delta:1
2016-12-04 11:37:16.104219 : nsglgrDoRegister:Creating new service: "orclrman".
2016-12-04 11:37:16.104233 : nsglgrDoRegister:service:orclrman flag:2 goodness:0 delta:1
2016-12-04 11:37:16.104260 : nsglegln:entry
2016-12-04 11:37:16.104280 : snlinGetAddrInfo:entry
2016-12-04 11:37:16.104400 : snlinGetAddrInfo:getaddrinfo() failed with error -2
2016-12-04 11:37:16.104419 : snlinGetAddrInfo:exit
2016-12-04 11:37:16.104430 : snlinGetAddrInfo:entry
2016-12-04 11:37:16.104517 : snlinGetAddrInfo:exit
2016-12-04 11:37:16.104540 : snlinGetAddrInfo:entry
……
2016-12-04 11:37:16.104996 : snlinFreeAddrInfo:entry
2016-12-04 11:37:16.105015 : snlinFreeAddrInfo:exit
2016-12-04 11:37:16.105030 : nsglegln:exit
2016-12-04 11:37:16.105044 : nsglgrDoRegister:Creating new endpoint: "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))".
2016-12-04 11:37:16.105056 : nladini:entry
2016-12-04 11:37:16.105094 : nladini:exit
2016-12-04 11:37:16.105112 : nladget:entry
…
2016-12-04 11:37:16.106259 : nsglvldyl:Dynamic loading of valid node list successful
2016-12-04 11:37:16.106270 : nsglvldyl:exit
2016-12-04 11:37:16.106282 : nsgllsn:LSNDSC==>(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
2016-12-04 11:37:16.106293 : nsglhcrt:entry
2016-12-04 11:37:16.106349 : nsglhcrt:exit
2016-12-04 11:37:16.106366 : nsglbgetRSPidx:entry
2016-12-04 11:37:16.106377 : nladini:entry
……
2016-12-04 11:37:16.106572 : nsc2addr:entry
2016-12-04 11:37:16.106583 : nsc2addr:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
2016-12-04 11:37:16.106641 : ntzini:entry
2016-12-04 11:37:16.106699 : ntzSetupConnection:entry
* Trace Assistant *
*************************************************************************
<--- Received 204 bytes - Connect packet timestamp=016-12-04 11:37:04.990220
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Maximum SDU size: 8192
Maximum TDU size: 4096
NT protocol characteristics:
Test for more data
Spawner is running
Hang on to Listener connection
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 134
Connect data offset: 70
Connect data maximum size: 2048
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/oracle/product/12.1.0/dbhome_1/bi
n/tnslsnr)(ENVS=)(ARGV0=)(ARGS='LISTENER,-inherit')(DETACH=yes))
---> Send 2686976 bytes - Accept packet timestamp=016-12-04 11:37:05.214508
Accepted NS version number is: 315.
Accepted maximum SDU size: 8192
Accepted maximum TDU size: 4096
Connect data length: 480
Connect data offset: 41
Native Services wanted
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
Packet data is in the following data packet
---> Send 490 bytes - Data packet timestamp=016-12-04 11:37:05.215613
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/a
dmin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/al
ert/log.xml
Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listen
er/trace/ora_22421_140508226909632.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(POR
T=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
<--- Received 210 bytes - Connect packet timestamp=016-12-04 11:37:05.225394
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Global options for the connection:
Don't care
Maximum SDU size: 8192
Maximum TDU size: 2097152
NT protocol characteristics:
Test for more data
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Generate SIGPIPE signal
Generate SIGIO signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 140
Connect data offset: 70
Connect data maximum size: 2040
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
(DESCRIPTION=(CONNECT_DATA=(CID=(PROGRAM=)(HOST=centhost3)(USER=laolv)
)(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=202375680)))
<--- Received 116 bytes - Connect packet timestamp=016-12-04 11:37:16.088274
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Maximum SDU size: 8192
Maximum TDU size: 2097152
NT protocol characteristics:
Test for more data
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Generate SIGPIPE signal
Generate SIGIO signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 46
Connect data offset: 70
Connect data maximum size: 0
(CONNECT_DATA=(COMMAND=service_register_NSGR))
我認為:pmon向監聽器註冊服務時,是基於hostname來尋找監聽器的,而不是IP(可能會把IP錯認為hostname)
OS:CentOS release 6.5 (Final)
DB:oracle 12.1.0
- 1. 建立資料庫連線失敗
SQL*Plus: Release 12.1.0.2.0 Production on Sat Dec 3 17:51:59 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
- 2. 檢視失敗原因
12514, 00000, "TNS:listener does not currently know of service requested in connect descriptor"
// *Cause: The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a service name for a service (usually a database service)
// that either has not yet dynamically registered with the listener or has
// not been statically configured for the listener. This may be a temporary
// condition such as after the listener has started, but before the database
// instance has registered with the listener.
// *Action:
// - Wait a moment and try to connect a second time.
// - Check which services are currently known by the listener by executing:
// lsnrctl services <listener name>
// - Check that the SERVICE_NAME parameter in the connect descriptor of the
// net service name used specifies a service known by the listener.
// - If an easy connect naming connect identifier was used, check that
// the service name specified is a service known by the listener.
// - Check for an event in the listener.log file.
- 3. 檢查listener 狀態
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 17:49:18
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 03-DEC-2016 17:30:28
Uptime 0 days 0 hr. 18 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
- 4. 定位解決過程
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ lsnrctl services
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 17:49:25
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
The listener supports no services
-
The command completed successfully
-
[laolv@centhost3 admin]$ vi listener.ora
-
[laolv@centhost3 admin]$ lsnrctl services LISTENER
-
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 17:50:54
-
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
The listener supports no services
-
The command completed successfully
- [laolv@centhost3 admin]$
點選(此處)摺疊或開啟
-
[laolv@centhost2 admin]$ lsnrctl status
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 18:40:12
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
Start Date 22-NOV-2016 06:09:22
-
Uptime 11 days 12 hr. 30 min. 50 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Listener Log File /opt/oracle/diag/tnslsnr/centhost2/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost2)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
-
Services Summary...
-
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...
-
Service "pdborcl" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
-
The command completed successfully
- [laolv@centhost2 admin]$
3)是否是因為我先建立(且啟動了)的listener,後建立的DB例項,導致資料庫例項沒有被註冊到監聽
參考了http://blog.itpub.net/24492954/viewspace-765551/
新增了DataBase Service後,重啟:
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ lsnrctl stop
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 19:01:36
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
The command completed successfully
-
[laolv@centhost3 admin]$ lsnrctl start
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 19:01:42
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
Starting /opt/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait...
-
-
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
Start Date 03-DEC-2016 19:01:42
-
Uptime 0 days 0 hr. 0 min. 0 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
Services Summary...
-
Service "ORCLRMAN" has 1 instance(s).
-
Instance "ORCLRMAN", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
4)透過alter system register來臨時註冊服務
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 12.1.0.2.0 Production on Sat Dec 3 19:14:37 2016
-
-
Copyright (c) 1982, 2014, Oracle. All rights reserved.
-
Connected to:
-
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
-
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
-
-
SQL> show parameter service_names;
-
-
NAME TYPE VALUE
-
------------------------------------ ----------- ------------------------------
-
service_names string orclrman
-
SQL> alter system register;
-
-
-
System altered.
-
-
-
SQL> exit
-
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
-
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
-
-
-
[laolv@centhost3 admin]$ lsnrctl status
-
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 19:16:27
-
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
Start Date 03-DEC-2016 19:01:42
-
Uptime 0 days 0 hr. 14 min. 45 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
Services Summary...
-
Service "ORCLRMAN" has 1 instance(s).
-
Instance "ORCLRMAN", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
lsnrctl stop
lsnrctl start
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 12.1.0.2.0 Production on Sat Dec 3 19:14:37 2016
-
-
Copyright (c) 1982, 2014, Oracle. All rights reserved.
-
Connected to:
-
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
-
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
-
-
SQL> show parameter service_names;
-
-
NAME TYPE VALUE
-
------------------------------------ ----------- ------------------------------
-
service_names string orclrman
-
SQL> alter system register;
-
-
-
System altered.
-
-
-
SQL> exit
-
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
-
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
-
-
-
[laolv@centhost3 admin]$ lsnrctl status
-
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 19:16:27
-
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
Start Date 03-DEC-2016 19:01:42
-
Uptime 0 days 0 hr. 14 min. 45 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
Services Summary...
-
Service "ORCLRMAN" has 1 instance(s).
-
Instance "ORCLRMAN", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
6)檢視日誌來定位
重啟tnslsnr之前,刪除log.xml
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ cat /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
<msg time='2016-12-03T19:32:21.387+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147' version='1'>
-
<txt>System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.388+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.388+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_6744_139683398370752.trc
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.388+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Trace level is currently 0
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.388+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.389+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Started with pid=6744
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.391+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.392+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.402+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>
-
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.405+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>WARNING: Subscription for node down event still pending
-
</txt>
-
</msg>
-
<msg time='2016-12-03T19:32:21.405+08:00' org_id='oracle' comp_id='tnslsnr'
-
type='UNKNOWN' level='16' host_id='centhost3'
-
host_addr='192.168.1.147'>
-
<txt>03-DEC-2016 19:32:21 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=centhost3)(USER=laolv))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=202375680)) * status * 0
-
</txt>
-
</msg>
- [laolv@centhost3 admin]$
點選(此處)摺疊或開啟
-
[laolv@centhost3 alert]$ cat /opt/oracle/diag/tnslsnr/centhost3/listener/trace/listener.log
-
Sat Dec 03 19:57:42 2016
-
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_7273_140042619459008.trc
-
Trace level is currently 0
-
-
Started with pid=7273
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
-
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
-
WARNING: Subscription for node down event still pending
-
03-DEC-2016 19:57:42 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=centhost3)(USER=laolv))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=202375680)) * status * 0
- [laolv@centhost3 alert]$
7)對比host2和host3
發現host2多一個sqlnet.ora檔案
[laolv@centhost2 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
新增sqlnet.ora到host3也不起作用,因為sqlnet.ora是為客戶端服務的/置於客戶機的,並不是為listener程式所用。
8)Oracle監聽器無法動態註冊例項的服務
參考
http://blog.csdn.net/weiwangsisoftstone/article/details/38082487
http://www.itpub.net/thread-1921723-1-1.html 帖子:個人懷疑計算機名為localhost時只能動態註冊到127.0.0.1的ip上面,所以導致上面監聽配置檔案中10.98.0.122時獲取不到動態註冊,為了驗證這個想法,個人修改了計算機名,再修改hosts檔案後重啟計算機後動態註冊已經有了,為了驗證這個問題,有時間個人再把計算機名重新改回localhost再驗證下.
在http://blog.csdn.net/weiwangsisoftstone/article/details/38082487中有檢測/etc/hosts,我懷疑是(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.147)(PORT = 1521))中的HOST應該使用機器名而不能使用IP
點選(此處)摺疊或開啟
-
[laolv@centhost3 admin]$ cat listener.ora
-
# listener.ora Network Configuration File: /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
# Generated by Oracle configuration tools.
-
-
LISTENER =
-
(DESCRIPTION_LIST =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.147)(PORT = 1521))
-
)
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
-
)
-
)
-
-
ADR_BASE_LISTENER = /opt/oracle
-
-
[laolv@centhost3 admin]$ cat /etc/hosts
-
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
-
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
-
192.168.1.147 localhost
-
192.168.1.145 centos65
-
192.168.1.146 centhost2
-
192.168.1.147 centhost3
-
-
(因為在我的另一臺裝有oracle的主機host2中,lsnrctl status返回的服務是READY的
-
[laolv@centhost2 admin]$ cat listener.ora
-
# listener.ora Network Configuration File: /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
# Generated by Oracle configuration tools.
-
-
LISTENER =
-
(DESCRIPTION_LIST =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
-
)
-
)
-
-
[laolv@centhost2 admin]$ cat /etc/hosts
-
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
-
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
-
192.168.1.146 localhost
-
192.168.1.145 centos65
-
192.168.1.146 centhost2
-
192.168.1.147 centhost3
-
192.168.1.156 www.lvzhongqian.com
-
)
-
-
[laolv@centhost3 admin]$ cat listener.ora
-
# listener.ora Network Configuration File: /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
# Generated by Oracle configuration tools.
-
-
LISTENER =
-
(DESCRIPTION_LIST =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = centhost3)(PORT = 1521))
-
)
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
-
)
-
)
-
- ADR_BASE_LISTENER = /opt/oracle
lsnrctl stop
lsnrctl start
[laolv@centhost3 admin]$ lsnrctl status
點選(此處)摺疊或開啟
-
過幾分鐘(因為資料庫例項透過PMON程式向監聽器註冊service_name,也有一個週期的;大概是每3分鐘一個週期)
-
[laolv@centhost3 admin]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-DEC-2016 23:43:30
-
-
Copyright (c) 1991, 2014, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=centhost3)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
-
Start Date 03-DEC-2016 23:42:01
-
Uptime 0 days 0 hr. 1 min. 29 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
-
Services Summary...
-
Service "orclrman" has 1 instance(s).
-
Instance "orclrman", status READY, has 1 handler(s) for this service...
-
Service "orclrmanXDB" has 1 instance(s).
-
Instance "orclrman", status READY, has 1 handler(s) for this service...
-
The command completed successfully
-
[laolv@centhost3 alert]$ hostname
- centhost3
-------------------------------------------------------點到此位置,以下為可選內容------------------------------------------------------------------
9)分析host=centos3行,host=192.168.1.147 不行的原因
參考“監聽器trace file中”,我設定成host=192.168.1.147,檢視listener.log和trace日誌、tracsst分析trace後得到的資訊,依舊沒定位出原因。
·反向思維:既然知道“host=centos3行”,那就設定成host=centos3,lsnrctl reload一下,檢視trace日誌和使用tracsst分析一下trace日誌。
tailf ora_20228**.trc:
2016-12-04 11:24:53.717415 : nlstdtp_trace_pfile: -> PARAMETER TABLE LOAD RESULTS FOLLOW <-
2016-12-04 11:24:53.717545 : nlstdtp_trace_pfile:Successful parameter table load
2016-12-04 11:24:53.717608 : nlstddp_dump_ptable: -> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-
2016-12-04 11:24:53.717656 : nlstddp_dump_ptable: LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = centhost3)(PORT = 1521))) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
2016-12-04 11:24:53.717715 : nlstddp_dump_ptable: ADR_BASE_LISTENER = /opt/oracle
2016-12-04 11:24:53.717767 : nlstddp_dump_ptable: TRACE_LEVEL_LISTENER = 16
2016-12-04 11:24:53.717819 : nlstddp_dump_ptable: TRACE_TIMESTAMP_LISTENER = true
2016-12-04 11:24:53.717909 : nlstdtp_trace_pfile:--- PARAMETER SOURCE INFORMATION ENDS ---
2016-12-04 11:24:53.718027 : nsglldsec:entry
2016-12-04 11:24:53.718274 : nsglldsec:exit
TNSLSNR for Linux: Version 12.1.0.2.0 - Production on 04-DEC-2016 11:24:53
Copyright (c) 1991, 2014, Oracle. All rights reserved.
2016-12-04 11:24:53.719602 : nlstddt_do_alter_trace:--- TRACE CONFIGURATION INFORMATION FOLLOWS ---
2016-12-04 11:24:53.719663 : nlstddt_do_alter_trace:New trace stream is /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_20228_139696976258496.trc
2016-12-04 11:24:53.719722 : nlstddt_do_alter_trace:New trace level is 16
2016-12-04 11:24:53.719772 : nlstddt_do_alter_trace:--- TRACE CONFIGURATION INFORMATION ENDS ---
2016-12-04 11:24:53.720559 : nlstddl_do_alter_log:--- LOG CONFIGURATION INFORMATION FOLLOWS ---
2016-12-04 11:24:53.720693 : nlstddl_do_alter_log:Existing log stream is identical to desired "/opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml"; ignoring alter
2016-12-04 11:24:53.720750 : nlstddl_do_alter_log:--- LOG CONFIGURATION INFORMATION ENDS ---
reload後還是The listener supports no services (alter system register後也是The listener supports no services)
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 09:58:53
Uptime 0 days 1 hr. 35 min. 17 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_20228_139696976258496.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.147)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
·那就重啟:
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
The command completed successfully
LSNRCTL> start
Starting /opt/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 11:37:04
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-DEC-2016 11:37:04
Uptime 0 days 0 hr. 0 min. 55 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centhost3/listener/alert/log.xml
Listener Trace File /opt/oracle/diag/tnslsnr/centhost3/listener/trace/ora_22421_140508226909632.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orclrman" has 1 instance(s).
Instance "orclrman", status READY, has 1 handler(s) for this service...
Service "orclrmanXDB" has 1 instance(s).
Instance "orclrman", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
取listener.log、ora_22421_140508226909632.trc、 ora_22421_140508226909632.trm到本地再分析
[laolv@centhost3 trc]$ trcasst ora_22421_140508226909632.trc > ora_22421_140508226909632.trcasst
host=192.168.1.147 ,host=centhost3 的前後trcasst 分析資訊
2016-12-04 11:37:16.104003 : nsglgrDoRegister:Creating new instance: "orclrman".
2016-12-04 11:37:16.104032 : nscontrol:entry
2016-12-04 11:37:16.104046 : nttctl:entry
2016-12-04 11:37:16.104059 : nscontrol:cmd=7, lcl=0x0
2016-12-04 11:37:16.104070 : nscontrol:normal exit
2016-12-04 11:37:16.104102 : nsglgrDoRegister:inst loads: ld1:0 mld1:10240 ld2:1 mld2:472
2016-12-04 11:37:16.104115 : nsglgrDoRegister:instance flags - req:0 cur:16
2016-12-04 11:37:16.104162 : nsglgrDoRegister:Creating new service: "orclrmanXDB".
2016-12-04 11:37:16.104182 : nsglgrDoRegister:service:orclrmanXDB flag:3 goodness:0 delta:1
2016-12-04 11:37:16.104219 : nsglgrDoRegister:Creating new service: "orclrman".
2016-12-04 11:37:16.104233 : nsglgrDoRegister:service:orclrman flag:2 goodness:0 delta:1
2016-12-04 11:37:16.104260 : nsglegln:entry
2016-12-04 11:37:16.104280 : snlinGetAddrInfo:entry
2016-12-04 11:37:16.104400 : snlinGetAddrInfo:getaddrinfo() failed with error -2
2016-12-04 11:37:16.104419 : snlinGetAddrInfo:exit
2016-12-04 11:37:16.104430 : snlinGetAddrInfo:entry
2016-12-04 11:37:16.104517 : snlinGetAddrInfo:exit
2016-12-04 11:37:16.104540 : snlinGetAddrInfo:entry
……
2016-12-04 11:37:16.104996 : snlinFreeAddrInfo:entry
2016-12-04 11:37:16.105015 : snlinFreeAddrInfo:exit
2016-12-04 11:37:16.105030 : nsglegln:exit
2016-12-04 11:37:16.105044 : nsglgrDoRegister:Creating new endpoint: "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))".
2016-12-04 11:37:16.105056 : nladini:entry
2016-12-04 11:37:16.105094 : nladini:exit
2016-12-04 11:37:16.105112 : nladget:entry
…
2016-12-04 11:37:16.106259 : nsglvldyl:Dynamic loading of valid node list successful
2016-12-04 11:37:16.106270 : nsglvldyl:exit
2016-12-04 11:37:16.106282 : nsgllsn:LSNDSC==>(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
2016-12-04 11:37:16.106293 : nsglhcrt:entry
2016-12-04 11:37:16.106349 : nsglhcrt:exit
2016-12-04 11:37:16.106366 : nsglbgetRSPidx:entry
2016-12-04 11:37:16.106377 : nladini:entry
……
2016-12-04 11:37:16.106572 : nsc2addr:entry
2016-12-04 11:37:16.106583 : nsc2addr:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=centhost3)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/orclrman/xdb_wallet))(Presentation=HTTP)(Session=RAW))
2016-12-04 11:37:16.106641 : ntzini:entry
2016-12-04 11:37:16.106699 : ntzSetupConnection:entry
ora_22421_140508226909632.trcasst檔案:*************************************************************************
* Trace Assistant *
*************************************************************************
<--- Received 204 bytes - Connect packet timestamp=016-12-04 11:37:04.990220
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Maximum SDU size: 8192
Maximum TDU size: 4096
NT protocol characteristics:
Test for more data
Spawner is running
Hang on to Listener connection
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 134
Connect data offset: 70
Connect data maximum size: 2048
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/oracle/product/12.1.0/dbhome_1/bi
n/tnslsnr)(ENVS=)(ARGV0=)(ARGS='LISTENER,-inherit')(DETACH=yes))
---> Send 2686976 bytes - Accept packet timestamp=016-12-04 11:37:05.214508
Accepted NS version number is: 315.
Accepted maximum SDU size: 8192
Accepted maximum TDU size: 4096
Connect data length: 480
Connect data offset: 41
Native Services wanted
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
Packet data is in the following data packet
---> Send 490 bytes - Data packet timestamp=016-12-04 11:37:05.215613
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0/dbhome_1/network/a
dmin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/centhost3/listener/al
ert/log.xml
Trace information written to /opt/oracle/diag/tnslsnr/centhost3/listen
er/trace/ora_22421_140508226909632.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centhost3)(POR
T=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
<--- Received 210 bytes - Connect packet timestamp=016-12-04 11:37:05.225394
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Global options for the connection:
Don't care
Maximum SDU size: 8192
Maximum TDU size: 2097152
NT protocol characteristics:
Test for more data
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Generate SIGPIPE signal
Generate SIGIO signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 140
Connect data offset: 70
Connect data maximum size: 2040
Disable NA services on this connection
No NA services are linked in
Disable NA services on this connection
No NA services are linked in
(DESCRIPTION=(CONNECT_DATA=(CID=(PROGRAM=)(HOST=centhost3)(USER=laolv)
)(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=202375680)))
<--- Received 116 bytes - Connect packet timestamp=016-12-04 11:37:16.088274
Current NS version number is: 315.
Lowest NS version number can accommodate is: 300.
Maximum SDU size: 8192
Maximum TDU size: 2097152
NT protocol characteristics:
Test for more data
Test operation
Full duplex I/O
Urgent data support
Generate SIGURG signal
Generate SIGPIPE signal
Generate SIGIO signal
Handoff connection to another
Line turnaround value: 0
Connect data length: 46
Connect data offset: 70
Connect data maximum size: 0
(CONNECT_DATA=(COMMAND=service_register_NSGR))
我認為:pmon向監聽器註冊服務時,是基於hostname來尋找監聽器的,而不是IP(可能會把IP錯認為hostname)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25097694/viewspace-2129690/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sql server資料庫連線失敗/無法附加解決過程SQLServer資料庫
- 資料庫連線失敗的原因及解決方法資料庫
- Kettle8.2連線Oracle資料庫失敗解決方法Oracle資料庫
- PHP資料庫連線失敗–couldnotfinddriver解決辦法PHP資料庫
- ORACLE 資料庫分析,重新編譯失敗過程Oracle資料庫編譯
- crontab失敗的解決過程
- 資料庫連線設定失敗!資料庫
- 資料庫遠端連線失敗資料庫
- 網頁提示連線資料庫失敗是怎麼回事(網站資料庫連線失敗)網頁資料庫網站
- 資料庫的連線過程資料庫
- 織夢資料庫連線失敗的原因資料庫
- Oracle備庫TNS連線失敗的分析Oracle
- Dedecms錯誤警告:連線資料庫失敗,出錯怎麼解決?資料庫
- 檔案系統異常引起的資料庫open失敗的解決過程資料庫
- 網站連結資料庫失敗怎麼解決網站資料庫
- DedeCms錯誤警告:連線資料庫失敗資料庫
- PbootCMS錯誤提示:資料庫連線失敗boot資料庫
- SSL連線建立過程分析(1)
- 使用 EF Core 的 EnableRetryOnFailure 解決短暫的資料庫連線失敗問題AI資料庫
- 解決 Windows 下 Homestead 建立軟連線失敗問題Windows
- linux 資料庫localhostl連線成功127.0.0.1連線失敗Linux資料庫localhost127.0.0.1
- mongodb資料庫連結失敗如何解決MongoDB資料庫
- 為什麼我的 PHP 資料庫連線失敗?PHP資料庫
- DB2資料庫連線失敗問題DB2資料庫
- mysql資料庫連線失敗是什麼原因MySql資料庫
- CDH 5.13 hue資料庫連線測試失敗資料庫
- 網站資料庫連線失敗怎麼辦網站資料庫
- C#連線MySQL8.0資料庫失敗C#MySql資料庫
- 遠端連線 Mysql 失敗的解決方法MySql
- 達夢資料庫關於[-70028]:建立SOCKET連線失敗的錯誤原因資料庫
- CF連線伺服器失敗怎麼回事 cf連線失敗解決辦法伺服器
- 我的postgresql資料庫報埠錯誤,連線失敗SQL資料庫
- linux配置mysql資料庫遠端連線失敗LinuxMySql資料庫
- 織夢DedeCms錯誤警告,連線資料庫失敗資料庫
- 織夢cms連線資料庫失敗怎麼辦資料庫
- 網站程式連線資料庫失敗怎麼辦?網站資料庫
- SSH建立連線的過程
- Oracle 連線有時候慢,應用稍微一忙,偶爾出現連線失敗 的故障解決過程Oracle