WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606
全部博文(599)
分类: Oracle
2010-09-03 10:27:42
在高级复制中,ORACLE使用全局数据库名来唯一区分复制环境中的不同的站点。
如果更改了全局数据库名,将会报ORA-23313错误导致以前创建的复制组删除不掉。
SQL> show parameter global_name
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
global_names boolean TRUE
SQL> select * from global_name;
GLOBAL_NAME
------------------------------------------------------------------
YANSP
SQL> exec dbms_repcat.create_master_repgroup(gname=>'MG_YAN');
PL/SQL procedure successfully completed.
SQL> SELECT GNAME,STATUS FROM DBA_REPGROUP;
GNAME STATUS
---------- ------------------
MG_YAN QUIESCED
SQL> select gname,dblink,masterdef,snapmaster,master from dba_repsites;
GNAME DBLINK MA SN MA
---------- ---------- -- -- --
MG_YAN YANSP Y Y
此处的DBLINK列的值将会和全局数据库名称一致。
SQL> CONN / AS SYSDBA
Connected.
SQL> ALTER DATABASE RENAME GLOBAL_NAME TO TEST;
Database altered.
SQL> SELECT * FROM GLOBAL_NAME;
GLOBAL_NAME
----------------------------------------------------------------------------------------------------
TEST
SQL> CONN REPADMIN/REPADMIN
Connected.
SQL> EXEC DBMS_REPCAT.DROP_MASTER_REPGROUP(GNAME=>'MG_YAN');
BEGIN DBMS_REPCAT.DROP_MASTER_REPGROUP(GNAME=>'MG_YAN'); END;
*
ERROR at line 1:
ORA-23313: object group "PUBLIC"."MG_YAN" is not mastered at TEST
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_REPCAT_UTL4", line 2869
ORA-06512: at "SYS.DBMS_REPCAT_MAS", line 2660
ORA-06512: at "SYS.DBMS_REPCAT", line 635
ORA-06512: at line 1
SQL> CONN / AS SYSDBA
Connected.
SQL> ALTER DATABASE RENAME GLOBAL_NAME TO YANSP;
Database altered.
SQL> SELECT * FROM GLOBAL_NAME;
GLOBAL_NAME
----------------------------------------------------------------------------------------------------
YANSP
SQL> CONN REPADMIN/REPADMIN
Connected.
SQL> EXEC DBMS_REPCAT.DROP_MASTER_REPGROUP(GNAME=>'MG_YAN');
PL/SQL procedure successfully completed.
SQL> SELECT GNAME,STATUS FROM DBA_REPGROUP;
no rows selected
SQL>
chinaunix网友2010-09-05 14:58:53
Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com