Common Files and Scripts Used in a Bidirectional Replication

DBNORTH DML Operations

#!/usr/bin/bash

sqlplus -s system/oracle4GG@dbnorth << EOF
set lines 100
col firstname     format a30
col last_name     format a30
col employee_id   format 9999
col salary        format 99999.99
col department_id format 999

select employee_id, first_name, last_name, salary, department_id
  from hr.employees 
  where department_id = 60;

begin
  for i in 1..10 loop
    update hr.employees set salary = 1.05 * salary where department_id =60;
    dbms_lock.sleep(1);
    commit;
  end loop;
end;
/

select employee_id, first_name, last_name, salary, department_id
  from hr.employees
  where department_id = 60;

EOF
exit

Select Statement for DBSOUTH

#!/usr/bin/bash

sqlplus -s system/oracle4GG@dbsouth << EOF
set lines 100
col firstname     format a30
col last_name     format a30
col employee_id   format 9999
col salary        format 99999.99
col department_id format 999

select employee_id, first_name, last_name, salary, department_id
  from hr.employees 
  where department_id = 60;

EOF
exit

Source DML Operations

#!/usr/bin/bash

sqlplus -s system/oracle4GG@dbsouth << EOF
set lines 100
col firstname     format a30
col last_name     format a30
col employee_id   format 9999
col salary        format 99999.99
col department_id format 999

select employee_id, first_name, last_name, salary, department_id
  from hr.employees 
  where department_id = 60;

begin
  for i in 1..10 loop
    update hr.employees set salary = 1.05 * salary where department_id =60;
    dbms_lock.sleep(1);
    commit;
  end loop;
end;
/

select employee_id, first_name, last_name, salary, department_id
  from hr.employees
  where department_id = 60;

EOF
exit

Select Statement for DBSOUTH PDBs

#!/usr/bin/bash

sqlplus -s system/oracle4GG@dbsouth << EOF
set lines 100
col firstname     format a30
col last_name     format a30
col employee_id   format 9999
col salary        format 99999.99
col department_id format 999

select employee_id, first_name, last_name, salary, department_id
  from hr.employees 
  where department_id = 60;

EOF
exit