Golden Gate入门指导:安装篇
本次实验的安装环境: www.zzzyk.com
OS →→ Red Hat Enterprize Linux 5.4
DB →→ Oracle 10g
GG →→ ogg112101_fbo_ggs_Linux_x86_ora10g_32bit
需要注意的是、数据库版本不同的话、Golden Gate也要选择相对应的版本
㈠ 首先,将安装文件解压缩至/u01/app/oracle/ggs
[plain]
[oracle@Think vmshare]$ unzip ogg112101_fbo_ggs_Linux_x86_ora10g_32bit.zip -d /u01/app/oracle/ggs/
[oracle@Think ggs]$ tar -xvof fbo_ggs_Linux_x86_ora10g_32bit.tar
㈡ 设置相应的环境变量,建议使用 oracle 用户安装
[plain]
[oracle@Think ~]$ export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
[oracle@Think ~]$ export PATH=$ORACLE_HOME/bin:/u01/app/oracle/ggs:$PATH
[oracle@Think ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/oracle/ggs
㈢ 进入 GoldenGate 命令行模式,创建子 GoldenGate 的工作子目录
[plain]
[oracle@Think ~]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 10g on Apr 23 2012 07:06:02
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (Think) 1> create subdirs
Creating subdirectories under current directory /home/oracle
Parameter files /home/oracle/dirprm: created
Report files /home/oracle/dirrpt: created
Checkpoint files /home/oracle/dirchk: created
Process status files /home/oracle/dirpcs: created
SQL script files /home/oracle/dirsql: created
Database definitions files /home/oracle/dirdef: created
Extract data files /home/oracle/dirdat: created
Temporary files /home/oracle/dirtmp: created
Stdout files /home/oracle/dirout: created
㈣ 接下来、需要在Oracle数据库中创建一个专属用户,用于 GoldenGate Manager进程,Extract进程和Replicat进程
[plain]
idle> conn / as sysdba
Connected.
sys@ORCL> create tablespace ggs_data datafile size 80M;
Tablespace created.
sys@ORCL> create user ogg identified by ogg default tablespace ggs_data;
User created.
sys@ORCL> grant connect,resource to ogg;
Grant succeeded.
sys@ORCL> grant select any dictionary,select any table to ogg;
Grant succeeded.
sys@ORCL> grant create table to ogg;
Grant succeeded.
sys@ORCL> grant flashback any table to ogg;
Grant succeeded.
sys@ORCL> grant execute on dbms_flashback to ogg;
Grant succeeded.
sys@ORCL> grant execute on utl_file to ogg;
Grant succeeded.
㈤ 确认我们刚才创建的ogg用户能够登入RDBMS
[plain]
[oracle@Think ggs]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 10g on Apr 23 2012 07:06:02
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (Think) 1> DBLOGIN USERID ogg,PASSWORD ogg
Successfully logged into database.
㈥ 在数据库级别创建supplemental log、否则、唤醒Extract进程时会报错
[plain]
sys@ORCL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
Database altered.
sys@ORCL> select supplemental_log_data_min,supplemental_log_data_pk,supplemental_log_data_ui,
2 supplemental_log_data_fk,supplemental_log_data_all
3 from v$database;
SUPPLEME SUP SUP SUP SUP
-------- --- --- --- ---
IMPLICIT NO NO NO YES
㈦ 实施过程中遇到的一个错误
[plain]
GGSCI (Think) 1> DBLOGIN USERID ogg,PASSWORD ogg
Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory
Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory
Aborted
需要在ggs的HOME目录下执行ggsci才OK,在其他位置执行会报错,找不到文件或是目录