Oracle Database knowledge

Source: Internet
Author: User

1. Oracle Database Name

The database name is the "ID number" of the database, used to identify a database. DB_NAME is used in the parameter file.

The database name must be used to install the database, create a new database, create a database control file, modify the database structure, and back up and restore the database.

How can I view the database name? There are three methods:

· Use the SQL statement: select name from v $ database;
· Run the show command: show parameter db_name;
· View the parameter file: view the init. ora File

Ii. database instance name

The database instance name is the identifier used to contact the operating system. That is to say, the interaction between the database and the operating system uses the database instance name.

The instance name is also written to the parameter file. The parameter is instance_name. On the winnt platform, the Instance name is also written to the Registry.

The Database Name and Instance name can be the same or different. In general, the database name and Instance name are one-to-one, but in the oracle Parallel Server Architecture (that is, the oracle Real-time application cluster, the Database Name and Instance name are one-to-multiple relationships.

How can I view the name of the current database instance? There are three methods:

· Use the SQL statement: select instance_name from v $ instance;
· Use the show command: show parameter instance
· View the parameter file: view the init. ora File

Both the database instance name and ORACLE_SID indicate oracle instances, but they are different.

Instance_name is an oracle database parameter. ORACLE_SID is the environment variable of the operating system. ORACLD_SID is used to interact with the operating system. That is to say, the Instance name accessed from the operating system must be accessed through ORACLE_SID.

ORACLE_SID must be consistent with instance_name. Otherwise, you will receive an error. On the unix platform, it is "ORACLE not available" and on the winnt platform, it is "TNS: protocol adapter error ".

Iii. Database domain name and Global Database Name

With the popularization of distributed databases composed of multiple databases, this command database method imposes a certain burden on database management, because the names of each database may be the same, resulting in management confusion.

To solve this problem, the Db_domain parameter is introduced. In this way, the database identifier is determined by the two parameters Db_name (Database Name) and Db_domain (Database domain name, this avoids management confusion caused by duplicate database names. 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 (Global Database Name), which extends Db_name. The Db_name parameter can only contain letters, numbers, '_', '#', and '$', and can contain a maximum of 8 characters.

For the unique identifier of a Network 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 alter database rename GLOBAL_NAME Command, and then modify the corresponding parameters.

How can I query database domain names? There are three methods:

· Run the SQL command: select value from v $ parameter where name = 'db _ domain ';
· Use the show command: show parameter domain
· View the parameter file: Query it in the parameter file.


Iv. Database 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. The Service_name parameter is introduced to facilitate settings in the parallel environment. This parameter corresponds to a database, not an instance.

The default value of this parameter is Db_name. Db_domain, which is equal to Global_name. If the database has a domain name, the Database Service name is the global database name; otherwise, the Database Service name is the same as the database name.
How can I query the database service name? There are three methods:
· Use the SQL statement: select value from v $ parameter where name = 'service _ name ';
· Use the show command: show parameter service_name
· View the parameter file: Query it in the parameter file.

The oracle network component opened from oracle8i. The connection host string between the database and the client uses the Database Service name. Previously, ORACLE_SID was used, that is, the database instance name.

V. Network 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.

The Network Service name is from the client perspective. When the client connects to a remote database or other services, you can specify the Net service name. Therefore, you must use one or more naming methods to resolve the Net service name to the connection descriptor of the connected database or other services.

Generally, select [local]-resolve the network service name stored in the tnsnames. ora file of the local client to the connection descriptor.
[Oracle Names]-The Oracle name server provides Resolution Methods for each Oracle Net service on the network.
[Host Name]-connect to the Oracle Database Service through the host alias in the TCP/IP Environment
[Sun NIS]/[dce cds]-applicable systems, not applicable in Windows 2000.

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.