Oracle network configuration and connection management

Source: Internet
Author: User
Oracle network configuration: some solutions to Oracle connection errors caused by PLSQLDeveloper, especially when the network environment changes. Three configuration files

Oracle network configuration: some solutions to Oracle connection errors when PL/SQL Developer is used, especially connection errors caused by network environment changes. Three configuration files

Oracle network configuration: some solutions to Oracle connection errors when PL/SQL Developer is used, especially connection errors caused by network environment changes.

The listener. ora, sqlnet. ora, and tnsnames. ora configuration files are all stored in the $ ORACLE_HOME \ network \ admin directory.

1. sqlnet. ora -- this file is similar to the nsswitch. conf file of linux or other unix. It is used to determine how to find a connection string that appears in the connection.

For example, we enter

Sqlplus sys/oracle @ orcl

Assume that my sqlnet. ora is like the following:

SQLNET. AUTHENTICATION_SERVICES = (CNT)

NAMES. DIRECTORY_PATH = (TNSNAMES, HOSTNAME)

Then, the client will first be in tnsnames. orcl records in the ora file. if there is no corresponding record, try to use orcl as a host name, resolve its ip address through the network, and then connect to the instance GLOBAL_DBNAME = orcl on this ip address, of course, here, orcl is not a host name.

If I look like this

NAMES. DIRECTORY_PATH = (TNSNAMES)

Then the client will only search for orcl records from tnsnames. ora. There are other options in brackets, such as LDAP, which are not commonly used.

2. Tnsnames. ora -- this file is similar to the unix hosts file. It provides the corresponding tnsname to the host name or ip address, only when it is similar

NAMES. DIRECTORY_PATH = (TNSNAMES), that is, the client will try to use this file only when TNSNAMES is in the order in which the client parses the connection string.

PROTOCOL: the PROTOCOL for communications between the client and the server, which is generally TCP.

HOST: The name or IP address of the machine on which the database listens. The database listens on the same machine as the database, so when I say that the machine where the database listens is generally the machine where the database is located. In UNIX or WINDOWS, you can use the hostname command at the command prompt of the machine on which the database listens, or use ipconfig (forWINDOWS) or ifconfig (for UNIX) command to obtain the IP address. Note that, whether using the machine name or IP address, you must ping the Host Name of the machine where the database is listening on the client, otherwise, the host name of the machine where the database listening is located must be added to the hosts file.

PORT: the PORT on which the database listens. You can view the listener. ora file on the server or run the lnsrctl status [listener name] command at the command prompt on the machine where the database listens. The Port value must be the same as the Port on which the database listens.

SERVICE_NAME: on the server side, run the sqlplus> showparameter service_name command after logging on to the system.

The host corresponding to ORCL and another IP address corresponding to SALES, which also defines whether to use the master server or Shared Server Mode for connection.

# Enter TNSNAME when you want to connect

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

# The host, port, and Protocol corresponding to this TNSNAME

(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521 ))

)

(CONNECT_DATA =

# The dedicated server mode must match the server mode to connect. If not, it is automatically adjusted according to the server mode.

(SERVER = DEDICATED)

# View the corresponding service_name, SQLPLUS>; showparameter service_name;

(SERVICE_NAME = orcl)

)

)

# The following is similar

SALES =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.188.219) (PORT = 1521 ))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = sales)

)

)

Note: If the database server uses MTS, it is best to explicitly specify the dedicated direct connection mode when the client program needs to use database link. Otherwise, there will be many oraclebugs related to the distributed environment. Generally, direct connection to the database server is better, unless your real-time database connection is close to 1000.

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.