Oracle Net Manager Service naming configuration and landing database with PL/SQL

Source: Internet
Author: User

We know that you need to know four parameters to connect to a database:

1. Login Username: User;

2. Login Password: password;

3. The server address (SERVER_IP) and Port (Server_port) that holds the database;

4. Database name (db_name);

If we want to connect db_name this data, in addition to the user name password, we also need to enter a connection string like "Server_ip:server_port/db_name".

As mentioned above, for a database connection, we often need to remember the three elements of Server_ip, Server_port, and db_name. Once the database is managed more, and there are many databases distributed on different servers, different ports, memory is prone to confusion. To solve this problem, Oracle provides us with a "naming service" that can be configured by opening the Oracle Net Manager tool and selecting "Service naming". Oracle's own explanation is that the service naming folder is used to configure local naming methods. The local naming method is one of the naming methods that can be used to resolve simple name, net service name to the information required to connect to a database or service. " Seeing this official explanation for the first time is often difficult to read. My understanding is that the so-called naming service, is actually a common name mapping to a connection string key-value pair, where key is the name of the "Naming Service", you can choose arbitrarily, such as "ABC", in the future when connecting to the database, only need to enter "ABC" to connect The server, after receiving "ABC", can automatically resolve it to its corresponding value, that is, connect to a database connection string, complete the connection.

PS: "Naming Service" and "service naming" Here are essentially a thing, "naming Service" represents a service, and "service naming" represents a named configuration of the service, which is said to be different aspects of the same thing.

From the above we know that to configure a naming service, it is to configure the three elements of Server_ip, Server_port, and db_name. The following describes the process of configuring a naming service with a graphical interface, before assuming that a database has been created and the global database name is: Kane.test.

1. Open the Oracle Net Manager tool, select the "Service Naming" node, click on the left Green "+" button to eject the "Net Service Naming Wizard"

The "Network Service name" is the custom service name, which is the key mentioned above, can be arbitrarily selected, mainly not with the existing service naming conflicts. If you take my_simple_name here, click Next.

2. Select the communication protocol:

The TCP/IP protocol is used here by default. Click Next.

3. Configure SERVER_IP, Server_port:

The hostname is the server address of the database, and the port number uses the default port of 1521. Click Next.

4. Configure db_name:

The "(oracle8i or later) service name" is the global database name of the database you created earlier. At this point, a service named Server_ip, Server_port, and db_name three features are configured to complete. Click Next.

5. Test or Complete:

Click "Finish" to exit the wizard. Or click the "Test" button to test whether the above configuration is correct:

Make sure that the user ID you used for your test is not locked. You can click on the "Change Login" button to select another account test. If the test fails, go back and check that the configuration for each step above is entered correctly.

6. Back to the Oracle Net Manager Tools main interface, you can see the parameters that have been configured:

7. Be sure not to forget to select the menu "File"-"Save network Configuration" to make the changes take effect.

8. PL/SQL Login:

Because a naming service named "My_simple_name" is already configured, the "Database" entry only needs to fill in the "My_simple_name" string for the connection to succeed.

If the naming service is not configured, the user is required to display the specified database server address, port, and database name, and the following parameters can be successfully connected:

Obviously not as convenient as naming services.

----------------------------------------

This article ends.

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.