解决ORA-02069: global_names parameter must be set to TRUE for this operation 问题
问题产生背景:
多数据库分库,在各个库之间采用dblink连接,DML操作会导致该问题的产生。
解决步骤
各个数据库设置独立地global name, 并enable global name.
select * from global_name;
alter database rename global_name to MAINDB;
修改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)
)
)
各个库都要这样修改。
把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’;从库也要建立到主库的反向DBLINK,命名原则同上.
在IPDB上建立到MAINDB的link
Create database link MAINDB connect to admin identified by 123
创建表同义词
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