解决ORA-02069: global_names parameter must be set to TRUE for this operation 问题

前端之家收集整理的这篇文章主要介绍了解决ORA-02069: global_names parameter must be set to TRUE for this operation 问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

解决ORA-02069: global_names parameter must be set to TRUE for this operation 问题

问题产生背景:

数据库分库,在各个库之间采用dblink连接,DML操作会导致该问题的产生。

解决步骤

  1. 各个数据库设置独立地global name, 并enable global name.

    select * from global_name;

    alter database rename global_name to MAINDB;

  2. 修改tnsnames.ora 和listener.ora.

    vi $ORACLE_HOME/network/admin/tnsnames.ora

    MAINDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.198.135)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    )
    )

    IPDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.198.136)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    )
    )

    vi $ORACLE_HOME/network/admin/listener.ora

    SID_LIST_LISTENER = (
    SID_LIST = (
    SID_DESC =
    (GLOBAL_DBNAME = MAINDB)
    (ORACLE_HOME = /db/oracle/product/11.2.0/db_1)
    (SID_NAME=orcl)
    )
    )

各个库都要这样修改

  1. 把DBLINK name 设置成和global name保持相同.

    删除旧的db link: drop database link ORCLMAIN;

    在MAINDB上建立到IPDB的link
    Create database link IPDB connect to admin identified by 123
    using ‘IPDB’;

  2. 从库也要建立到主库的反向DBLINK,命名原则同上.

    在IPDB上建立到MAINDB的link

    Create database link MAINDB connect to admin identified by 123

  3. 创建表同义词

    create synonym IP_RECORD for IP_RECORD@IPDB ;

http://www.jb51.cc/article/p-wpuwjggm-eq.html
https://dba010.wordpress.com/2011/01/05/oracle-errorsora/#ORA-02069
http://blog.csdn.net/wwwer1/article/details/7297551

猜你在找的Oracle相关文章