Different database naming methods in Oracle

Source: Internet
Author: User
[Db_name :]
The unique identifier of a database (Oracle database), which is the Oracle database described in Chapter 1. This expression is sufficient for a single database, but with the popularization of distributed databases composed of multiple databases, this method of Command database creates a certain burden on database management, because the names of various databases may be the same, resulting in management confusion. To solve this problem, the db_domain parameter is introduced. In this way, the database ID is determined by the two parameters db_name and db_domain, avoiding management confusion caused by database name duplication. This is similar to managing machine names on the Internet. We connect the parameters db_name and db_domain with '.' to indicate a database, and the database name is global_name, that is, it extends db_name. The db_name parameter can only contain letters, numbers, '_', '#', and '$', and can contain a maximum of 8 characters.


[Db_domain :]
Define the domain where a database is located. The domain name has nothing to do with the 'region' on the Internet. It is determined by the database administrator to better manage the distributed database. Of course, to facilitate management, it can be equal to the domain of the Internet.


[Global_name :]
For the unique identifier of a database (Oracle database), we recommend that you use this method to command the database. This value is determined when you create a database. The default value is db_name. db_domain. Any modifications to the parameters of db_name and db_domain In the parameter file will not affect the value of global_name. To modify global_name, you can only use the alter database rename global_name to <db_name.db_domain> command to modify it, modify the parameters.

[SERVICE_NAME :]
This parameter is newly introduced by Oracle8i. Before 8i, we used Sid to identify an instance of the database. However, in the parallel environment of Oracle, a database corresponds to multiple instances, so that multiple network service names are required, configuration is cumbersome. To facilitate the setting in the parallel environment, the SERVICE_NAME parameter is introduced, which corresponds to a database rather than an instance, and has many other advantages. The default value of this parameter is db_name. db_domain, which is equal to global_name. A database can correspond to multiple service_names for more flexible configuration. This parameter has no direct relationship with Sid, that is, the service name must be the same as the SID.

In tnsnames. ora, either SERVICE_NAME or Sid can be used.

[Net service name :]
The Network Service name, also known as the database alias (Database alias ). It is required when the client program accesses the database. It shields the details of how the client connects to the server and achieves the location transparency of the database. The Network Service name is recorded in the tnsnames. ora file.

=== About the error ORA-12154: ====
Sometimes, even if there is a corresponding network service name in the tnsnames. ora file, an error occurs when you connect to the network service name. The typical configuration for this situation is as follows (on the client machine ):
Tnsnames. ora contains:

Hzuat =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 10.18.1.102) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = hzuat)
)
)

Sqlnet. ora contains:

Names. default_domain = staff.ebao.com

The ora-12154 error is reported when user/passwd @ hzuat is used to connect. This is because the sqlplus program will automatically go to The sqlnet. ora file to find the names. default_domain parameter. If this parameter exists, it will take out the value of this parameter and add it to the name of the network service. Solution 1: Delete names. default_domain, and change tnsnames. ora
Hzuat. com =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 10.18.1.102) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = hzuat)
)
)

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.