05.13. Creating Change-Synchronization ER Server 'OGG for Postgres' #2 (e_quik2, r_quik1)

                                                    <<< Back   Next >>>

OGG server #2

***************************
- ogg-srv02.oracak.ru

1. Creating a directory for trail files
[oracle]$>
mkdir -p /ggtrail/dbquik2
rm -fr /ggtrail/dbquik2/*


2. Creating instructions with a list of tables for the e_quik2 extract
-- getting list of tables
-- SELECT 'table stock."'||table_name||'";' FROM information_schema.tables WHERE table_schema = 'stock' order by table_name;
[oracle] $>
. ~/.profile.postgres.gg21
vi $GG/dirprm/e_quik2.inc
table stock.bonds;
table stock.bonds_arch;
table stock.bonds_setting;
table stock.bonds_setting_arch;
table stock.bonds_zajvka;
table stock.bonds_zajvka_arch;
table stock.client_account;
table stock.client_account_arch;
table stock.dividents;
table stock.job_logs;
table stock.portfolio;
table stock.portfolio_arch;
table stock.quotes;
table stock.quotes_analyst_15m;
table stock.quotes_analyst_1d;
table stock.quotes_analyst_1h;
table stock.quotes_arch;
table stock.quotes_volume;
table stock.quotes_volume_arch;
table stock.report_benefit;
table stock.report_benefit_comparator;
table stock.report_edu;
table stock.report_edu_comparator;
table stock.sdelka;
table stock.sdelka_arch;
table stock.signal;
table stock.signal_arch;
table stock.trading_edu;
table stock.trading_prod;
table stock.trading_prod_arch;

3. Creating the e_quik2 extract
./ggsci
dblogin sourcedb gg_dbquik2 useridalias ggadmin
add extract e_quik2, tranlog, begin now
add exttrail /ggtrail/dbquik2/ab, extract e_quik2, megabytes 200
info all
edit param e_quik2

extract e_quik2
sourcedb gg_dbquik2 useridalias ggadmin
exttrail /ggtrail/dbquik2/ab
ignorereplicates
tranlogoptions filtertable ggadmin.ckpt_02
DiscardFile ./dirrpt/e_quik2.dsc, megabytes 200
--
table ggadmin.HB;
--
INCLUDE ./dirprm/e_quik2.inc
-- End of parameter file
start e_quik2

4. Creating an instruction with a list of tables for the replicat extract r_quik1
-- getting list of tables
-- SELECT 'map stock."'||table_name||'", target stock."'||table_name||'";' FROM information_schema.tables WHERE table_schema = 'stock' order by table_name;
[oracle]$>
vi $GG/dirprm/r_quik1.inc
map stock.bonds, target stock.bonds;
map stock.bonds_arch, target stock.bonds_arch;
map stock.bonds_setting, target stock.bonds_setting;
map stock.bonds_setting_arch, target stock.bonds_setting_arch;
map stock.bonds_zajvka, target stock.bonds_zajvka;
map stock.bonds_zajvka_arch, target stock.bonds_zajvka_arch;
map stock.client_account, target stock.client_account;
map stock.client_account_arch, target stock.client_account_arch;
map stock.dividents, target stock.dividents;
map stock.job_logs, target stock.job_logs;
map stock.portfolio, target stock.portfolio;
map stock.portfolio_arch, target stock.portfolio_arch;
map stock.quotes, target stock.quotes;
map stock.quotes_analyst_15m, target stock.quotes_analyst_15m;
map stock.quotes_analyst_1d, target stock.quotes_analyst_1d;
map stock.quotes_analyst_1h, target stock.quotes_analyst_1h;
map stock.quotes_arch, target stock.quotes_arch;
map stock.quotes_volume, target stock.quotes_volume;
map stock.quotes_volume_arch, target stock.quotes_volume_arch;
map stock.report_benefit, target stock.report_benefit;
map stock.report_benefit_comparator, target stock.report_benefit_comparator;
map stock.report_edu, target stock.report_edu;
map stock.report_edu_comparator, target stock.report_edu_comparator;
map stock.sdelka, target stock.sdelka;
map stock.sdelka_arch, target stock.sdelka_arch;
map stock.signal, target stock.signal;
map stock.signal_arch, target stock.signal_arch;
map stock.trading_edu, target stock.trading_edu;
map stock.trading_prod, target stock.trading_prod;
map stock.trading_prod_arch, target stock.trading_prod_arch;

5. Creating replicat r_quik1 (the file with application tables is commented out; only replicating the HB table)
./ggsci
dblogin sourcedb gg_dbquik1 useridalias ggadmin
add replicat r_quik1, exttrail /ggtrail/dbquik2/ab, checkpointtable ggadmin.ckpt_01
edit params r_quik1
replicat r_quik1
targetdb gg_dbquik1 useridalias ggadmin
DISCARDFILE ./dirrpt/r_quik1.dsc, megabytes 200
--
map ggadmin.HB, TARGET ggadmin.HB_TARGET, HANDLECOLLISIONS, COLMAP(USEDEFAULTS, INSTANCE_NAME=@STRCAT(@GETENV('GGENVIRONMENT', 'HOSTNAME'), '_', @GETENV('GGENVIRONMENT', 'GROUPNAME')));
--
-- INCLUDE ./dirprm/r_quik1.inc
-- End of parameter file
start r_quik1

6. Obtain the current status of the ER
./ggsci
info all

7. Check for errors in the log
[oracle]$>
tail -100f $GG/ggserr.log
                                                    <<< Back   Next >>>