ITPub博客

首页 > 数据库 > Oracle > Global_names导致DataBase links报ora_02085错误

Global_names导致DataBase links报ora_02085错误

原创 Oracle 作者:xueting86 时间:2009-07-17 15:13:23 0 删除 编辑

资料:

ORA-02085 database link string connects to string

Cause: The database link attempted to connect to a database with a different name. The name of the database link must be the same name as the name of the database.

Action: Create a database link with the same name as the database to which it connects.

GLOBAL_NAMES: specifies whether a database link is required to have the same name as the database to which it connects. If the value of GLOBAL_NAMES is false, then no check is performed. If you use or plan to use distributed processing, Oracle Corporation recommends that you set this parameter to true to ensure the use of consistent naming conventions for databases and links in a networked environment.

虽然当GLOBAL_NAMES参数设置为TRUE时,DATABASE LINK的名称必须与被连接库的GLOBAL_NAME一致,但是今天的情况是重新建立DBLink的时候name总是自动增加name.US.ORACLE.COM(PL/SQL Develop)工具,无法达到一致的效果。所以考虑更改系统的Global_Names参数。

查询:select * from global_name;

show parameters global_names;

alter system set global_names= false;

以下资料摘录(http://www.laoxiong.net/database_link_global_names.html)参数设置为FALSE,影响的是创建数据库链接的那个库对数据库链接的使用。也就是说,如果一个库(实例)的global_names参数设值为TRUE,则该库连接其他库的数据库链接,其名称必须要与被连接的库的global_name相同

global_names

SQL> create database linkdmdb@link1connect to test identified by test using ‘dmdb’;

数据库链接已创建。

SQL> create database linkdmdb@link2connect to test identified by test using ‘dmdb’;

也就是在GLOBAL_NAME后面加上@再加上一个标识。这样就能够创建多个数据库链接到同一目标库上了。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9343996/viewspace-1024227/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 关于BLOG的呓语
请登录后发表评论 登录
全部评论

注册时间:2012-05-22

  • 博文量
    6
  • 访问量
    61030