ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 高级复制-解决冲突

高级复制-解决冲突

原创 Linux操作系统 作者:wzkchf 时间:2008-03-17 09:33:52 0 删除 编辑

检查复制组状态

select gname, master, status from dba_repgroup;

GNAME                          M STATUS

------------------------------ - ---------

HOLEN_MASTER                   Y QUIESCED   ---停顿

REPBBB                         Y NORMAL      ---正常

停顿复制组

execute dbms_repcat.suspend_master_activity (gname => 'repbbb');

启动复制

execute dbms_repcat.resume_master_activity('repbbb',false);

execute dbms_repcat.resume_master_activity('repbbb',true);

 

 

Scott用户下

建立表冲突表 miss_rows

create table missing_rows_test as select * from test where 1=0;

建立保存缺失位置表missing_location

create table MISSING_LOCATION_TEST (

present VARCHAR2(128),

absent VARCHAR2(128),

r_id ROWID);

 

 

 

 

 repadmin用户下:

使用dbms_rectifier_diff.DIFFERENCES查找缺失记录

begin dbms_rectifier_diff.DIFFERENCES(

SNAME1                    =>'SCOTT',

ONAME1                         =>'TEST',

REFERENCE_SITE                 =>'WZK.COM',

SNAME2                         =>'SCOTT',

ONAME2                         =>'TEST',

COMPARISON_SITE                =>'SDGA.COM',

WHERE_CLAUSE                   =>NULL,

COLUMN_LIST                    =>NULL,

MISSING_ROWS_SNAME             =>'SCOTT',

MISSING_ROWS_ONAME1            =>'MISSING_ROWS_TEST',

MISSING_ROWS_ONAME2            =>'MISSING_LOCATION_TEST',

MISSING_ROWS_SITE              =>'WZK.COM',

MAX_MISSING                    =>500,

COMMIT_ROWS                    =>100

);

END;

使用DBMS_RECTIFIER_DIFF.RECTIFY进行数据整合

BEGIN DBMS_RECTIFIER_DIFF.RECTIFY(

SNAME1                         =>'SCOTT',

ONAME1                         =>'TEST',

REFERENCE_SITE                 =>'WZK.COM',

SNAME2                         =>'SCOTT',

ONAME2                         =>'TEST',

COMPARISON_SITE                =>'SDGA.COM',

COLUMN_LIST                    =>NULL,

MISSING_ROWS_SNAME           =>'SCOTT',

MISSING_ROWS_ONAME1          =>'MISSING_ROWS_TEST',

MISSING_ROWS_ONAME2          =>'MISSING_LOCATION_TEST',

MISSING_ROWS_SITE              =>'WZK.COM',

COMMIT_ROWS                    =>100

);

END;

/

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

请登录后发表评论 登录
全部评论

注册时间:2008-03-14

  • 博文量
    34
  • 访问量
    42637