Oracle database的names(名字們)

Allen2312發表於2009-03-15

Oracle database的names(名字們)

前兩天在做一個Data Duard時候,開始主備庫的instance name不一樣,但是後來客戶說我們這邊都是兩層結構的,所以如果切換到備庫上,客戶端需要每個都修改tnsnames.ora檔案,ip地址我們可以改,但是instance name怎麼辦啊?
還真沒太注意這個問題,因為以前應用都是有中介軟體的,修改中介軟體配置就好了,這個咋辦呢?那就把備庫instance name改了吧!應該怎麼改呢?基礎概念這時候就很重要了,我還真沒仔細想過這個問題,那instance name能在哪個級別修改呢?開始感覺應該記錄在control file中,但是後來想想好像又不是,應該可以直接修改的,不確定啊,先試試再說,windows環境,直接將備庫shutdown,然後delete instance 服務,加入新的instance服務,啟動資料庫到nomount,ok,alter database mount,ok,接受應用歸檔,ok!!

搞清楚了,instance name應該是系統級別的服務,所以可以修改,那就看看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.

 

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_UNIQUE_NAME
Property Description
Parameter type String
Syntax DB_UNIQUE_NAME = database_unique_name
Default value Database instances: the value of DB_NAME
Automatic Storage Management instances: +ASM
Modifiable No
Basic Yes
Real Application
Clusters
Multiple instances must have the same value.

DB_UNIQUE_NAME specifies a globally unique name for the database. Databases with
the same DB_NAME within the same DB_DOMAIN (for example, copies of a database
created for reporting or a physical standby) must have a unique DB_UNIQUE_NAME.
Every database's DB_UNIQUE_NAME must be unique within the enterprise.
The value of DB_UNIQUE_NAME can be up to 30 characters and is case insensitive. The
following characters are valid in a database name: alphanumeric characters,
underscore (_), number sign (#), and dollar sign ($).


SERVICE_NAMES
Property Description
Parameter type String
Syntax SERVICE_NAMES =
db_service_name [, db_service_name [ ... ] ]
Default value DB_UNIQUE_NAME.DB_DOMAIN if defined
Modifiable ALTER SYSTEM
Range of values Any ASCII string or comma-separated list of string names
Basic No
Real Application
Clusters
Do not set the SERVER_NAMES parameter for Real Application
Clusters (RAC). Instead, define services using Database Configuration
Assistant (DBCA) and manage services using Server Control
(SRVCTL) utility.

SERVICE_NAMES specifies one or more names by which clients can connect to the
instance. The instance registers its service names with the listener. When a client
requests a service, the listener determines which instances offer the requested service
and routes the client to the appropriate instance.
You can specify multiple service names in order to distinguish among different uses of
the same database. For example:
SERVICE_NAMES = sales.acme.com, widgetsales.acme.com
You can also use service names to identify a single service that is available from two
different databases through the use of replication.
If you do not qualify the names in this parameter with a domain, Oracle qualifies them
with the value of the DB_DOMAIN parameter. If DB_DOMAIN is not specified, then no
domain will be applied to the non-qualified SERVICE_NAMES values.


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.
See Also:
■ Oracle Database Performance Tuning Guide for more information on
setting this parameter
■ The data dictionary view "GLOBAL_NAME" on page 5-52
Property Description
Parameter type Integer
Default value The default value corresponds to the maximum I/O size that can be
efficiently performed and is platform-dependent
Modifiable ALTER SESSION, ALTER SYSTEM
Range of values Operating system-dependent
Basic No

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 DB_DOMAIN = US.ACME.COM.
If you omit the domains from the name of a database link, Oracle expands the name by
qualifying the database with the domain of your local database as it currently exists in
the data dictionary, and then stores the link name in the data dictionary. The characters
valid in a database domain name are: alphanumeric characters, underscore (_), and
number sign (#).

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/122290/viewspace-567401/,如需轉載,請註明出處,否則將追究法律責任。

相關文章