ogg_概述

本文详细介绍了Oracle GoldenGate的架构组成,包括关键组件如manager、extract、pump和replicat进程的功能与工作原理。同时探讨了GoldenGate支持的数据类型、DML操作以及在多实例环境下如何设置Oracle变量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Oracle GoldenGate 包括goldengate 、goldengate director(goldengate management pack) 、goldengate veridata
   其中,goldengate director 为其提供GUI配置界面。goldengate veridata 为其提供源端-目标端数据比对和校验功能。

架构: 

1   manager 进程:  gg 的控制进程,运行在 source/target 两端,两端各 有且仅有一个rmanager进程。
    manager 作用:  启动,监控,重启gg 的其他进程,报告错误及事件,分配数据存储空间,发布阀值报告。
    manager 状态: running, stopped 两种状态。

2  extract 进程: extract 进程运行 在 source 端,负责从source数据库or日志中捕获数据。
    extract 按其所处阶段不同,extract 作用按时间划分:
  A, 初始数据装载阶段:  此阶段,extract进程主要从source的数据表,抽取数据
  B, 同步变化捕获阶段:初始数据同步完成后,extract 进程负责捕获source数据的变化(DML 和 DDL).

    extract进程 利用其内在的checkpoint 机制: 周期性地检查并记录其读写的位置, ---通常是写入到一个本地 trail文件
    extract 写入本地trail 文件机制: 这是为了保证extract进程在终止,或者OS 系统宕机情况下,当重启extract 进程后,gg能够恢复到以前的状态,从上一个端点处继续操作,防止数据丢失。
    extract 状态 :  stopped(正常停止),starting(正在启动),running(运行)、abended(异常结束).

3  pump 进程: 运行在数据库source端,其作用: 如果source端使用了本地的trail文件,pump进程就会把trail 以数据块形式通过TCP/IP协议发送到目标端。
      
                      :  如果source端不使用本地trai文件,那么extract进程在抽取完数据后,直接投递target端。

 3.1   与pump 进程相对应的,脚server collector 进程,可以不关注(在target端), 其作用是source端把extract/pump 投递过来的数据块,重装trail文件。 ---- target 端的trail 进程。


4  trail 文件: 运行在target,source端,trail 文件存在的目的是防止单点故障,并且使用checkpoint 机制记录读写位置,如果故障出现,数据可以根据checkpoint 记录重传。    trail 文件不是必须的。

5  replicat 进程: 运行在target端,是数据传递最后一站,负责读取trail文件的内容,并解析为DML,DDL 语句,然后应用到目标数据库中。 和extract 一样,replicat 也有checkpoint 内部机制。


source DB  ----EXTRACT       ---------NETWORK----------- REPLICAT   -----TARGET DB
         manager                                                                                       manager
     option( pump,trail)                                                                    trail 文件



C:\gg\ggsci 
ggsci(source) 1> create subdirs                         -----goldengate 安装完成。


重要的目录:
dirchk:         
     --用来存放检查点(checkpoint) 文件, 这是Extract和Replicat进程的检查点,文件名的格式为<groupname><sequencenumber>.<extension>. 对于Extract进程的检查点文件扩展名是.cpe, Replicat 进程的检查点文件扩展名为.cpr

dirdat:       
     --Extrac进程用来存放trail 文件

dirdef:         
     --用来存放通过 defgen工具生成的source或者target 端数据文件,通常后面加上def后缀。

dirpcs:        
    --用来存放进程状态文件,当只有进程运行时,才有这些文件,Extract的进程名是pce, Replicat进程的扩展名是pcr. Manager 进程的扩展名是.pcm

dirprm:        
    --用来存放配置参数文件目录

dirrpt:        
    --这是Extract ,Replicat, Manager 进程生成报告的所在目录。如果需要最新的报告,则使用REport命令。

dirsql:         
    --用来存放SQL 脚本文件

dirtmp:        
    --当事物所需要内存超过gg分配的内存时,默认存储这个目录,作交换使用。

-----------------------------------------------------------------------------------------------------

Oracle GoldenGate supports up to 5,000 concurrent Extract and

Replicat processes per instance of Oracle GoldenGate. Each Extract and Replicat

process needs approximately 25-55 MB of memory, or more depending on the size of

the transactions and the number of concurrent transactions.

 Non-supported Oracle data types

Oracle GoldenGate does not support the following data types.

■ Abstract data types (ADT) with scalar, LOBs, VARRAYS, nested tables, and/or REFs

■ ANYDATA

■ ANYDATASET

■ ANYTYPE

■ BFILE

■ ORDDICOM

■ TIMEZONE_ABBR

■ URITYPE

■ UROWID

See additional exclusions in the Limitations of support sections in "Summary

Tables, views, and materialized views

Oracle GoldenGate supports the following DML operations made to regular tables,

index-organized tables, clustered tables, and materialized views.

■ INSERT

■ UPDATE

■ DELETE

■ Associated transaction control operations

Oracle GoldenGate supports tables that contain only one column, except when the

column contains one of the following data types:

– LOB

– LONG

– Nested table

– User defined data type

– VARRAY

– XML


Oracle GoldenGate supports tables with these partitioning attributes:

– Range partitioning

– Hash Partitioning

– Interval Partitioning

– System Partitioning

– Composite Partitioning

– Virtual Column-Based Partitioning

– Reference Partitioning

– List Partitioning 

Oracle GoldenGate supports tables with virtual columns, but does not capture

change data for these columns or apply change data to them: The database does

not write virtual columns to the transaction log, and the Oracle database does

permit DML on virtual columns. 

Oracle GoldenGate supports replication to and from Oracle Exadata

Specifying Oracle variables on UNIX and Linux systems

If there is one instance of Oracle on the system, set ORACLE_HOME and ORACLE_SID at the

system level. If you cannot set them that way, use the following SETENV statements in

the parameter file of every Extract and Replicat group that will be connecting to the

instance. The SETENV parameters override the system settings and allow the Oracle

GoldenGate process to set the variables at the session level when it connects to the

database.

SETENV (ORACLE_HOME = “path to Oracle home location”)

SETENV (ORACLE_SID = “SID”)

If there are multiple Oracle instances on the system with Extract and Replicat

processes connecting to them, you will need to use a SETENV statement in the

parameter file of each process group and point it to the correct instance. For example,

the following shows parameter files for two Extract groups, each capturing from a

different Oracle instance.

Group 1:

EXTRACT ora9a

SETENV (ORACLE_HOME = “/home/oracle/ora/product”)

SETENV (ORACLE_SID = “oraa”)

USERID ggsa, PASSWORD ggsa

RMTHOST sysb

RMTTRAIL /home/ggs/dirdat/rt

TABLE hr.emp;

TABLE hr.salary;

Group 2:

EXTRACT orab

SETENV (ORACLE_HOME = “/home/oracle/ora/product”)

SETENV (ORACLE_SID = “orab”)

USERID ggsb, PASSWORD ggsb

RMTHOST sysb

RMTTRAIL /home/ggs/dirdat/st

TABLE fin.sales;

TABLE fin.cust;

MGR:

PORT 7809

DYNAMICPORTLIST 7810-7820, 7830

AUTOSTART ER t*

AUTORESTART ER t*, RETRIES 4, WAITMINUTES 4

STARTUPVALIDATIONDELAY 5

PURGEOLDEXTRACTS /ogg/dirdat/tt*, USECHECKPOINTS, MINKEEPHOURS 2

1. In GGSCI on the source system, create the Extract parameter file.

EDIT PARAMS name

Where: name is the name of the primary Extract.

2. Enter the Extract parameters in the order shown, starting a new line for each

parameter statement. Examples are provided for classic and integrated capture.

Your input variables will be different. See Table 42 for descriptions.

Basic parameters for the primary Extract group in classic capture mode:

EXTRACT finance

USERID ogg,

 PASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1

ENCRYPTTRAIL AES192, KEYNAME mykey1

EXTTRAIL /ggs/dirdat/lt

SEQUENCE hr.employees_seq;

TABLE hr.*;

Basic parameters for the primary Extract group in integrated capture mode

where the source database is the mining database:

EXTRACT financep

USERID ogg, &

 PASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1

ENCRYPTTRAIL AES192, KEYNAME mykey1

EXTTRAIL /ggs/dirdat/lt

SEQUENCE hr.employees_seq;

TABLE hr.*;

Basic parameters for the primary Extract group in integrated capture mode

where the mining database is a downstream database:

EXTRACT financep

USERID ogg, PASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1

TRANLOGOPTIONS [MININGUSER oggm, &

 MININGPASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1]

TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 164, &

 DOWNSTREAM_REAL_TIME_MINE y)

ENCRYPTTRAIL AES192, KEYNAME mykey1

EXTTRAIL /ggs/dirdat/lt

SEQUENCE hr.employees_seq;

TABLE hr.*;

 Configuring the data pump

These steps configure the data pump that reads the local trail and sends the data

across the network to a remote trail.

1. In GGSCI on the source system, create the data-pump parameter file.

EDIT PARAMS name

Where: name is the name of the data pump Extract.

2. Enter the data-pump parameters in the order shown, starting a new line for each

parameter statement. Your input variables will be different. See Table 4–3 for

descriptions.

Basic parameters for the data-pump Extract group:

EXTRACT extpump

USERID ogg, PASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1

DECRYPTTRAIL AES192, KEYNAME mykey1

RMTHOST fin1, MGRPORT 7809 ENCRYPT AES192, KEYNAME securekey2

ENCRYPTTRAIL AES192, KEYNAME mykey1

RMTTRAIL /ggs/dirdat/rt

SEQUENCE hr.employees_seq;

TABLE hr.*;

Configuring Replicat for change delivery

1. From the Oracle GoldenGate directory on the target, run GGSCI and issue the

DBLOGIN command to log into the target database.

DBLOGIN, USERID db_user [, PASSWORD pw [encryption options]]

2. In GGSCI, create the checkpoint table in a schema of your choice (ideally

dedicated to Oracle GoldenGate).

ADD CHECKPOINTTABLE owner.table

4.9.1.2 Specifying the checkpoint table in the Oracle GoldenGate configuration

1. Create a GLOBALS file (or edit the existing one).

EDIT PARAMS ./GLOBALS

2. In the GLOBALS file, enter the CHECKPOINTTABLE parameter.

CHECKPOINTTABLE owner.table

Where: owner.table is the owner and a name that is supported by the database.

3. Save and close the GLOBALS file.

4.9.2 Configuring Replicat

These steps configure the Replicat process in a basic way without any special mapping

or conversion of the data. For more advanced mapping options, see the Oracle

GoldenGate Windows and UNIX Administrator's Guide.

1. In GGSCI on the target system, create the Replicat parameter file.

EDIT PARAMS name

Where: name is the name of the Replicat group.

2. Enter the Replicat parameters in the order shown, starting a new line for each

parameter statement. See Table 4–4 for descriptions.

REPLICAT financer

USERID ogg, PASSWORD AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

 AES128, ENCRYPTKEY securekey1

-- SUPPRESSTRIGGERS is for Oracle 10.2.0.5 & later patches, and

-- for Oracle 11.2.0.2 and later 11gR2 versions

-- See following "Note" for how SUPPRESSTRIGGERS works.

DBOPTIONS SUPPRESSTRIGGERS

DECRYPTTRAIL AES192, KEYNAME mykey1

ASSUMETARGETDEFS

DISCARDFILE /users/ogg/disc

MAP hr.*, TARGET hr2.*;

By default, one integrated capture Extract requests the logmining server to run with

max_sga_size of 1GB and a parallelism of 2. Thus, if you are running three Extracts

in integrated capture mode in the same database instance, you need at least 3 GB of

memory allocated to the Streams pool. As best practice, keep 25 percent of the Streams

pool available. For example, if there are three Extracts in integrated capture mode, set

streams_pool_size to the following:

3 GB + (3 GB * 0.25) = 3.75 GB

Setting NLS_LANG with SETENV

These instructions set NLS_LANG from the Replicat parameter file.

1. Use the following syntax to set NLS_LANG with the SETENV parameter.

SETENV (NLS_LANG = NLS_LANGUAGE_NLS_TERRITORY.NLS_CHARACTERSET)

The following is an example from the UNIX platform:

SETENV (NLS_LANG = “AMERICAN_AMERICA.AL32UTF8”)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值