当前位置:数据库 > Oracle >>

Oracle GoldenGate for Oracle 11g to PostgreSQL 9.2.4 Configuration

Oracle GoldenGate for Oracle 11g to PostgreSQL 9.2.4 Configuration
 
Installing and setting up Oracle GoldenGate connecting to an Oracle database
Also please make sure the Oracle database is in archive log mode
[oracle@ggos ~]$ sqlplus / as sysdba  
  
SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 4 21:00:12 2013  
  
Copyright (c) 1982, 2013, Oracle.  All rights reserved.  
  
  
Connected to:  
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production  
With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  
SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/arch';  
  
System altered.  
  
SQL> shutdown immediate  
Database closed.  
Database dismounted.  
ORACLE instance shut down.  
SQL> startup mount  
ORACLE instance started.  
  
Total System Global Area  835104768 bytes  
Fixed Size                  2257840 bytes  
Variable Size             717229136 bytes  
Database Buffers          113246208 bytes  
Redo Buffers                2371584 bytes  
Database mounted.  
SQL> alter database archivelog;  
  
Database altered.  
  
SQL> alter database open;  
  
Database altered.  
  
SQL> archive log list  
Database log mode              Archive Mode  
Automatic archival             Enabled  
Archive destination            /u01/app/oracle/oradata/arch  
Oldest online log sequence     3  
Next log sequence to archive   5  
Current log sequence           5  
SQL>   
 
In addition you should enable minimum supplemental logging
SQL> alter database add supplemental log data;  
  
Database altered.  
SQL> alter database force logging;  
  
Database altered.  
SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;  
  
FOR SUPPLEME  
--- --------  
YES YES  
 
 
Add the GoldenGate directory to your LD_LIBRARY_PATH and PATH
export PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/u01/app/oracle/ggs  
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/oracle/ggs/lib  
 
The first step is to open the GoldenGate command line inte易做图ce and to create the necessary subdirectories
[oracle@ggos ggs]$ ./ggsci   
  
Oracle GoldenGate Command Interpreter for Oracle  
Version 11.2.1.0.7 16934304 OGGCORE_11.2.1.0.7_PLATFORMS_130709.1600.1_FBO  
Linux, x64, 64bit (optimized), Oracle 11g on Jul 18 2013 07:04:28  
  
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.  
  
  
  
GGSCI (ggos) 1> create subdirs  
  
Creating subdirectories under current directory /u01/app/oracle/ggs  
  
Parameter files                /u01/app/oracle/ggs/dirprm: already exists  
Report files                   /u01/app/oracle/ggs/dirrpt: created  
Checkpoint files               /u01/app/oracle/ggs/dirchk: created  
Process status files           /u01/app/oracle/ggs/dirpcs: created  
SQL script files               /u01/app/oracle/ggs/dirsql: created  
Database definitions files     /u01/app/oracle/ggs/dirdef: created  
Extract data files             /u01/app/oracle/ggs/dirdat: created  
Temporary files                /u01/app/oracle/ggs/dirtmp: created  
Stdout files                   /u01/app/oracle/ggs/dirout: created  
  
  
GGSCI (ggos) 2>   
 
The second step is to create a parameter file for the manager which at least contains a PORT number for the manager
GGSCI (ggos) 3> edit param mgr  
 
add the following content to the parameter file
GGSCI (ggos) 2> view param mgr    
  
PORT 7809  
 
Save the parameter file, exit from the editor, start the manager and verify if it is running
GGSCI (ggos) 1> start mgr  
  
Manager started.  
  
  
GGSCI (ggos) 2> info all  
  
Program     Status      Group       Lag at Chkpt  Time Since Chkpt  
  
MANAGER     RUNNING                                             
  
  
GGSCI (ggos) 3> info mgr  
  
Manager is running (IP port ggos.7809).  
 
 
Installing and setting up Oracle GoldenGate on the PostgreSQL machine
Then add the lib directory to the LD_LIBRARY_PATH and PATH
export LD_LIBRARY_PATH=/data/pgsql/lib:/data/pgsql/ggs/lib  
export PATH=/data/pgsql/bin:/data/pgsql/ggs:$PATH  
 
GoldenGate uses an ODBC connection to connect to the Postgres database. The ODBC driver is shipped with the installation and on Unix you have to create the ODBC configuration file which is commonly called odbc.ini on your own
Here the file I used
[postgres@ggpgt ggs]$ pwd  
/data/pgsql/ggs  
[postgres@ggpgt ggs]$ cat odbc.ini   
[ODBC Data Sources]  
GG_Postgres=DataDirect 6.1 PostgreSQL Wire Protocol  
[ODBC]  
IANAAppCodePage=106  
InstallDir=/data/pgsql/ggs  
[GG_Postgres]  
Driver=/data/pgsql/ggs/lib/GGpsql25.so  
Description=DataDirect 6.1 PostgreSQL Wire Protocol  
Database=repdb  
HostName=ggpgt  
PortNumber=1521  
LogonID=zwc  
Password=zwc  
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,