06.05. Configuring "OGG for PostgreSQL" and creating REPLICAT rstock

                                                    <<< Back   Next >>>

1. Creating a directory to receive trails
[oracle@ogg-srv] $>
mkdir -p /u01/gg/ggtrail/db-pgsql/

2. Granting permissions to the directory to receive trail files in the GLOBALS file
[oracle@ogg-srv] $>
. ~/.profile.postgres.gg21
vi $GG/GLOBALS

GGSCHEMA ggadmin
ALLOWOUTPUTDIR /u01/gg/ggtrail/db-pgsql

3. Creating ODBC connections configuration
[oracle@ogg-srv] $>
vi $GG/odbc.ini
[ODBC Data Sources]
GG_postgres=DataDirect 7.1 PostgreSQL Wire Protocol
[ODBC]
IANAAppCodePage=106
InstallDir=/u01/gg/postgres
[gg_dbquik]
Driver=/u01/gg/postgres/lib/GGpsql25.so
Description=DataDirect 7.1 PostgreSQL Wire Protocol
Database=dbquik
HostName=db-pgsql.oracak.com
PortNumber=5432
LogonID=ggadmin

4. Creating credentialstore

[oracle@ogg-srv] $>
. ~/.profile.postgres.gg21
$GG/ggsci

create subdirs
add credentialstore
alter credentialstore add user ggadmin, password *** alias ggadmin
INFO CREDENTIALSTORE
-- проверка
dblogin sourcedb gg_dbquik useridalias ggadmin


5. Creating parameters file for GG Manager
[oracle@ogg-srv] $>
. ~/.profile.postgres.gg21
$GG/ggsci

edit param mgr
Port 7831
ACCESSRULE, PROG *, ALLOW
AUTORESTART ER *, RETRIES 120, WAITMINUTES 10, RESETMINUTES 1200
PURGEOLDEXTRACTS /u01/gg/ggtrail/db-pgsql/*, USECHECKPOINTS, MINKEEPHOURS 96
-- End of parameter file
start mgr

6. Adding checkpoint table
[oracle@ogg-srv] $>
. ~/.profile.postgres.gg21
$GG/ggsci

dblogin sourcedb gg_dbquik useridalias ggadmin
add checkpointtable ggadmin.ckpt_01

7. Creating replicat rstock (do not start yet, it will be started only after InitialLoad)
[oracle@ogg-srv] $>
. ~/.profile.postgres.gg21
$GG/ggsci

dblogin sourcedb gg_dbquik useridalias ggadmin
add replicat rstock, exttrail /u01/gg/ggtrail/db-pgsql/aa, checkpointtable ggadmin.ckpt_01
edit params rstock
REPLICAT rstock
--SETENV (NLS_LANG="AMERICAN_AMERICA.CL8ISO8859P5")
SETENV (NLS_DATE_FORMAT = "YYYY-MM-DD HH24:MI:SS")
targetdb gg_dbquik useridalias ggadmin
--
map STOCK.BONDS, target STOCK.BONDS;
map STOCK.BONDS_SETTING, target STOCK.BONDS_SETTING;
map STOCK.BONDS_ZAJVKA, target STOCK.BONDS_ZAJVKA;
map STOCK.CLIENT_ACCOUNT, target STOCK.CLIENT_ACCOUNT;
map STOCK.DIVIDENTS, target STOCK.DIVIDENTS;
map STOCK.JOB_LOGS, target STOCK.JOB_LOGS;
map STOCK.PORTFOLIO, target STOCK.PORTFOLIO;
map STOCK.QUOTES, target STOCK.QUOTES;
map STOCK.QUOTES_ANALYST_15M, target STOCK.QUOTES_ANALYST_15M;
map STOCK.QUOTES_ANALYST_1H, target STOCK.QUOTES_ANALYST_1H;
map STOCK.QUOTES_ANALYST_1D, target STOCK.QUOTES_ANALYST_1D;
map STOCK.QUOTES_VOLUME, target STOCK.QUOTES_VOLUME;
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.SIGNAL, target STOCK.SIGNAL;
map STOCK.TRADING_EDU, target STOCK.TRADING_EDU;
map STOCK.TRADING_PROD, target STOCK.TRADING_PROD;
-- End of parameter file
info all

-- addition
-- example RC
map STOCK.BONDS, target STOCK.BONDS, RESOLVECONFLICT(DELETEROWMISSING,(DEFAULT,IGNORE)), RESOLVECONFLICT(INSERTROWEXISTS,(DEFAULT,OVERWRITE));
                                                    <<< Back   Next >>>