虛擬機(jī)環(huán)境,OEL7.2, ORACLE 12.1。 重啟主機(jī)后,發(fā)現(xiàn)監(jiān)聽程序啟動好像將近1分鐘。
成都做網(wǎng)站、網(wǎng)站制作的開發(fā),更需要了解用戶,從用戶角度來建設(shè)網(wǎng)站,獲得較好的用戶體驗。創(chuàng)新互聯(lián)公司多年互聯(lián)網(wǎng)經(jīng)驗,見的多,溝通容易、能幫助客戶提出的運(yùn)營建議。作為成都一家網(wǎng)絡(luò)公司,打造的就是網(wǎng)站建設(shè)產(chǎn)品直銷的概念。選擇創(chuàng)新互聯(lián)公司,不只是建站,我們把建站作為產(chǎn)品,不斷的更新、完善,讓每位來訪用戶感受到浩方產(chǎn)品的價值服務(wù)。
下面是分析過程:
執(zhí)行監(jiān)聽啟動操作,會hang起來一段時間,最終監(jiān)聽啟動成功
[oracle@sky-oel7 ~]$ lsnrctl start
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sky-oel7)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 12-JAN-2016 16:42:57
Uptime 0 days 0 hr. 0 min. 40 sec
啟動耗時40秒。
指定監(jiān)聽的日志等級為16
[oracle@sky-oel7 trace]$ cat /oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sky-oel7)(PORT = 1521))
)
)
TRACE_LEVEL_LISTENER=16
重新啟動監(jiān)聽程序,日志
[oracle@sky-oel7 trace]$ tail -f listener.log
Log messages written to /oracle/app/oracle/diag/tnslsnr/sky-oel7/listener/alert/log.xml
Trace information written to /oracle/app/oracle/diag/tnslsnr/sky-oel7/listener/trace/ora_4179_140717186082304.trc
Trace level is currently 16
Started with pid=4179
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sky-oel7)(PORT=1521)))
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
WARNING: Subscription for node down event still pending
12-JAN-2016 16:10:14 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=sky-oel7)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=202375680)) * status * 0
[oracle@sky-oel7 admin]$ vi /oracle/app/oracle/diag/tnslsnr/sky-oel7/listener/trace/ora_4179_140717186082304.trc
2016-01-12 16:09:34.211259 : nttcnp:binding an address to a socket.
2016-01-12 16:09:34.211275 : nttcnp:listening on a bound socket (queue size = 128).
2016-01-12 16:09:34.211324 : nttcnp:getting sockname
2016-01-12 16:09:34.211342 : nttcnp:getting peername
2016-01-12 16:09:34.211355 : nttcnp:exit
2016-01-12 16:09:34.211368 : snlinGetAddrInfo:entry
2016-01-12 16:10:14.256096 : snlinGetAddrInfo:getaddrinfo() failed with error -3
2016-01-12 16:10:14.256193 : snlinGetAddrInfo:exit
2016-01-12 16:10:14.256215 : nttcon:exit
2016-01-12 16:10:14.256241 : nsopen:transport is open
2016-01-12 16:10:14.256261 : nsoptions:entry
沒有更多的可用信息。
通過strace進(jìn)行進(jìn)程啟動信息分析
[oracle@sky-oel7 ~]$ strace -f -t -o ~/listener.trc lsnrctl start
查看strace日志信息
5042 16:42:57 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 13
5042 16:42:57 connect(13, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("172.24.97.1")}, 16) = 0
5042 16:42:57 poll([{fd=13, events=POLLOUT}], 1, 0) = 1 ([{fd=13, revents=POLLOUT}])
5042 16:42:57 sendto(13, ":\26\1\0\0\1\0\0\0\0\0\0\10sky-oel7\tworkgroup\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
5042 16:42:57 poll([{fd=13, events=POLLIN}], 1, 5000) = 0 (Timeout)
5042 16:43:02 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 14
5042 16:43:02 connect(14, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.191.1")}, 16) = 0
5042 16:43:02 poll([{fd=14, events=POLLOUT}], 1, 0) = 1 ([{fd=14, revents=POLLOUT}])
5042 16:43:02 sendto(14, ":\26\1\0\0\1\0\0\0\0\0\0\10sky-oel7\tworkgroup\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
5042 16:43:02 poll([{fd=14, events=POLLIN}], 1, 5000) = 0 (Timeout)
上面的信息看出,是由于地址解析失敗造成網(wǎng)絡(luò)超時。
這些地址都是安裝時,自動產(chǎn)生的DNS地址信息,由于環(huán)境發(fā)生變化,DNS地址不同,造成訪問操作
[root@sky-oel7 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search workgroup
nameserver 172.24.97.1
nameserver 192.168.191.1
屏蔽這些地址后,listener啟動正常。