在Oracle中有關資料庫和資料庫實例的幾個重要概念,有時候如果理解不是很深或者對其疏忽、混淆了,還真容易搞錯或弄不清其概念,下麵就資料庫實例名、資料庫名、資料庫功能變數名稱、資料庫服務名、全局資料庫名幾個概念,我們來梳理一下概念,總結歸納一下這些知識,首先,我們來看看官方文檔對這幾者的概念介紹: INST... ...
在Oracle中有關資料庫和資料庫實例的幾個重要概念,有時候如果理解不是很深或者對其疏忽、混淆了,還真容易搞錯或弄不清其概念,下麵就資料庫實例名、資料庫名、資料庫功能變數名稱、資料庫服務名、全局資料庫名幾個概念,我們來梳理一下概念,總結歸納一下這些知識,首先,我們來看看官方文檔對這幾者的概念介紹:
INSTANCE_NAME(資料庫實例名)
Property | Description |
Parameter type | String |
Syntax | INSTANCE_NAME = instance_id |
Default value | The instance's SID Note: The SID identifies the instance's shared memory on a host, but may not uniquely distinguish this instance from other instances. |
Modifiable | No |
Range of values | Any alphanumeric characters |
Basic | No |
In a Real Application Clusters environment, multiple instances can be associated with a single database service. Clients can override Oracle's connection load balancing by specifying a particular instance by which to connect to the database. INSTANCE_NAME specifies the unique name of this instance.
In a single-instance database system, the instance name is usually the same as the database name.
Oracle Instance是指一組後臺進程(在Windows上是一組線程)和一塊共用記憶體區域。實例名(instance_name)就是用來標識這個instance的一個名稱而已。
DB_NAME(資料庫名)
Property | Description |
Parameter type | String |
Syntax | DB_NAME = database_name |
Default value | There is no default value. |
Modifiable | No |
Basic | Yes |
Real Application Clusters | You must set this parameter for every instance. Multiple instances must have the same value, or the same value must be specified in the STARTUP OPEN SQL*Plus command or the ALTER DATABASE MOUNT SQL statement. |
DB_NAME specifies a database identifier of up to 8 characters. This parameter must be specified and must correspond to the name specified in the CREATE DATABASE statement.
If you have multiple databases, the value of this parameter should match the Oracle instance identifier of each one to avoid confusion with other databases running on the system. The value of DB_NAME should be the same in both the standby and production initialization parameter files.
The database name specified in either the STARTUP command or the ALTER DATABASE ... MOUNT statement for each instance of the cluster database must correspond to the DB_NAME initialization parameter setting.
The following characters are valid in a database name: alphanumeric characters, underscore (_), number sign (#), and dollar sign ($). No other characters are valid. Oracle removes double quotation marks before processing the database name. Therefore you cannot use double quotation marks to embed other characters in the name. The database name is case insensitive.
DB_NAME Initialization Parameter
DB_NAME must be set to a text string of no more than eight characters. During database creation, the name provided for DB_NAME is recorded in the datafiles, redo log files, and control file of the database. If during database instance startup the value of the DB_NAME parameter (in the parameter file) and the database name in the control file are not the same, the database does not start.
簡單來說,資料庫名是資料庫的名稱標識,它是在創建資料庫的時候確定的,一旦確定,不能更改。該信息存在於初始化文件,控制文件、redo log文件以及數據文件等地方。
DB_DOMAIN(資料庫功能變數名稱)
Property | Description |
Parameter type | String |
Syntax | DB_DOMAIN = domain_name |
Default value | There is no default value. |
Modifiable | No |
Range of values | Any legal string of name components, separated by periods and up to 128 characters long (including the periods). This value cannot be NULL. |
Basic | Yes |
Real Application Clusters | You must set this parameter for every instance, and multiple instances must have the same value. |
In a distributed database system, DB_DOMAIN specifies the logical location of the database within the network structure. You should set this parameter if this database is or ever will be part of a distributed system. The value consists of the extension components of a global database name, consisting of valid identifiers (any alphanumeric ASCII characters), separated by periods. Oracle recommends that you specify DB_DOMAIN as a unique string for all databases in a domain.
This parameter allows one department to create a database without worrying that it might have the same name as a database created by another department. If one sales department's DB_DOMAIN is JAPAN.ACME.COM, then their SALES database (SALES.JAPAN.ACME.COM) is uniquely distinguished from another database with DB_NAME = SALES but with