Common Files and Scripts Used with Business Reporting in a Unidirectional Topology
Extract Parameter File in Unidirectional Replication
Use the following Extract parameter file for configuring the business reporting
use case when using the Admin Client commands in the OBEY script. This is required because you
need to edit or copy the parameter file to the
etc/conf/ogg/
.
The Extract name used in this paramater file is
EXTN
:EXTRACT extn
USERIDALIAS ggnorth
EXTTRAIL north/ea
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
REPORTCOUNT EVERY 10 MINUTES, RATE
WARNLONGTRANS 15MINUTES, CHECKINTERVAL 5MINUTES
TABLE hr.*;
Replicat Parameter File in Unidirectional Replication
Use the following Replicat parameter file for configuring the business
reporting use case when using the Admin Client commands in the OBEY script: This is required
because you need to edit or copy the parameter file to the
/etc/conf/ogg/
.
The Replicat name used in this parameter
file is
REPN
:REPLICAT repn
USERIDALIAS ggsouth DOMAIN OracleGoldenGate
DDLOPTIONS REPORT
DDLERROR DEFAULT, DISCARD
REPORTCOUNT EVERY 10 MINUTES, RATE
REPERROR (DEFAULT, DISCARD)
MAP hr.*, TARGET hr.*;
Source DML Operations
#!/usr/bin/bash
sqlplus -s ggadmin/ggadmin@dbnorth << EOF
set lines 100
col firstname format a30
col last_name format a30
col employee_id format 9999
col salary format 999999.99
col department_id format 999
select employee_id, first_name, last_name, salary, department_id
from hr.employees
where department_id = 60;
PROMPT Run DML operations on source table HR.EMPLOYEES
begin
for i in 1..10 loop
update hr.employees set salary = 0.95 * 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
Sample Select Statements for Source and Target PDBs
#!/usr/bin/bash
sqlplus -s /nolog << EOF
set lines 100
col firstname format a30
col last_name format a30
col employee_id format 9999
col salary format 999999.99
col department_id format 999
-- Connect to DBNorth
connect ggadmin/ggadmin@dbnorth
PROMPT
PROMPT Source Database:
select employee_id, first_name, last_name, salary, department_id
from hr.employees
where department_id = 60;
-- Connect to DBSouthh
connect ggadmin/ggadmin@dbsouth
PROMPT Target Database:
select employee_id, first_name, last_name, salary, department_id
from hr.employees
where department_id = 60;
EOF
exit