Drop/Delete Multi-Master Replication

Posted By Sagar Patil

Dropping Multi-master Replication

Execute following SQL at Master Defn Site (here repa)
$ sqlplus repadmin/repadmin@repa

REM Disable replication
execute dbms_repcat.suspend_master_activity(gname=>’SCOTT_REPG’);

REM Delete replication groups
execute dbms_repcat.drop_master_repobject(‘SCOTT’,’EMP’,’TABLE’);
execute dbms_repcat.drop_master_repobject(‘SCOTT’ ,’DEPT’,’TABLE’);
execute dbms_repcat.drop_master_repgroup(‘SCOTT_REPG’);
execute dbms_repcat.remove_master_databases(‘SCOTT_REPG’,’repb’);

REM Remove private database links to other master databases
drop database link repb;

connect sys/repb@repb

REM Remove the REPADMIN user
execute dbms_defer_sys.unregister_propagator (username=>’REPADMIN’);
execute dbms_repcat_admin.revoke_admin_any_schema(username=>’REPADMIN’);
drop user repadmin cascade;

REM Drop public database links to other master databases
drop public database link repb;

Delete all Errors from replication sites
Check if there are any errors “select * from deferror;”

select sname, master, status from sys.dba_repcat; – make sure the status is not QUISCED
select id, TIMESTAMP, Master Status from dba_repcatlog

Now if there are any values returned then use following API and replace ID in parameter with values returned above.
repA> exec dbms_repcat.purge_master_log(&ID,’repa’,’scott_repg’);
repB> exec dbms_repcat.purge_master_log(&ID,’repa’,’scott_repg’);

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu