Differences between ORACLE Database Name, Instance name, And ORACLE_SID

Source: Internet
Author: User


Differences between ORACLE Database Name, Instance name, ORACLE_SID 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, that is, the database domain name (db_domain), service name (service_name), and operating system environment variable (ORACLE_SID ). These IDS exist in the same database and are used to differentiate parameters of different databases. Www.2cto.com 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. Www.2cto.com 2. What is the database instance name (instance_name)? The database instance name is used for the connection with the operating system and used for external connections. To obtain interaction with databases in the operating system, you must use the database instance name. For example, to connect to a database server, you must know its database instance name. It is useless to know only the database name. Unlike the database name, after the data is installed or the database is created, the instance name can be modified. After the database is installed, the Instance name is written to the pfile of the database parameter file in the following format: 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? (Often confused) (ORACLE_SID) OS <----------------> ORACLE database <-------- (Instance_name (Instance name) represents the relationship between the Instance name instance_name, ORACLE_SID, and the database and operating system, although the two parameters listed here are database instance names, the instance_name parameter is an ORACLE database parameter, 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 is used in the same way as ORACLE_BASE and ORACLE_HOME. After the database is installed, ORACLE_SID is used to define the name of the database parameter file. For 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. In this case, you can repeat the above definition process to select different instances. You can also use [oracle @ Datacent] $. oraenv to switch 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.