Recently, because some people asked in this area, I will pay my understanding of the relevant information, if not, or improperly, I hope to correct it.
Database name (db_name), instance name (instance_name), and operating system environment variable (Oracle_SID)
Only the database name (db_name) and database instance name (instance_name) are only in the Oracle7,8 database. New parameters appear in Oracle8i, 9i, that is, database domain name (DB_DOMAIN), service name, and operating system environment variables (Oracle_SID). These are existing in the identity in the same database, used to distinguish parameters of different databases.
First, what is the database name (DB_NAME)? The database name is the internal ID of the data is used to store the parameters stored in the database control file in the binary. It will not be modified after data installation or creation. After the database installation is complete, this parameter is written to the database parameter file PFILE, the format is as follows:
[CODE: 1: 1AAF156970] ......... DB_NAME = "ORCL" # (not allowed) DB_DOMAIN = dbcenter.toys.com instance_name = orcl service_names = orcl.dbcenter.toys.com control_file = (. ............................... [/ code: 1: 1AAF156970]
There is a database name (DB_NAME) in each running Oracle8i database, and two database names are created if two databases are created in a server program. Its Control Starters are associated with relevant databases in different PFILEs.
Second, what is the database instance name (instance_name) database instance name is used to contact between the operating system for use when connecting to external connections. In the operating system, you must use the interaction between the database and you must use the database instance name. For example, if you want to connect to a database server, you must know its database instance name, just know that the database name is useless, unlike the database name, after the data is installed or created, the instance name can be modified. After the database installation is complete, the instance name is written to the database parameter file Pfile, the format is as follows: [CODE: 1: 1AAF156970] DB_NAME = "ORCL" # (not allowed) DB_DOMAIN = DBCenter.toys.com instance_name = Orcl # Can be modified, different can also be different from DB_NAME) service_names = orcl.dbcenter.toys.com control_file = (............................. : 1: 1AAF156970] The relationship between the database name and the instance name. The relationship between the database name and the instance name is generally a correspondence, there is a database name with an instance name, if you create two databases in a server There are two database names, two database instance names, determine one database, user, and instance connection with two identifiers. However, in the parallel server structure of 8i, 9i, there is no corresponding relationship between the database and the instance But a couple of relationships, (a database corresponds to multiple instances, the user only one instance is connected in the same time, when a certain instance fails, other instances are automatically serving to ensure safe operation of the database.)
Third, the operating system environment variable (Oracle_SID) In practice, the description of the database instance name sometimes uses the instance name (instance_name) parameter, sometimes using the Oracle_SID parameter. Both are all database instance names, what is the difference? (Often fill) [Code: 1: 1AAF156970] ----------------> Oracle Database <-------- (instance_name) ))
[/ Code: 1: 1AAF156970] Distraits the relationship between the instance-name instance_name, oracle_sid, and the database and the operating system, although the two parameters listed here are the database instance name, but the instance_name parameter is the parameter of the Oracle database, this The parameters can be queried in the parameter file, and the Oracle_SID parameter is the operating system environment variable. Operating system environment variable Oracle_sID is used to interact with the operating system. That is to say, in the operating system, you must use the instance name, you must use Oracle_SID. This parameter is the same as Oracle_Base, Oracle_home. After the database installation, Oracle_sid is used to define the name of the database parameter file. Such as: $ oracle_base / admin / db_name / pfile / init $ oracle_sid.ora. Definition method: [code: 1: 1AAF156970] export oracle_sid = orcl [/ code: 1: 1AAF156970]
If multiple databases are created in the same server, there must be multiple database instances at the same time, and the above definition process can be repeated to select different instances.
You can also use [CODE: 1: 1AAF156970] [Oracle @ Datacent] $. Oraclev [/ Code: 1: 1AAF156970]
To switch different Oracle_sids to start different instances (Instance) through the operating system