国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

如何在高級的復制中切換主體定義站點

2024-07-21 02:42:15
字體:
來源:轉載
供稿:網友
下面的這個示例是一個同步的復制環境,在同步復制中,任何一個站點Down掉都將會導致數據庫服務的中斷。

◆1.首先停掉主體的定義站點(CONNER.HURRAY.COM.CN)

[Oracle@jumper oracle]$ sqlplus "/ as sysdba"SQL*Plus: Release 9.2.0.4.0 - PRoduction on Thu Feb 17 16:07:26 2005Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.Connected to:Oracle9i Enterprise Edition Release 9.2.0.4.0 - ProductionWith the Partitioning optionJServer Release 9.2.0.4.0 - ProductionSQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.

◆2.登陸的主體站點(TESTORA9.HURRAY.COM.CN)

SQL> select * from dept;    DEPTNO DNAME          LOC---------- -------------- -------------        10 ACCOUNTING     NEW YORK        20 RESEARCH       DALLAS        30 SALES          CHICAGO        40 OperaTIONS     BOSTON        60 ORACLE         BEIJING        70 oracle         beijing6 rows selected.

注意:此時主體站點上對于扶植對象的任何DML操作都不能進行了。

SQL> insert into dept values(80,'oracle','beijing');insert into dept values(80,'oracle','beijing')*ERROR at line 1:ORA-02068: following severe error from CONNERORA-03113: end-of-file on communication channelORA-02068: following severe error from CONNERORA-03113: end-of-file on communication channel

◆3.然后大家可以使用復制管理員登陸主體站點

假如此時嘗試刪除復制對象,打破復制關系都會收到錯誤。

ORA-23312說明這不是主體定義站點。

SQL> connect repadmin/repadmin                                                                Connected.SQL> exec DBMS_REPCAT.DROP_MASTER_REPOBJECT(sname => 'scott',oname => 'dept',type => 'table');BEGIN DBMS_REPCAT.DROP_MASTER_REPOBJECT(sname => 'scott',oname => 'dept',type => 'table'); END;*ERROR at line 1:ORA-23312: not the masterdef according to TESTORA9.HURRAY.COM.CNORA-06512: at "SYS.DBMS_SYS_ERROR", line 86ORA-06512: at "SYS.DBMS_REPCAT_UTL4", line 2928ORA-06512: at "SYS.DBMS_REPCAT_UTL4", line 2720ORA-06512: at "SYS.DBMS_REPCAT", line 643ORA-06512: at line 1

◆4.此處需要使用DBMS_REPCAT.RELOCATE_MASTERDEF切換主體定義站點

SQL> BEGIN  2  DBMS_REPCAT.RELOCATE_MASTERDEF (  3        gname => 'rep_tt',  4        old_masterdef => 'CONNER.HURRAY.COM.CN',  5        new_masterdef => 'TESTORA9.HURRAY.COM.CN',  6        notify_masters => TRUE,  7        include_old_masterdef => FALSE);  8  END;  9  /PL/SQL procedure successfully completed.

◆5.然后把原主體定義站點(CONNER.HURRAY.COM.CN)從主體庫中刪除

SQL> execute dbms_repcat.remove_master_databases(gname=>'rep_tt',master_list=>'CONNER.HURRAY.COM.CN');PL/SQL procedure successfully completed.

◆6.復制關系被打破以后,DML操作得以繼續使用

SQL> connect scott/tigerConnected.SQL> select * from dept;    DEPTNO DNAME          LOC---------- -------------- -------------        10 ACCOUNTING     NEW YORK        20 RESEARCH       DALLAS        30 SALES          CHICAGO        40 OPERATIONS     BOSTON        60 ORACLE         BEIJING        70 oracle         beijing6 rows selected.SQL> insert into dept values (80,'oracle','beijing');1 row created.SQL> commit;Commit complete.SQL>

◆7.假如原站點恢復正常后,大家可以再次添加至復制組中。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 微山县| 梅河口市| 龙泉市| 治县。| 加查县| 乌鲁木齐县| 开化县| 疏附县| 天全县| 定西市| 富川| 宁武县| 常山县| 泽州县| 山阳县| 宜宾市| 唐河县| 阿拉善盟| 交口县| 于都县| 大厂| 东兰县| 和平区| 泽州县| 方正县| 安达市| 南乐县| 舞阳县| 合肥市| 晋中市| 仁布县| 皋兰县| 招远市| 崇明县| 兴隆县| 砚山县| 石林| 陕西省| 惠水县| 海原县| 农安县|