lisenter更改主機(jī)名之后監(jiān)聽不到服務(wù)
站在用戶的角度思考問題,與客戶深入溝通,找到黃南州網(wǎng)站設(shè)計(jì)與黃南州網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站設(shè)計(jì)制作、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、虛擬空間、企業(yè)郵箱。業(yè)務(wù)覆蓋黃南州地區(qū)。環(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ù)庫。
查看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ù)庫登錄也顯示無監(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ù)庫成功
[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 |
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。