Step 3 of Oracle Listener Configuration

Source: Internet
Author: User

When configuring Oracle listeners, we will inevitably encounter related problems. For example, the Client cannot connect to the Server ). This article first gives a brief introduction to the Oracle listener, and then describes the detailed steps of the Listener Configuration.

1. Oracle LISTENER (LISTENER)

Listener is a server-based network service of Oracle. It is mainly used to listen for connection requests from clients to database servers. Since it is a server-based service, it only exists on the database server, and listener settings are also completed on the database server.

2. Local Service name (Tnsname)

The connection between the Oracle client and the server is a connection request sent by the client. The Oracle listener of the server checks the client connection request validity. If the connection request is valid, the connection is performed. Otherwise, the connection is rejected.

The local service name is a type of network configuration for the Oracle client, as well as the Oracle Names Server. The common client configuration in Oracle is the local service name. This article describes the configuration based on the local service name.

Iii. Oracle network connection Configuration

You can configure the Oracle server and client in the graphical Oracle Network Manager (Oracle Net Manager). We strongly recommend that you configure the Oracle server or client with this graphical tool ). In Windows, click Start/Program/Oracle-OraHome92/Configuration and Migration Tools/Net Manager ". Start the Oracle network manager tool. In Linux/Unix, run the netmgr command to start the graphical Oracle Network Manager, such as $ netmgr.

1. Oracle LISTENER configuration (LISTENER ):

1) Select the listener item in the tree directory, click "+" on the upper left side, click the button to add the listener, and click the listener directory, by default, the added Oracle LISTENER name is LISTENER (this name can also be named by any legal character ).

2) Select the name, select "listener location" in the drop-down box on the right of the window, and click "add address. Select "TCP/IP" from the Protocol drop-down option in the Network Address Bar, and enter the host name or IP address in the host text box (if the host is used as the server or as the client, either of the two items is valid. If the host acts as the server and needs to be connected over the network, we recommend that you enter an IP address), enter a number in the port text box, the default value is 1521, you can also customize any valid digital port.

3) Select "Database Service" in the drop-down list on the right of the window and click "add Database. In the displayed database column, enter the global database name, for example, myoracle. Note that the global database name is different from the data warehouse SID. The global database name actually controls the uniqueness of the global database name in the same network segment through the domain name, such as the domain name controller in Windows, for example, enter myoracle.192.168.1.5. You can enter the SID for the Oracle main directory, for example, myoracle.

Save the preceding configuration. By default, you can find the listening configuration file in the Oracle Installation Directory (for example, D: oracleora92 etworkadminlistener in Windows. ora, $ ORACLE_HOME/network/admin/listerer in Linux/Unix. ora ). So far, the Listener Configuration for the Oracle server has been completed.

2. Local Service name configuration (Tnsnames ):

The local service name is based on the network configuration of the Oracle client. Therefore, if the client needs to connect to the database server for operations, you need to configure the client, the attached object can be any PC that wants to connect to the data warehouse server for operation, or the database server itself. As described earlier, you can use NetManager, a graphical management tool provided by Oracle, to configure the Oracle client.
1) Select the service name, and then click "+" on the top left.
2) enter the Net service name, such as myoracle, and click Next.
3) Select TCP/IP and click Next.
4) enter the host name and port number. Note: The host name and port number must be the same as the host name and port number configured by the listener on the database server. Click Next
5) Select the service name (Oracle8i or a later version) and enter the service name. The service name here is actually the global database name in the Listener Configuration of the database server. The former must be the same as the latter. The connection type is usually a dedicated server, which depends on the database server configuration. If the Oracle listener is configured with a shared database server, the connection type here must be a shared server, otherwise, we recommend that you select a dedicated server (for more information about the dedicated server, see the relevant documentation ). Click Next after Configuration

If the related services on the database server are started, click the test button to test the connection. By default, Oracle uses scott/tiger users to test connections. Since scott is an example user of Oracle, this user may not be configured for formal business databases or professional Test Databases, therefore, you must change it to a valid user logon before the test is successful. If the connection test fails, click "finish" to complete the configuration.

Go back to the main window of Oracle Network Manager (Oracle Net Manager) and save the configuration. By default, you can find the local service name configuration file under the Oracle Installation Directory (for example, D: oracleora92 etworkadminnsnames in Windows. ora, $ ORACLE_HOME/network/admin/tnsnames in Linux/Unix. ora ).

The service name in the tree directory can be changed to a service name composed of any valid characters by renaming the menu in the editing menu. Note that the service name cannot contain spaces before it; otherwise, the database server may not be connected.

3. Connect to the database server:

1) Start the server listener and Database Service:
A. in Linux/Unix,
Start Oracle listener: $ lsnrctl start.
Disable listener: $ lsnrctl stop.
View the listening status: $ lsnrctl status.
Start the database: $ sqlplus/nolog.

SQL> conn sys @ myoracle as sysdba -- Here myoracle is the local service name of the client configured earlier.
Or SQL> conn/as sysdbaSQL> startup

B. in Windows,
Start Oracle listener: C: lsnrctl start.
Start Oracle instance service: C: oradim-startup-sid myoracle.
Close the Oracle instance service: C: oradim-shutdown-sid myoracle.

The above services must be started at the same time before the client can connect to the database. Because the Listener name configured by default is Listener, the preceding command can start the Oracle Listener normally. If the Listener name is another name, such as aListener, you must start the Listener in the following ways:
In Linux/Unix: $ lsnrctl start aListener.
In Windows: C: lsnrctl start aListener.

2) Test the connection to the Database Server

The test methods are diverse. You can perform the test when configuring the local service name or a third-party client tool, such as PL/SQL Developer. the most convenient way is to use the SQLplus tool that comes with Oracle, the following uses SQLplus for testing: C: sqlplus/nologSQL> conn zgh @ myoracle is connected.

  1. Six connection problems and solutions for Oracle listeners
  2. How to install and configure Oracle listeners
  3. Oracle listener, let you listen to what you want
  4. Analysis of Oracle listener installation and configuration
  5. Explore how to collect Oracle listener log files

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.