Oracle client Installation and remote connection configuration method sharing _oracle

Source: Internet
Author: User
Tags oracle database installation access database oracle database

First, Oracle client and server-side communication mechanism

1, oraclenet Agreement

as the following illustration shows, Oracle uses the Oracle NET protocol to achieve client-server connectivity and data delivery. Oraclenet is a software layer that resides on both the Oracle database server side and the client, encapsulating the TCP/IP protocol, which is responsible for establishing a connection with the maintenance client application to the database server.

as shown in the following illustration, a client-made request is first converted through the Oraclenet protocol and converted into information that can be transmitted over the network via the tcp/ The IP network transmits the request to the database server side, the server side accepts the client request to convert through the Oraclenet protocol, converts the request to a database, interprets the local instructions executed, executes on the server side (mainly some input and output operations), and passes the result through tcp/ The IP protocol and the ORACLENET protocol are transmitted to the client for display.          

2, the client and server-side Connection process

Before you analyze client-server connection mechanisms, you define two concepts, one Oracle Listener and one Oracle Network Service name.

The Oracle database server receives a connection request from the client through a component named "Oraclenet Listener ". The listener is a background process located on the server side, the client connection request sent to the database is first listened to by the server-side listener, and the request is forwarded to the corresponding database instance to establish a client-server connection. After the connection is established, the client and the server can communicate directly and no longer need the listener to participate.

to enable listeners to listen to customer requests, you need to configure the listener, including information such as the listening port, the global database name of the database where the listener resides, and the database instance.

The Oracle Network service name is an identifier that represents the configuration information for the Client Connection server (which is actually the content of the connection request), including the database host address, the listening Port, Global database name (refer to the Oracle Database installation section for global databases, database instances, and so on).

as shown in the figure, the client-server connection process is:

(1) first on the server side there is a resident listener (listening to the service to open) listening to the client issued a connection request.
(2) The user enters the username, password, and network service name on the client (Enterprise Server or SQL tool), or enters a similar "connectusername/password@net_" on the SQL command line. A similar request for service_name ".
(3) The client views the Network service profile Tnsname.ora and maps the network service name to a connection descriptor that contains the Oracle server address, listening port, and global database name.
(4) The client locates the listener based on the connection descriptor and passes the connection information to the listener over the network.
(5) The Listener query listens to the configuration file Listener.ora to find the database server to which you want to Connect.
(6) The client and the server begin to communicate.

Second, the Listener configuration

1. Add and Configure listeners

Add and configure the listener for the server using the Oracle Net Configuration asistant tool as shown in the following Illustration:

After the listener configuration is complete, the database system starts the listener automatically.

After you add and configure the listener, you can also use the Oracle Netmanager tool to view and modify the listener configuration, such as the listening location, the global database name that the listener serves, and so on. As shown in the following illustration:


for this installation, the listener configuration information is recorded in the E:\Oracle_Server\oracle\ora92\network\admin\listener.ora file. Its main contents are as follows:

listener=
( description_list =
( DESCRIPTION =
( address_list =
          < c31>(address = (PROTOCOL = TCP) (HOST = tsinghua-p5z3mm) (PORT =1521))
        )
      )
   )

Sid_list_listener =
(sid_list=
(Sid_desc =
(Sid_name = Plsextproc)
(Oracle_home = E:\Oracle_Server\oracle\ora92)
(program = Extproc)
)
(Sid_desc =
(Global_dbname = Mydb.bawei)
(Oracle_home = E:\Oracle_Server\oracle\ora92)
(Sid_name = mydb)
)
)

III. installation of client tools and configuration of network services

you can install client tools on other machines that are different from the database host and connect to the database server by Configuring the Client Network Service. The client installation and configuration process is shown in the following illustration (this installation installs the client in a different directory from the same machine as the database, simulating the remote Access database):

After you have installed the client and configured the client Network service name, you can log in and access the remote database server from the client tools. For this installation, the Client Network service configuration is recorded in the E:\Oracle_Client\oracle\ora92\network\admin\tnsnames.ora file, the main contents of which are as follows:

remotedb=
( DESCRIPTION =
( address_list =
( address = (PROTOCOL = TCP ) (HOST = 192.168.10.6) (PORT =1521)
      )
( connect_data =
( service_name = Mydb.bawei)
      )
   )

in this way, when you enter the network service name Remotedb in the client tool, it will be resolved to the database address, port, global database name and other information, with the input username, password sent to the server side, Received by the listener and, in contrast to the listener configuration file, the request is forwarded to the appropriate database instance for processing.

Client Network services can be modified using the client's Oracle Net Manager tool, or a new client network service name can be added.

 

It should be noted that:

The server-side client tools (SQL PLUS, Enterprise Management Console, and so on) are connected to the database service in the same way as remote client connections.
After the Oracle database is installed, the system defaults to installing sqlplus and other client tools locally on the database server, and listening to the same location on the configuration file E:\Oracle_Server\ The server-side Network Service connection profile Tnsnames.ora is provided by default in the Oracle\ora92\network\admin folder, which contains a network service name configuration with the same name as the database instance SID, including the host name or IP address of the database, the listening port, Database service Name (global database name), and so on. For this installation, the main contents of the Tnsnames.ora file are as follows:

MYDB =
(DESCRIPTION =
(address_list =
(address = (PROTOCOL = TCP) (HOST = tsinghua-p5z3mm) (PORT =1521)
   )
(connect_data =
(SERVER = dedicated)
(service_name = Mydb.bawei)
   )
)

When using a database server-side client tool, it is the same as connecting to a server from a remote client, depending on the user name, password, and network service name (or similar connectusername/ Password@net_service_name SQL command line), locate the Tnsnames.ora file, find a network connection service name equal to Net_service_name, and obtain information such as database host address, listening port, global database name, and so on.

The request information is also transmitted to the listening port, and the listener then E:\Oracle_Server\oracle\ora92\network\ the information to the same folder. Listener.ora Listener Profile in admin, if the Listener.ora listener configuration file contains a matching entry, the request is forwarded to the corresponding database instance.

Thus, the server-side client tool performs the same process as the connection to a remote client with the database service.
in fact, Server-side client tools authenticate and establish connections through server-side Tnsnames.ora and Listener.ora, and remote clients perform authentication and connection through the client's Tnsnames.ora and server-side Listener.ora.

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.