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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/122290/viewspace-567401/