Differences between Oracle Database Name, Instance name, And oracle_sid

Source: Internet
Author: User
Database Name (db_name), Instance name (instance_name), and operating system environment variable (oracle_sid)

 
In oracle7 and 8 databases, only the Database Name (db_name) and database instance name (instance_name) are available ). A new parameter is displayed in Oracle8i and 9i.
Database domain name (db_domain), service name (SERVICE_NAME), and operating system environment variable (oracle_sid ). These exist in the same data.
Database identifier, used to distinguish parameters of different databases.

1. What is the database name (db_name )?

The database name is an internal identifier used to differentiate data. It is a parameter stored in the database control file in binary mode. It cannot be modified after the data is installed or created. After the database is installed, this parameter is written to the pfile file of the database parameter file in the following format:

.........
Db_name = "orcl" # (cannot be modified)
Db_domain = dbcenter.toys.com
Instance_name = orcl
Service_names = orcl.dbcenter.toys.com
Control_file = (...............
.........

Each running Oracle8i Database has a database name (db_name). If two databases are created in a server program, there are two database names. Its Control Parameter Data belongs to different pfiles that control related databases.

  Ii. What is the database instance name (instance_name)

 
The database instance name is used for external connection with the operating system. To obtain interaction with databases in the operating system, you must use the database instance name. For example
Database Server connection requires you to know the database instance name. It is useless to know only the database name. Unlike the database name, the Instance name can be modified after data is installed or the database is created. Database Installation
The instance name is written to the pfile of the database parameter file. The format is as follows:

Db_name = "orcl" # (cannot be modified)
Db_domain = dbcenter.toys.com
Instance_name = orcl # (it can be modified. It can be the same or different from db_name)
Service_names = orcl.dbcenter.toys.com
Control_file = (...............
.........

The relationship between the database name and Instance name.

The relationship between database names and instance names is generally a one-to-one correspondence. A database name has an Instance name. If you create two databases on a server, there are two database names, two database instance names are used to identify a database. The user and instance are connected.

However, in the 8i and 9i Parallel Server structures, there is no one-to-one correspondence between the database and the instance, but a one-to-many relationship (one database corresponds to multiple instances, within the same time, the user is associated with only one instance. When an instance fails, other instances are automatically served to ensure the safe operation of the database .)

  Iii. Operating System Environment Variable (oracle_sid)

In practice, the description of the database instance name sometimes uses the Instance name (instance_name) parameter, and sometimes uses the oracle_sid parameter. The two are database instance names. What are their differences? (Frequent obfuscation)

(Oracle_sid)
OS <----------------> Oracle database <-------- (instance_name (Instance name ))

 
The relationship between the Instance name instance_name and oracle_sid and the database and the operating system. Although the two parameters listed here are both database instance names
The instance_name parameter is a parameter of the Oracle database, which can be queried in the parameter file, while the oracle_sid parameter is an operating system environment variable.
The operating system environment variable oracle_sid is used to interact with the operating system. That is to say, to get the Instance name in the operating system, you must use oracle_sid. This parameter corresponds
The usage of oracle_base and ORACLE_HOME is the same. After the database is installed, oracle_sid is used to define the name of the database parameter file. Example: $
Oracle_base/admin/db_name/pfile/init $ oracle_sid.ora.

Definition method:

Export oracle_sid = orcl

If multiple databases are created on the same server, multiple database instances must exist at the same time. You can repeat the preceding definition process to select different instances.

You can also use

[Oracle @ datacent] $. oraenv

Different oracle_sid to start different instances through the Operating System)

 

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.