Thursday, May 24, 2007

Rebuild/Move Replication Base Tables

1. Check deferred transactions.

system - chk_def_tbls.sql


----
spool chk_def_tbls.log

select * from defcall;
select * from deftran;
select * from deferror;
select * from dba_repcatlog;

spool off
----

2. Check base tables.

system - chk_base_def_tbls.sql
----
spool chk_base_def_tbls.log

select * from system.def$_calldest;
select * from system.def$_defaultdest;
select * from system.def$_error;
select * from system.def$_origin;
select * from system.repcat$_repschema;
select * from system.def$_destination;

spool off
-----


3. Remove replication if it exist.

sys - $ORACLE_HOME/rdbms/admin/catrepr.sql

4. Drop the base deferred transaction tables.

system - dr_base_def_tbls.sql

----------------
spool dr_base_tbls.log

drop table system.def$_calldest;
drop table system.def$_defaultdest;
drop table system.def$_error;
drop table system.def$_origin;
--drop table system.repcat$_repschema; This is dropped in catrepr.sql
drop table system.def$_destination;

execute dbms_aqadm.drop_queue_table('SYSTEM.DEF$_AQCALL', TRUE);
execute dbms_aqadm.drop_queue_table('SYSTEM.DEF$_AQERROR', TRUE);

commit;

spool off
-------------


5. Create the replication tablespace and
set system's default tablespace to the rep tblsp.

system - cr_rep_tblsp.sql

6. Create the base deferred transaction tables.

system - $ORACLE_HOME/rdbms/admin/catdefrt

7. Create replication

sys - $ORACLE_HOME/rdbms/admin/catrep

8. Change system's default tablespace back to what it was.

No comments: