首页 > 数据库技术 > 详细

Oracle GoldenGate for Informix

时间:2019-12-03 12:04:36      阅读:88      评论:0      收藏:0      [点我收藏+]

 

Informix installation

0. Download the image from Developer works:

https://www-01.ibm.com/marketing/iwm/iwm/web/reg/pick.do?source=ifxids&lang=en_US&S_TACT=000000VY&S_OFF_CD=10000760

1. Create user and update the user profile

1.1 Create user and group

#groupadd informix
#mkdir -p /u01/app/informix

#passwd Informix ##informix

1.2 Set Informix home

INFORMIX_HOME=/u01/app/informix; export INFORMIX_HOME

PATH=/usr/sbin:$JAVA_HOME/bin:$JRE_HOME/bin:$ORACLE_HOME/bin:$INFORMIX_HOME/bin:$PATH; export PATH

 

Sample profile for user Informix:

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

#export hostname=OGG

export PATH

export INFORMIXSERVER=ol_informix1170

export INFORMIXDIR="/u01/app/informix"

export ONCONFIG=onconfig.ol_informix1170

export OGG_HOME=/u01/app/OGG

#export INFORMIXTERM=terminfo

ORACLE_BASE=/u01/app/informix; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1;export ORACLE_HOME

ORACLE_SID=orcl; export ORACLE_SID

export INFORMIXSQLHOSTS="/u01/app/informix/etc/sqlhosts.ol_informix1170"

PATH=${INFORMIXDIR}/bin:.:/usr/bin:$ORACLE_HOME/bin:${PATH} export PATH

LD_LIBRARY_PATH=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${INFORMIXDIR}/lib/cli:${INFORMIXDIR}}/extend/TimeSeries.4.01.FC8/lib:$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH

 export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$JAVA_HOME/lib:$JRE_HOME/lib; export CLASSPATH

export ODBCINI=/u01/app/informix/etc/odbc.ini

alias iggsci=‘$OGG_HOME/ggsci‘

alias sys=‘sqlplus / as sysdba‘

alias oggsci=‘/u01/app/OGGOra/ggsci‘

[oracle@localhost setup]$ tar xvf iif.11.70.FC8TL.linux-x86_64.tar

技术分享图片

技术分享图片

·       INFORMIXDIR variable to the directory where you installed the database server

·       INFORMIXSERVER to specify the default database server to which IBM Informix DB-Access or an SQL API client makes an explicit or implicit connection.

·       ONCONFIG variable to the name of a valid onconfig file.

·       INFORMIXSQLHOSTS to specify the file that contains the sqlhosts information

·       INFORMIXTERM to specify whether IBM Informix DB-Access uses the information in the termcap file or the terminfo director

·       PATH to include the informix command in the PATH variable.

Make sure logging in as the informix user and setup the environment suing the script file (i.e. ol_informix1170.ksh) and set the LD_LIBRARY_PATH for Oracle GoldenGate. 

2.Login Informix:

dbaccess

技术分享图片

3. Configure the sqlhosts.<hostname>

sqlhosts.ol_informix1170

技术分享图片

4. DB UI tool for Informix DBvis

We can also use UI to access the Informix database: DBvis

技术分享图片

Get the port number by:

技术分享图片

The Informix database is already started

5. Create SYSCDC database 

 

Run the following SQL command with the informix user: 

 

dbaccess < $INFORMIXDIR/etc/syscdcv1.sql

A SYSCDC database must be created before you install Oracle GoldenGate on a source or target Informix system. The script to create the SYSCDC database and related functions typically exists in the location $INFORMIXDIR/etc/syscdcv1.sql. Run the script as the informix user.

 

You have to keep all the logs in the logical log before Oracle GoldenGate complete the extraction. Therefore, you might increase logical log size and the number of logical log files with the  LOGSIZE and LOGFILES configuration parameters. An example is shown as follows: 

6. Update ini files for ODBC

Created test database and enable logging for test db, create table test and insert sample data:

No UI when installing the OGG for Informix, just unzip it to the folder you want:

Then we need to update 2 ini files for OGG under Informixdir/etc

odbc.ini

;---------------------------------------------------------------------------

; IBM INFORMIX ODBC Sample File

;

; File:                    odbc.ini

;

;---------------------------------------------------------------------------

[ODBC Data Sources]

Infdrv1=IBM INFORMIX ODBC DRIVER

Infdrv2=IBM INFORMIX ODBC DRIVER

;

; Define ODBC Database Driver‘s Below - Driver Configuration Section

;

[Infdrv1]

Driver=/u01/app/informix/lib/cli/iclit09b.so

Description=IBM INFORMIX ODBC DRIVER

Database=syscdcv1

LogonID=informix

pwd=informix

Servername=ol_informix1170

[Infdrv2]

Driver=/u01/app/informix/lib/cli/iclis09b.so

Description=IBM INFORMIX ODBC DRIVER

Database=syscdcv1

LogonID=informix

pwd=informix

Servername=ol_informix1170

CursorBehavior=0

CLIENT_LOCALE=en_us.8859-1

DB_LOCALE=en_us.8859-1

TRANSLATIONDLL=/u01/app/informix/lib/esql/igo4a304.so

;

; UNICODE connection Section

;

[ODBC]

;uncomment the below line for UNICODE connection

;UNICODE=UCS-4

;

UNICODE=UTF-8

; Trace file Section

;

Trace=0

TraceFile=/u01/app/informix/tmp/odbctrace.out

InstallDir=/u01/app/informix

TRACEDLL=idmrs09a.so

and odbcinst.ini

 

;---------------------------------------------------------------------------

; IBM INFORMIX ODBC Sample File

;

; File:                    odbcinst.ini

;

;---------------------------------------------------------------------------

[ODBC Drivers]

IBM INFORMIX ODBC DRIVER=Installed

[IBM INFORMIX ODBC DRIVER]

Driver=/u01/app/informix/lib/cli/iclit09b.so

Setup=/u01/app/informix/lib/cli/iclit09b.so

APILevel=1

ConnectFunctions=YYY

DriverODBCVer=03.51

FileUsage=0

SQLLevel=1

smProcessPerConnect=Y

Setup OGG for Informix in GGSCI

1. Log in the Informix db

GGSCI (ol_informix1170) 3> dblogin sourcedb Infdrv1 userid informix password informix

## Please note the Infdrv1 is the DSN name

2016-11-28 22:08:55  INFO    OGG-03036  Database character set identified as ISO-8859-1. Locale: en_US.

2016-11-28 22:08:55  INFO    OGG-03037  Session character set identified as ISO-8859-1.

Successfully logged into database.

2. Edit the extract process:

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 23> view param exttest

extract extinx

sourcedb Infdrv1 userid informix password informix

locallsupcols

exttrail /u01/app/OGG/dirdat/te

table test.informix.testinx;

 

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 24> view param pumtest

extract puminx

rmthost ol_informix1170,mgrport 7909

rmttrail /u01/app/OGGOra/dirdat/te

table test.informix.testinx;

3. Add trandata

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 3> add trandata test.informix.testinx

Logging of supplemental log data (full row logging) is enabled for table test.informix.jobs.

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 4> create subdirs

Creating subdirectories under current directory /u01/app/OGG

 

Parameter files                /u01/app/OGG/dirprm: already exists

Report files                   /u01/app/OGG/dirrpt: already exists

Checkpoint files               /u01/app/OGG/dirchk: already exists

Process status files           /u01/app/OGG/dirpcs: already exists

SQL script files               /u01/app/OGG/dirsql: already exists

Database definitions files     /u01/app/OGG/dirdef: already exists

Extract data files             /u01/app/OGG/dirdat: already exists

Temporary files                /u01/app/OGG/dirtmp: already exists

Credential store files         /u01/app/OGG/dircrd: already exists

Masterkey wallet files         /u01/app/OGG/dirwlt: already exists

Dump files                     /u01/app/OGG/dirdmp: already exists

4. Adding groups for extracts

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 16> add extract exttest,VAM,BEGIN NOW

EXTRACT added.

 

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 19> add exttrail /u01/app/OGG/dirdat/te,extract exttest

EXTTRAIL added.

 

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 20> add extract pumtest,exttrailsource ./dirdat/te

EXTRACT added.

 

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 21> add rmttrail /u01/app/OGGOra/dirdat/te,extract pumtest

RMTTRAIL added.

 

GGSCI (ol_informix1170 as informix@Infdrv1/syscdcv1) 22>  add trandata test.informix.testinx,begin now

Logging of supplemental log data (full row logging) is enabled for table test.informix.jobs.

 

5. Start the mgr and extract processes

技术分享图片

GGSCI (ol_informix1170) 3> stats exttest

 

Sending STATS request to EXTRACT EXTTEST ...

 

Start of Statistics at 2016-12-05 03:31:03.

 

Output to /u01/app/OGG/dirdat/te:

 

Extracting from test.informix.testinx to test.informix.testinx:

 

*** Total statistics since 2016-12-05 03:22:12 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Daily statistics since 2016-12-05 03:22:12 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Hourly statistics since 2016-12-05 03:22:12 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Latest statistics since 2016-12-05 03:22:12 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

End of Statistics.

Set up the OGG for target database Oracle database:

1. Install the OGG software for Oracle 11g with UI

2. Enable OGG in Oracle database by

SQL:

Shutdown immediate;

Startup mount;

Alter database archivelog;

Alter database add supplemental log data;

Alter database force logging;

Alter system set enable_goldengate_replication=true scope=both;

Alter database open;

Exit

3. Setup test tables and sample data in Oracle database

4. Setup OGG params:

mgr:

GGSCI (ol_informix1170) 6> view param mgr

PORT 7909

repora:

GGSCI (ol_informix1170) 7> view param REPTEST

replicat reptest

userid system,password oracle

discardfile ./dircrd/distest.dsc,purge

ddl include all

map test.informix.testinx;target hr.testora;

5. Register the data replicate

dblogin userid system,password oracle

Successfully logged into database.

GGSCI (ol_informix1170) 8> view params ./GLOBALS

checkpointtable system.chkpt

 

GGSCI (ol_informix1170 as system@orcl) 17> add checkpointtable system.chkpt

Successfully created checkpoint table system.chkpt.

 

GGSCI (ol_informix1170) 1> add replicat reptest,exttrail ./dirdat/te

REPLICAT added.

 

6. Start the replicat

技术分享图片

 

GGSCI (ol_informix1170) 2> stats reptest

 

Sending STATS request to REPLICAT REPTEST ...

 

Start of Statistics at 2016-12-05 03:29:56.

 

DDL replication statistics:

 

*** Total statistics since replicat started     ***

        Operations                                         0.00

        Mapped operations                                  0.00

        Unmapped operations                                0.00

        Other operations                                   0.00

        Excluded operations                                0.00

        Errors                                             0.00

        Retried errors                                     0.00

        Discarded errors                                   0.00

        Ignored errors                                     0.00

 

Replicating from test.informix.testinx to HR.TESTORA:

 

*** Total statistics since 2016-12-05 03:22:17 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Daily statistics since 2016-12-05 03:22:17 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Hourly statistics since 2016-12-05 03:22:17 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

*** Latest statistics since 2016-12-05 03:22:17 ***

        Total inserts                                      1.00

        Total updates                                      1.00

        Total deletes                                      1.00

        Total discards                                     0.00

        Total operations                                   3.00

 

End of Statistics.

 

Items need pay attention to:

Error:

WARNING OGG-00552  Database operation failed: Couldn‘t connect to Infdrv1. ODBC error: SQLSTATE I native database error -11041. [.

ERROR: Database operation failed: Couldn‘t connect to Infdrv1. ODBC error: SQLSTATE I native database error -11041. [Failed to open data source Infdrv1 for user informix.

 

1. Update the odbc.ini file under Informix home: /u01/app/informix/etc

UNICODE=UTF-8

 

2017-12-01 05:54:45  WARNING OGG-00552  Database operation failed: Couldn‘t connect to Infdrv1. ODBC error: SQLSTATE 08004 native database error -930. [Informix][Informix ODBC Driver][Informix]Cannot connect to database server (OGG).

ERROR: Database operation failed: Couldn‘t connect to Infdrv1. ODBC error: SQLSTATE 08004 native database error -930. [Informix][Informix ODBC Driver][Informix]Cannot connect to database server (OGG).Failed to open data source Infdrv1 for user informix.

2. Changing the userid /password/hostname in odbc.ini

 

[Informix]Server OGG is not listed as a dbserver name in sqlhosts.

Update the file: sqlhosts.ol_informix1170 under /u01/app/informix/etc

;---------------------------------------------------------------------------

; IBM INFORMIX ODBC Sample File

;

; File:                odbc.ini

;

;---------------------------------------------------------------------------

[ODBC Data Sources]

Infdrv1=IBM INFORMIX ODBC DRIVER

Infdrv2=IBM INFORMIX ODBC DRIVER

;

; Define ODBC Database Driver‘s Below - Driver Configuration Section

;

[Infdrv1]

Driver=/u01/app/informix/lib/cli/iclit09b.so

Description=IBM INFORMIX ODBC DRIVER

Database=test

LogonID=informix

pwd=ogg

Servername=ol_informix1170

[Infdrv2]

Driver=/u01/app/informix/lib/cli/iclis09b.so

Description=IBM INFORMIX ODBC DRIVER

Database=test

LogonID=informix

pwd=ogg

Servername=ol_informix1170

CursorBehavior=0

CLIENT_LOCALE=en_us.8859-1

DB_LOCALE=en_us.8859-1

TRANSLATIONDLL=/u01/app/informix/lib/esql/igo4a304.so

;

; UNICODE connection Section

;

[ODBC]

;uncomment the below line for UNICODE connection

;UNICODE=UCS-4

;

; Trace file Section

;

UNICODE=UTF-8

Trace=0

TraceFile=/u01/app/informix/tmp/odbctrace.out

InstallDir=/u01/app/informix

TRACEDLL=idmrs09a.so

3. Create a database that in the odbc.ini file by dbaccess, test in our case, when it was created, it is like below.

技术分享图片

4. Update the file: sqlhosts.<hostname> under /u01/app/informix/etc

[informix@ol_informix1170 etc]$ cat sqlhosts.ol_informix1170

#ol_informix1170 onsoctcp OGG ol_informix1170

#dr_informix1170 drsoctcp OGG dr_informix1170

ol_informix1170 onsoctcp ol_informix1170 ol_informix1170

5. Log in successfully.

技术分享图片

 

Oracle GoldenGate for Informix

原文:https://www.cnblogs.com/ak666666/p/11975096.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!