Symptom description:
In linux, using sqlplus sys/oracle @ prod as sysdba to log on is very slow. It takes about a dozen seconds to log on successfully. Using sqlplus/as sysdba to log on to the database is fast and fast.
Using sqlplus sys/oracle @ prod as sysdba login will be stuck in the following position for more than 10 seconds:
[Oracle @ jp admin] $ sqlplus sys/oracle @ prod
SQL * Plus: Release 10.2.0.1.0-Production on Wed Mar 26 23:32:29 2014
Copyright (c) 1982,200 5, Oracle. All rights reserved.
I initially thought it was possible that there was a problem with the listener. Then tnsping tried it:
[Oracle @ jp admin] $ tnsping prod
TNS Ping Utility for Linux: Version 10.2.0.1.0-Production on 27-MAR-2014 09:11:30
Copyright (c) 1997,200 5, Oracle. All rights reserved.
Stuck for dozens of seconds
Used parameter files:
/U01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet. ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (description = (address = (protocol = tcp) (host = jp) (port = 1521) (connect_data = (server = dedicated) (service_name = PROD )))
OK (0 msec)
During the tnsping process, it is found that the stuck position is
Used TNSNAMES adapter to resolve the alias
Previously, the problem should be that before using tnsnames for parsing,
Later, I checked and found the problem lies in the/etc/resolv. conf file:
The content of the/etc/resolv. conf file is as follows:
Nameserver 192.168.50.2
Search localdomain
~
It is found that nameserver is configured here. If nameserver is configured, oracle needs to verify nameserver first, and other methods will be used to connect after the failure times out. The timeout time is about 10 seconds to 30 seconds.
Comment out the nameserver and try again. The sqlplus sys/oracle @ prod as sysdba logon speed returns to normal.