eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« Streams散记之一-如何清除流配置 | Blog首页 | 装修日记-地板我选安信实木地板 »

Global_name从何处来?
modb.pro

我们应该都很熟悉global_name这个词,在进行db link的创建时,通常都需要关注一下global_name.
注意,我这里说的不是初始化参数global_names。

通过视图global_name可以获得当前参数的设置:

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM

那么这个global_name视图的数据来自何处呢?
通过global_name视图的创建语句我们可以获得如下信息:

create or replace view global_name
(global_name)
as
select value$ from sys.props$ where name = 'GLOBAL_DB_NAME'

我们看到global_name中的信息实际上是来自props$内部表的,取得的信息是其中的global_db_name字段。

SQL> select value$ from sys.props$ where name = 'GLOBAL_DB_NAME';

VALUE$
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM

这里得到的是通常数据库创建的缺省设置,在生产环境中,我们可以通过如下命令来修改Global_name:

SQL> alter database rename global_name to WAPDB.EYGLE.COM;

Database altered

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------
WAPDB.EYGLE.COM

这个global_name为什么很重要呢?
因为在创建db link的时候,db Link的最终格式与此相关,实际上global_name由两部分组成,DB_NAME和DB_DOMAIN。在创建db link的时候,Oracle会自动将db_domain作为后缀添加上去。而且一旦加入就很难变更。

所以在进行高级复制、Streams复制等配置时,最好首先将多个节点的global_name规划好。


-The End-


历史上的今天...
    >> 2019-11-01文章:
    >> 2015-11-01文章:
    >> 2011-11-01文章:
    >> 2009-11-01文章:
    >> 2006-11-01文章:
    >> 2005-11-01文章:

By eygle on 2007-11-01 11:45 | Comments (2) | Advanced | FAQ | 1653 |

2 Comments

一直疑惑,global_names的作用是什么呢?
我发现如果global_names=true的时候,建立的db link是不能正常使用的。
global_names和global_name之间的关系是什么?
谢谢!

The name that you give to a link on the local database depends on whether the remote database that you want to access enforces global naming. If the remote database enforces global naming, then you must use the remote database's global database name as the name of the link. For example, if you are connected to the local hq server and want to create a link to the remote mfg database, and mfg enforces global naming, then you must use mfg's global database name as the link name.


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com