Prerequest for source table in golden gate

On Source Machine
————————-
make sure all the tables to replicate have key constraint

select t.table_name from dba_tables t where t.owner=’HR’ and
t.table_name in
(‘COUNTRIES’,’DEPARTMENTS’,’EMPLOYEES’,’JOB_HISTORY’,’JOBS’,’LOCATIONS’,’REGIO
NS’)
minus
select c.table_name from dba_constraint
s c where c.owner=’HR’ and
c.constraint_type in (‘P’,’U’)

Logging option must be enabled:

select table_name from dba_tables where owner=’HR’ and logging=’NO’
and
table_name in
(‘COUNTRIES’,’DEPARTMENTS’,’EMPLOYEES’)

On target Machine:
————————–
Target:

disable cascade-delete constraints

select ‘alter table ‘||owner||’.’||table_name|| ‘ disable constraint ‘||constraint_name||’;’ from all_constraints where delete_rule = ‘CASCADE’ and owner = ‘HR’;

disable triggers:

select ‘alter trigger ‘||owner||’.’||trigger_name||’ disable ;’ from all_triggers where owner = ‘HR’;
 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.