平台:
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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25097694/viewspace-2129690/