Oracle listener (listener) Configuration

Source: Internet
Author: User
Although Oracle has been used for many years, it has been used only for a long time and has not gone deep into oracle's stuff. For the first time, you have created and configured an oracle service on the server.

Although Oracle has been used for many years, it has been used only for a long time and has not gone deep into oracle's stuff. For the first time, you have created and configured an oracle service on the server.

I. original configuration Intention

Although Oracle has been used for many years, it has been used only for a long time and has not gone deep into oracle's stuff. For the first time, if you create a complete oracle server on the server and configure an oracle Server, the problem immediately arises:

Severe:The listener is not started or the database service is not registered with the listener. Start the listener and register the Database Service,Then run EM Configuration Assistant again.

For more information,See D:\ Oracle \ Logging toollogs \ dbca \ orcl \ emConfig. log.

Refer:

But it never solves this problem. (Ps: it may be my own problem)

So I decided to pick up my sleeves and learn the listener in oracle across the border.

Ii. Listener principles

For more information about listeners, see this article:

Next, let's talk about my own understanding:

First, I think the listener uses the proxy mode, and the listener is exactly the proxy described in the proxy mode. When the client initiates a request to the database, the listener acts as the proxy of the client and sends a request to the database instance. When the server process of the database instance receives a request forwarded by the listener, it responds. This response is also forwarded to the client through the listener. It is not difficult to find that the interaction between the client and the database instance is indirectly completed, and there is a man-in-the-middle listener between them.

However, the client never knows what the database instance he requested is, the only thing you know is the name of a service on the server where the database is located, and the username and password assigned to the database. This is like buying an Apple product. When we buy it, we only go to the store of the agent. We only know which OEM produces the product that Apple sells, we do not know anything as a consumer.

However, in the final analysis, there should always be a mechanism to maintain the relationship among "service", "listener", and "database instance. The answer is yes. Please refer to the following content.

3. Three configuration files: sqlnet. ora, tnsnames. ora, listener. ora (Path: $ oracle_home \ NETWORK \ ADMIN; by default, this is probably the case: D: \ app \ Administrator \ product \ 11.2.0 \ dbhome_2 \ NETWORK \ ADMIN)

Consider one of the following situations:

Assume that we need to connect to an instance named mzoa on the database, and the database instance contains an account with the password a and username sysman. However, we do not know the name of this database instance. We only know that this database server provides a "service" named "mzoa ", we know nothing about the name of the database instance we need to request. However, even so, we can still connect to the database instance we need to find-mzoa. (Ps: the Instance name "mzoa" is not necessarily the same as the service name "mzoa". You can modify it when creating an instance !)

Believe it? Let's take a look at the following ......

We can complete the following connection operations in cmd:

C

Copyright(C) 1982,2010, Oracle. All rights reserved.


Connect:
Oracle Database11G Enterprise Edition Release11.2.0.1.0-Production
With the Partitioning,OLAP,Data Mining and Real Application Testing options

SQL>

Why? I think the above three configuration files: sqlnet. ora, tnsnames. ora, listener. ora are enough to explain the problem.

We first classify these three configuration files. Sqlnet. ora, tnsnames. ora belongs to the client, and listener. ora belongs to the server.

Class 1: client files: sqlnet. ora, tnsnames. ora

During the above operations, we used the following statements:

Sqlplus sysman/A @ I _AM_SERIVCE

"I _AM_SERIVCE" is not a "service" name, but what is the meaning of this name. We need to explain the oracle client. (Note: The oracle client here refers to the process set corresponding to the oracle client software)

The oracle client explains the name "I _AM_SERIVCE" in this way:

Step 1:

View the sqlnet. ora configuration file. The content is as follows:

SQLNET. AUTHENTICATION_SERVICES= (NT)

NAMES. DIRECTORY_PATH= (TNSNAMES,HOSTNAME,EZCONNECT)

The second entry NAMES. DIRECTORY_PATH, from left to right, indicates which files are used to explain the name first.

The above example indicates that the file TNSNAMES. ora is used first, and then the hosts file of the system where the client is located ...... Explanation name

Step 2:

Because the sqlnet. ora file indicates that it is first interpreted by the TNSNAMES. ora file.

Check the TNSNAMES. ora file, which contains the following content about "I _AM_SERIVCE:

I _AM_SERIVCE=
(DESCRIPTION=
(ADDRESS= (PROTOCOL=TCP)(HOST=127.0.0.1)(PORT= 1521))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=Mzoa)
)
)

Here we can clearly see the details about the name of "I _AM_SERIVCE. With this name, we can request the address of the database server: 127.0.0.1, and the name of "service" is "mzoa ".

Port: 1521 is the port number that the listener is listening to in this article.

With the above information, we can know that client requests can be sent to the listener (listener) by accessing the server "service.

Type 2: SERVER: listener. ora.

The description is as follows:

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.