In recent times, many netizens raised questions about Listener Configuration, and the Client cannot connect to the Server ). This article briefly introduces the Listener Configuration and provides PLSQL
In recent times, many netizens raised questions about Listener Configuration, and the Client cannot connect to the Server ). This article briefly introduces the Listener Configuration and provides PL/SQL
In recent times, many netizens raised questions about Listener Configuration, and the Client cannot connect to the Server ). This article briefly introduces the Listener Configuration, provides detailed configuration methods for PL/SQL Developer to connect to the Oracle database, and puts forward some solutions that the client terminal cannot connect to the server, we hope to help the majority of netizens and readers.
1. 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 server listener checks the client connection request legally. 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
To configure the Oracle server and client, you can use the built-in graphical Oracle Network Manager (Oracle Net Manager) (we strongly recommend that you configure the Oracle server or client with this graphical tool ). In Windows, the Net Manager image window is displayed as follows:
1. Oracle LISTENER configuration (LISTENER)
As shown in, select the listener item in the tree directory, click "+" on the upper left side to add the listener, and click the listener directory, by default, the added LISTENER name is LISTENER (this name can also be named by any valid character ). Select the name, select "listener location" from the drop-down menu on the right of the window, and click the Add address button. 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. The configured listening location is shown as follows:
Select "Database Service" from 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 database SID here. 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. Shows the complete database service configuration:
Save the preceding configuration. By default, you can find the listening configuration file in the Oracle Installation Directory (for example, D:/oracle/ora92/network/admin/listener. ora in Windows ).
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 to connect to the database server for operation, or the database server itself. As described earlier, you can use the Net Manager graphical management tool provided by Oracle to configure the Oracle client. Select the service name in (1), and click "+" in the upper left corner. The displayed dialog box is displayed:
Enter the Net service name, such as myoracle, and click Next To Go To The displayed dialog box:
Select TCP/IP (Internet Protocol) and click Next, as shown in:
Enter the host name and port number. Note that 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, as shown in:
Select the service name (Oracle8i or later) 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 configuration of the database server. If the shared database server is configured, 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 ). After configuration, click Next, as shown in:
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 in the Oracle Installation Directory (for example, D in Windows: /oracle/ora92/network/admin/tnsnames. ora ). The configured local service name is shown as follows:
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.
After the configuration is complete, the Oracle client should be able to connect to a remote Oracle database.
3. Use PL/SQL Developer to connect to the database
Enter the UserName, Password, DateBase, and Connect AS of the remote Database to Connect to the Database.
Related reading:
Rlwrap
SQLPLUS spool to dynamic Log File Name
Oracle SQLPLUS prompt settings
Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)