[Oracle]/etc/resolv. conf configuration causes slow sqlplus Logon

Source: Internet
Author: User
Tags nameserver

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.