GoldenGate DB11gr2配置手册

时间:2024-01-05 19:20:56

GoldenGate DB11gr2配置手册

  1. 源端数据库配置

1.1源端数据库打开Archive Log:

SQL>shutdown immediate;

SQL>startup mount;

SQL>alter database archivelog;

SQL>alter database open;

SQL>archive log list;

1.2源端数据库打开数据库级最小附加日志及force logging:

SQL>SELECT supplemental_log_data_min, force_logging FROM v$database;

SQL>alter database add supplemental log data;

SQL>alter database force logging;

切换日志以使附加日志生效:

SQL>ALTER SYSTEM switch logfile;

1.3 Enabling Oracle GoldenGate in the Database:

SQL> show parameter enable_goldengate_replication

SQL> alter system set enable_goldengate_replication = true scope=both;

  1. 在源端创建用户并授权

2.1在源端数据库创建GoldenGate用户:

SQL> create user ogg identified by ogg;

SQL>GRANT DBA to ogg;

SQL> BEGIN 
  dbms_goldengate_auth.grant_admin_privilege 
  ( 
    grantee => 'ogg', 
    privilege_type => 'CAPTURE', 
    grant_select_privileges => TRUE 
  ); 
END; 
/

3. 静默安装OGG

./runInstaller -silent -responseFile 
/u01/app/oracle/ogg/fbo_ggs_AIX_ppc_shiphome/Disk1/response/oggcore.rsp

响应文件实例:

####################################################################

## Copyright(c) Oracle Corporation
2017. All rights reserved.     ##

##                                                               
##

## Specify values for the variables
listed below to customize     ##

## your installation.                                             ##

##                                                               
##

## Each variable is associated with
a comment. The comment        ##

## can help to populate the
variables with the appropriate        ##

## values.                                                       
##

##                                                               
##

## IMPORTANT NOTE: This file should
be secured to have read       ##

## permission only by the oracle
user or an administrator who     ##

## own this installation to protect
any sensitive input values.   ##

##                                                               
##

####################################################################

#-------------------------------------------------------------------------------

# Do not change the following
system generated value.

#-------------------------------------------------------------------------------

oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2

################################################################################

##                                                                           
##

## Oracle GoldenGate installation
option and details                         
##

##                                                                           
##

################################################################################

#-------------------------------------------------------------------------------

# Specify the installation option.

# Specify ORA12c for installing
Oracle GoldenGate for Oracle Database 12c and

#         ORA11g for installing Oracle
GoldenGate for Oracle Database 11g

#-------------------------------------------------------------------------------

INSTALL_OPTION=ORA11g

#-------------------------------------------------------------------------------

# Specify a location to install
Oracle GoldenGate

#-------------------------------------------------------------------------------

SOFTWARE_LOCATION=/u01/app/oracle/ogg122

#-------------------------------------------------------------------------------

# Specify true to start the manager
after installation.

#-------------------------------------------------------------------------------

START_MANAGER=FALSE

#-------------------------------------------------------------------------------

# Specify a free port within the
valid range for the manager process.

# Required only if START_MANAGER is
true.

#-------------------------------------------------------------------------------

MANAGER_PORT=7809

#-------------------------------------------------------------------------------

# Specify the location of the
Oracle Database.

# Required only if START_MANAGER is
true.

#-------------------------------------------------------------------------------

DATABASE_LOCATION=/u01/app/oracle/product/11.2.0/dbhome_1

################################################################################

##                                                                            ##

## Specify details to Create
inventory for Oracle installs                   
##

## Required only for the first
Oracle product install on a system.           
##

##                                                     
                      ##

################################################################################

#-------------------------------------------------------------------------------

# Specify the location which holds
the install inventory files.

# This is an optional parameter if
installing on

# Windows based Operating System.

#-------------------------------------------------------------------------------

INVENTORY_LOCATION=/home/oracle/gg/inventory

#-------------------------------------------------------------------------------

# Unix group to be set for the
inventory directory.

# This parameter is not applicable
if installing on

# Windows based Operating System.

#-------------------------------------------------------------------------------

UNIX_GROUP_NAME=oracle

4. 源端配置OGG进程

4.1配置OGG extract进程exthr

GGSCI> edit
param exthr

extract exthr

userid ogg@orcl, password
ogg

exttrail ./dirdat/tm

table hr.*;

4.2在mgr中添加extract进程

GGSCI> add extract
exthr,tranlog,begin now

GGSCI> add exttrail
./dirdat/tm,extract exthr,megabytes 10

GGSCI>info extract exthr

4.3在OGG中添加表级附加日志

GGSCI>dblogin
userid ogg password ogg

GGSCI> add
trandata hr.*

4.5配置OGG datapump进程pumhr

GGSCI> edit param pumhr

extract pumhr

passthru

rmthost 192.168.56.102,
mgrport 7909

rmttrail ./dirdat/pn

table hr.*;

4.6在mgr中添加datapump进程pumhr

GGSCI> add extract pumhr,exttrailsource ./dirdat/tm

GGSCI> add
rmttrail ./dirdat/pn,extract pumhr,megabytes 10

5.目标数据库端配置

5.1目标数据库参数配置

SQL>alter system set enable_goldengate_replication = true scope=both;

5.2创建数据库用户并授权

SQL> create
user ogg identified by ogg;

SQL>GRANT DBA
to ogg;

SQL>BEGIN

dbms_goldengate_auth.grant_admin_privilege

(

grantee => 'ogg',

privilege_type => 'APPLY',

grant_select_privileges => TRUE

);

END;

/

6.目标端配置OGG进程

6.1配置OGG replicat进程rephr

GGSCI>edit param rephr

Replicat rephr

UserID ogg@orcl, password
ogg

AssumeTargetDefs

ddl include all

DiscardFile
dirrpt/rhr.dsc, Append

Map hr.*, Target hr.*;

6.2 配置checkpoint表

GGSCI>edit param ./GLOBALS

输入信息

CHECKPOINTTABLE ogg.ggs_checkpoint

GGSCI> dblogin userid ogg,password ogg;

GGSCI>add CHECKPOINTTABLE ogg.ggs_checkpoint

GGSCI>exit

6.3在mgr中添加replicat进程rephr

GGSCI> add
replicat rephr, exttrail ./dirdat/pn

6.4 OGG 常用命令

info + 进程名 查看进程运行状态

stats+ 进程名 查看进程统计信息

edit param +进程 编辑配置文件

start/stop + 进程名 开启/停止进程

view report + 进程名 查看报告日志信息

info xxx,showch