Advanced · FAQ
2007-11-01
Global_name从何处来?
我们应该都很熟悉global_name这个词,在进行db link的创建时,通常都需要关注一下global_name.
注意,我这里说的不是初始化参数global_names。
SQL> select * from global_name;那么这个global_name视图的数据来自何处呢?
GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
通过global_name视图的创建语句我们可以获得如下信息:
create or replace view global_name我们看到global_name中的信息实际上是来自props$内部表的,取得的信息是其中的global_db_name字段。
(global_name)
as
select value$ from sys.props$ where name = 'GLOBAL_DB_NAME'
SQL> select value$ from sys.props$ where name = 'GLOBAL_DB_NAME';这里得到的是通常数据库创建的缺省设置,在生产环境中,我们可以通过如下命令来修改Global_name:
VALUE$
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------
WAPDB.REGRESS.RDBMS.DEV.US.ORACLE.COM
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 2019-11-15 数据技术嘉年华北京盛大开启
- 2019-11-01 2019,细数国产的那些和 MySQL 有关都数据库
- 2015-11-01 2015 OOW:Oracle LiveSQL在线SQL学习
- 2011-11-01 《循序渐进Oracle》在China-Pub上的技术专题
- 2009-11-01 2009年冬的第一场雪- 漫天飞舞未觉寒
- 2006-11-01 Oracle Open World 2006文档下载
- 2005-11-01 Gregarius与Lilina,我的Rss历程...
一直疑惑,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.