1.
background
The temporary environment for the work is the CENTOS7 server VM11 by the virtual machine, with the oracle11g (11.2.0.1.0) normally accessed and saved as a snapshot. Centos7 ip192.168.44.55, Gateway 192.168.44.2
Since laptops often travel between the company and the home, the gateway to the intranet is different, so using the virtual machine to set NAT mode makes the CENTOS7 available for external access. This way CENTOS7 has its own gateway and IP, without changing the host intranet gateway.
2.
Phenomenon:
Once a snapshot is resumed, SSH logs in to CENTOS7, enabling Oracle listening and DB to be enabled with Oracle users. Found to be able to use SSH, the Windows side connection shows an error, Ora-12541:tns: No listener.
At this point the terminal changed to [[email protected] ~]#, so that it is the centos hostname caused by the Oracle listener problem. So you can't connect remotely
3. Individual data for the environment at this time:
[[email protected] ~]# hostname bogon[[email protected] ~]# Span style= "COLOR: #ff0000" >cat/etc/sysconfig/network # Created by anaconda[[email protected] ~]# cat/etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6[[email protecte D] ~]# ipcalc-h 192.168.44.55 hostname=bogon[[email protected] ~]# nslookup 192.168.44.55 server:8.8.8.8address:8.8.8.8#5355.44.168.192.in-addr . arpa name = Bogon. [[email protected] ~]# cat/etc/resolv.conf # Generated by Networkmanagernameserver 8.8.8.8nameserver 114.114.114.114[[email protected] ~]#
cat Listener.ora # Listener.ora Network Configuration File:/data/oracle/product/11.2.0/db_1/network/admin/ listener.ora# Generated by Oracle configuration tools. LISTENER = (description_list = ( DESCRIPTION = localhost) (PORT = 1521)) Cat Tnsnames.ora # Tnsnames.ora Network Configuration File:/data/oracle/product/11.2.0/db_1/network/admin/ tnsnames.ora# Generated by Oracle configuration tools. ORACLE = (DESCRIPTION = (address_list = localhost.localdomain) (PORT = 1521)) ) ( Connect_data = (service_name = Oracle) )
4. Cause analysis (refer to Non-original):
And also:
That
1) host initialization, host name localhost or localhost.localdomain causes the operating system to perform DNS reverse resolution resulting in hostname as Bogon.
2) If Search Localdomain or other DNS servers that do not filter the Bogon are configured in resolv.conf, the host name obtained here takes precedence over the configuration in the hosts and network files, making the host name Bogon.
5. Summary: 1)Workaround 1 (recommended):Change the DNS domain name server.
Returned information by Nslookup 192.168.44.55, which I think is caused by 8.8.8.8 this DNS server. This domain name server does not filter Bogon.
The 8.8.8.8 is removed and the NIC service network restart is restarted.
Restart the terminal and discover that it has changed to [[email protected] ~]#. The Execute hostname command discovers that the hostname becomes localhost.localdomain.
At this point, the start of Oracle listening and db.windows remote access is OK.
(PS: found by reference 2 domain name server if set to NAT Gateway Sometimes also causes the hostname to be resolved to Bogon, my family's other computer domain name server is set to NAT Gateway + 114.114.114.114 This issue does not occur for temporary centos.)
2) Workaround 2: Change host name
I modified the file/etc/hosts to add the IP of the current server and the desired hostname. That is, add a line 192.168.44.55 localhost.localdomain.
After restarting the server, it is discovered that the hostname becomes localhost.localdomain. Oracle listening and DB remote normal access at this time.
(PS:/etc/sysconfig/network is not changed at this time.) experiment found to modify the/etc/sysconfig/network file separately add Hostname=localhost.localdomain The host name is still not Bogon after restarting the machine.)
3) Trial and error:
At the beginning, I used workaround 2,/etc/hosts added a line 192.168.44.55 locahost. Because I don't know what the hostname was before it changed to BOGO. Just remember the original terminal name display [email protected] After adding, restart the machine,
The discovery terminal is [email protected] and executes hostname discovery host name localhost. At this point, the hostname is consistent with the host in Oracle Listener.ora, enabling the Oracle listener with the following error:
tns-12537: Tns:connection closed Tns-12560: Tns:protocol Adapter error Tns-00507: Connection closed Linux ERR Or:29:illegal seek query Reference 3 found that the hostname is inconsistent with the listener name, which causes Oracle to enable the listener to fail. Then, with workaround 2 o'clock, the hostname is consistent with Oracle's Tnsname.ora, and Oracle snooping and DB start normally, Remote access is OK.
< Br> < Span style= "COLOR: #000000" > 6.############ The references are as follows, thanks to the author #############
1) http://blog.csdn.net/weiwan721/article/details/48463371
2) http://www.cnblogs.com/armo/p/6739472.html
3) http://www.cnblogs.com/xing901022/p/3895719.html
Remember once the centos7 hostname becomes bogon, which causes Oracle to fail Remote Access (original)