goldengate downstream 配置

Posted diuxie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了goldengate downstream 配置相关的知识,希望对你有一定的参考价值。

1.整体数据库配置
三个源端和一个downstream下游抽取数据库配置:

alter system set enable_goldengate_replication=TRUE;

Alter database add supplemental log data;

Alter database add supplemental log data(primary key,unique index) columns;

Alter database add supplemental log data(all) columns;

Alter database force logging;

select SUPPLEMENTAL_LOG_DATA_MIN,SUPPLEMENTAL_LOG_DATA_PK,SUPPLEMENTAL_LOG_DATA_UI,SUPPLEMENTAL_LOG_DATA_FK,SUPPLEMENTAL_LOG_DATA_ALL,force_logging

from v$database;

2.SOURCE DB1、2、3端数据库参数调整和配置:
1.db1,db2,db3 三个库创建表空间和用户

create tablespace ogg datafile ‘ xxxxx.dbf ’ size 1g autoextend on next 1g;

alter tablespace ogg add datafile ‘ xxxx.dbf ’ size 1g autoextend on next 1g;

create user ogg account identified by oracle ;

  1. 授权:

begin

dbms_goldengate_auth.grant_admin_privilege(grantee=>\'OGG\',

GRANT_SELECT_PRIVILEGES=>TRUE,

PRIVILEGE_TYPE=>\'CAPTURE\',

DO_GRANTS=>TRUE);

END;

/

EXEC DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(\'OGG\');

EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE(\'OGG\');

GRANT SELECT ON V_$DATABASE TO OGG ;

GRANT EXECUTE ON OGG.UPDATESEQUENCE TO OGG;

GRANT EXECUTE ON OGG.REPLICATESEQUENCE TO OGG;

GRANT SELECT ON SYS.SEQ$ TO OGG;

GRANT SELECT ON SYS.USER$ TO OGG;

GRANT SELECT ON SYS.OBJ$ TO OGG;

GRANT SELECT ON DBA_SEQUENCES TO OGG;

GRANT CONNECT, RESOURCE TO OGG;

GRANT CREATE SESSION, ALTER SESSION TO OGG;

GRANT SELECT ANY DICTIONARY, SELECT ANY TABLE TO OGG;

GRANT ALTER ANY TABLE TO OGG;

GRANT FLASHBACK ANY TABLE TO OGG;

GRANT EXECUTE ON DBMS_FLASHBACK TO OGG;

GRANT SELECT ON DBA_CLUSTERS TO OGG;

GRANT SELECT ANY TRANSACTION TO OGG;

一般我都是直接给:

grant connect,resource,dba to ogg;

  1. 建表:

create table ogg.t1 as select OBJECT_ID,OWNER,Owww.walajiao.comBJECT_NAME,CREATED from dba_segments ;

create table ogg.t2 (

pid number(20) primary key not null ,

product varchar2(40),

location varchar2(40),

produce varchar2(40)

);

-- 暂时不插入数据,后面 ogg 进程配置完毕后插入

begin

for v_count in 1..100000000 loop

insert into ogg.t2 values(v_count,\'rose\',\'hangzhou10\',\'zhejiang\');

commit;

end loop;

end;

/

  1. 配置 tns 连接信息三个 sourceDB 和一个下游抽取 db-mid 都要游戏代理配置

dba1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.249.104)(PORT = 21521))

(CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = dba1)

)

)

dba2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.249.104)(PORT = 21521))

(CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = dba2)

)

)

dba3 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.249.104)(PORT = 21521))

(CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = dba3)

)

)

mid =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.249.105)(PORT = 21521))

(CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = mid)

)

)

  1. 设置本地归档路径和配置日志传输参数

以上是关于goldengate downstream 配置的主要内容,如果未能解决你的问题,请参考以下文章

Oracle GoldenGate 12.3.0.1.4 安装配置 之04 (配置数据库支持GoldenGate)

配置Goldengate从Oracle到PostgreSQL的同步复制

Oracle GoldenGate 12.3.0.1.4 安装配置 之03 (GoldenGate 安装)

GoldenGate—AUTORESTART配置

GoldenGate抽取Informix数据库安装及配置

Oracle GoldenGate零基础入门培训--安装配置诊断