免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: jrlee
打印 上一主题 下一主题

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID [复制链接]

论坛徽章:
0
11 [报告]
发表于 2004-07-03 14:04 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

就我的体会,有时通过sql*net连接远程数据库时,有时必须指定service_name,有时需要指定sid_name但什么时候、在何种条件下需要指哪种设置好象也没什么规律,特别是Wind平台下,unix平台的基本没什么太大问题。service_name(s)和 db_name,instance_name究竟什么关系,我也没太明白。

论坛徽章:
0
12 [报告]
发表于 2004-07-03 14:28 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

----------from oracle metalink-----------
The global names is used by the oem product and needs to be in the sid_desc for oem to function correctly.

Service name is used in the tnsnames.ora file and when the connection using service name arrives at the listener, the listener checks it's tables for a registration match so it can hand of the connection to either a dedicated process or a dispatcher.

service_names in the init.ora file is set to the service_names + the db_domain and these two values should match the service_name parameter in the tnsnames.ora file or a registration error will occur if they do not match. The service_names is the parameter that registers the names listed here with the listener when the instance starts.

The global_dbname and the service name can be different names as long as the service_name matches the registration name registered with the listener.

论坛徽章:
0
13 [报告]
发表于 2004-07-03 14:28 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

--------from oracle metalink--------------
DB_NAME is the database identifier of up to eight characters. If specified, it must correspond to the name specified in the CREATE DATABASE statement. Although the use of DB_NAME is optional, it should generally be set before invoking CREATE DATABASE and then referenced in that statement. If not specified, a database name must appear on either the STARTUP OPEN db_name or ALTER DATABASE db_name MOUNT command line.

INSTANCE_NAME is a string value representing the name of the instance and is used to uniquely identify a specific instance when multiple instances share common services names.

Prior to Oracle 8i, clients connected to a database by specifying the Oracle SID (system identifier) in the connect descriptor. INSTANCE_NAME should not be confused with the SID, which actually uniquely identifies the instances shared memory on a host.

From 8i, the concept of a 'service name' has been introduced. Specifically, clients can specify 'service_name' and 'instance_name' in the connect descriptor. The SERVICE_NAMES is used to identify a database service. This parameters defaults to DB_NAME.DB_DOMAIN (the global database name). A database can be identified by more than one service name. Now INSTANCE_NAME identifies an instance of a database. This parameter is analagous to the SID of an instance, that is "SID_NAME" is now "SERVICE_NAME". Again, an instance can have only one "INSTANCE_NAME," but more than one "SERVICE_NAMES"

E.g.:

instance_name = v817
service_names = ( marketing, support, education )

One more thing to note here is, the parameter is "SERVICE_NAME" in tnsnames.ora and "SERVICE_NAMES" defined in "init<SID>;.ora".

The following articles which you could obtain using the search, will help you:
30715.1 Init.ora Parameter "DB_NAME" Reference Note
68522.1 Init.ora Parameter "INSTANCE_NAME" Reference Note
77640.1 SERVICE_NAME parameter in Oracle8i
76531.1 Service Name Usage in Net8i
69546.1 Oracle8i - Instance Registration to Listeners

论坛徽章:
0
14 [报告]
发表于 2004-07-03 16:35 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

原帖由 "dong_jh" 发表:
8I,9I的rac最好指定服务名,因为多个RAC实例的服务名相同而SID不同,只有指定服务名才能配置故障切换,如果要连到指定的实例,也可以用SID.我想服务名是为了RAC而设立的,不知道对不对?

另外我困惑的一个问题是:服务名..........

论坛徽章:
0
15 [报告]
发表于 2004-07-03 17:36 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

我再init.ora中设了几个service_names=,中间用逗号格开,重启数据库,但好像没有用.

论坛徽章:
0
16 [报告]
发表于 2004-07-03 23:22 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

我的理解是:service_name 是在oracle net 结构下给客户端连接oracle 服务器所提供的服务用的一个标识符,(如销售部门用sales,财务部门用finance等),默认是和global database name一样。oracle推荐的service_name格式是db_name.db_domain。和instance_name一样包含在客户端连接字的connect_data中。而sid_name默认和instance_name是相同的。因为一个或多个实例可以对应一个数据库。所以在连接字中用service_name和instance_name来区分不同的连接。

论坛徽章:
0
17 [报告]
发表于 2004-07-04 20:54 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

为何没用?

论坛徽章:
0
18 [报告]
发表于 2004-07-05 17:08 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

This parameters(service_name) defaults to DB_NAME.DB_DOMAIN ,那么如何把默认的名称改成别的?

论坛徽章:
0
19 [报告]
发表于 2004-07-05 20:20 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

[quote]原帖由 "dong_jh"]This parameters(service_name) defaults to DB_NAME.DB_DOMAIN ,那么如何把默认的名称改成别的?[/quote 发表:


alter system set service_names='new name' scope=spfile;

论坛徽章:
0
20 [报告]
发表于 2004-07-08 13:13 |只看该作者

关于数据库名(db_name)、实例名(instance_name)、ORACLE_SID

这样客户端用这个服务名能连接吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP