ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-02085 database link string connects to string解决

ORA-02085 database link string connects to string解决

原创 Linux操作系统 作者:lsq_008 时间:2008-11-10 12:45:19 0 删除 编辑

         当使用全局数据库命名的时候(global_names=TRUE),数据库链接(DATABASE LINK)的名字必须和数据库的名字相同。

SQL> create database linke mv_link
  2  connect to scott identified by tiger
  3  using 'ms1';
create database linke mv_link
                      *
ERROR at line 1:
ORA-02165: invalid option for CREATE DATABASE
 
 
SQL> 1
  1* create database linke mv_link
SQL> c/linke/link
  1* create database link mv_link
SQL> /
 
Database link created.
 
SQL> select count(*) from
emp@mv_link;
select count(*) from
emp@mv_link
                         *
ERROR at line 1:
ORA-02085: database link MV_LINK.CCB.COM.CN connects to MS1.CCB.COM.CN

SQL> conn /as sysdba
Connected.
SQL> show parameter global_name
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
global_names                         boolean     TRUE
SQL> select * from global_name;
 
GLOBAL_NAME
------------------------------------------------------------------------------------------------------------------------------------
MV1.CCB.COM.CN

解决方法:

方法一:使数据库链接(DATABASE LINK)的名字和数据库的名字相同。

方法二:禁用全局数据库命名,即:设置global_names=false。

采用第二种方法:

SQL> alter system set global_name='false' scope=spfile;
alter system set global_name='false' scope=spfile
                 *
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM
 
 
SQL> alter system set global_names=false scope=spfile;
 
System altered.
 
SQL> startup force
ORACLE instance started.
 
Total System Global Area   89199856 bytes
Fixed Size                   451824 bytes
Variable Size              67108864 bytes
Database Buffers           20971520 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> show parameter glabal_name
SQL> show parameter global_name
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
global_names                         boolean     FALSE
SQL> conn scott/tiger
Connected.
SQL> create database link mv_link
  2  connect to scott identified by tiger;
 
Database link created.
 
SQL> select count(*) from
emp@mv_link;
select count(*) from
emp@mv_link
                         *
ERROR at line 1:
ORA-02019: connection description for remote database not found
 
 
SQL> drop database link mv_link;
 
Database link dropped.
 
SQL> create database link mv_link
  2  connect to scott identified by tiger
  3  using 'ms1';
 
Database link created.
 
SQL> select count(*) from
emp@mv_link;
 
  COUNT(*)
----------
        15

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

请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    325
  • 访问量
    1244167