lisenter更改主機(jī)名之后監(jiān)聽不到服務(wù)
為金壇等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及金壇網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)、金壇網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
環(huán)境描述,linux redhat5.4 + oracle 11.2.0.1
主機(jī)名:zky.zhan
主機(jī)ip:192.168.214.10
實(shí)例SID:zky
問題展現(xiàn)
如果將listenter.ora中監(jiān)聽地址(HOST = zky.zhan)參數(shù)更改為監(jiān)聽主機(jī)網(wǎng)絡(luò)地址(HOST = 192.168.214.10)后。發(fā)現(xiàn)服務(wù)監(jiān)聽不到服務(wù)器,一直顯示no server ,通過網(wǎng)絡(luò)服務(wù)也不能登錄到數(shù)據(jù)庫(kù)。
查看tnsname.ora參數(shù)
[oracle@zky /]$ cat /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ZKY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.214.10)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = zky) ) ) |
查看listener.ora參數(shù)
我們將默認(rèn)的zky.zhan修改為ip地址
[oracle@zky /]$ cat /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.214.10)(PORT = 1521)) ) |
啟動(dòng)監(jiān)聽
發(fā)現(xiàn)The listener supports no services,一直監(jiān)聽不到服務(wù)
[oracle@zky /]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-APR-2016 05:34:11 Copyright (c) 1991, 2009, Oracle. All rights reserved. Starting /u01/app/oracle/product/11.2.0/grid/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.214.10)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.214.10)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 24-APR-2016 05:34:11 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.214.10)(PORT=1521))) The listener supports no services The command completed successfully |
數(shù)據(jù)庫(kù)登錄也顯示無監(jiān)聽
[oracle@zky /]$ sqlplus system/oracle_4U@zky SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 24 05:37:17 2016 Copyright (c) 1982, 2009, Oracle. All rights reserved. ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor |
解決方法
在糾結(jié)多日之后發(fā)現(xiàn)當(dāng)使用ping主機(jī)名zky.zhan時(shí)發(fā)現(xiàn)默認(rèn)解析為127.0.0.1。于是在試探的狀態(tài)下將本地解析127.0.0.1修改為192.168.214.10后發(fā)現(xiàn)可以正常使用。
更改host
[root@zky /]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. #127.0.0.1 zky.zhan zky localhost.localdomain localhost #::1 localhost6.localdomain6 localhost6 192.168.214.10 zky.zhan zky localhost.localdomain localhost |
重啟監(jiān)聽后服務(wù)自己監(jiān)聽到了
[oracle@zky /]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-APR-2016 05:43:40 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.214.10)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 24-APR-2016 05:34:11 Uptime 0 days 0 hr. 9 min. 29 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.214.10)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM", status READY, has 1 handler(s) for this service... Service "zky" has 1 instance(s). Instance "zky", status READY, has 1 handler(s) for this service... Service "zkyXDB" has 1 instance(s). Instance "zky", status READY, has 1 handler(s) for this service... The command completed successfully |
登錄數(shù)據(jù)庫(kù)成功
[oracle@zky /]$ sqlplus system/oracle_4U@zky SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 24 05:44:59 2016 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> show parameter name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string db_name string zky db_unique_name string zky global_names boolean FALSE instance_name string zky lock_name_space string log_file_name_convert string service_names string zky |
當(dāng)前題目:lisenter更改主機(jī)名之后監(jiān)聽不到服務(wù)
網(wǎng)頁(yè)路徑:http://jinyejixie.com/article44/jpdche.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、網(wǎng)站內(nèi)鏈、企業(yè)建站、網(wǎng)站排名、商城網(wǎng)站、App設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)