首页 > 数据库 >ORACLE 19C PDB FOR MYSQL 5.7 部署ogg

ORACLE 19C PDB FOR MYSQL 5.7 部署ogg

时间:2023-02-08 22:58:23浏览次数:45  
标签:5.7 C# grant -- GGSCI MYSQL ORACLE ogg GOLDENGATE

一、软件配置

角色

数据库/软件版本

OGG版本

IP

源端服务器

Oracle Datbase 19

Oracle C##GOLDENGATE 19.1.0.0.4

10.10.10.32

目标服务器

MYSQL5.7

19_ggs_Linux_x64_MySQL_64bit

10.10.10.33

二、源端配置

 

1、OGG初始化

 

--源端oracle数据库操作

 

1)    打开minimal supplemental logging和force logging

 

SQL> alter database add supplemental log data;

SQL> alter database force logging;

SQL> alter system set ENABLE_C##GOLDENGATE_REPLICATION=true scope=both;

--修改 streams_pool_size参数,需要分别修改各个实例,不能用sid='*'

SQL> alter system set streams_pool_size=512M scope=both sid='instance1';

SQL> alter system set streams_pool_size=512M scope=both sid='instance2';

注意:由于是12c以上oracle数据库 必须使用集成模式必须开启streams

2)    创建C##GOLDENGATE用户

create user C##C##GOLDENGATE identified by "xxxxxxxx"

  default tablespace USERS

  temporary tablespace TEMP

  profile DEFAULT;

-- Grant/Revoke role privileges

grant dba to C##GOLDENGATE;

grant resource to C##GOLDENGATE;

-- Grant/Revoke system privileges

grant alter any index to C##GOLDENGATE;

grant alter any table to C##GOLDENGATE;

grant alter session to C##GOLDENGATE;

grant create any index to C##GOLDENGATE;

grant create any sequence to C##GOLDENGATE;

grant create any table to C##GOLDENGATE;

grant create session to C##GOLDENGATE;

grant delete any table to C##GOLDENGATE;

grant dequeue any queue to C##GOLDENGATE;

grant drop any sequence to C##GOLDENGATE;

grant drop any table to C##GOLDENGATE;

grant flashback any table to C##GOLDENGATE;

grant insert any table to C##GOLDENGATE;

grant select any dictionary to C##GOLDENGATE;

grant select any table to C##GOLDENGATE;

grant select any transaction to C##GOLDENGATE;

grant unlimited tablespace to C##GOLDENGATE;

grant update any table to C##GOLDENGATE;

exec dbms_goldengate_auth.grant_admin_privilege(‘C##GOLDENGATE’,container=>’all’)  

2、源端ogg操作(10.10.10.32)

ogg安装自行安装

下载地址

 http://edelivery.oracle.com

安装 略..很简单

oracle@vm01:/home/oracle/ogg$ ./ggsci

Oracle C##GOLDENGATE Command Interpreter for Oracle
Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO
Linux, x64, 64bit (optimized), Oracle 19c on Oct 17 2019 21:16:29
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

 

GGSCI (vm01) 1> create subdirs

 

3、创建manager参数文件(10.10.10.32)

GGSCI> edit param mgr

内容如下

port 7809
AUTOSTART EXTRACT *
autorestart er *, waitminutes 3, retries 20
PURGEOLDEXTRACTS /home/oracle/ogg/dirdat/*,usecheckpoints, minkeepdays 3
Lagcriticalminutes 30
lagreportminutes 5
ACCESSRULE, PROG *, IPADDR 10.10.*.*, ALLOW

注意:此处选择使用数据库检查点模式 端口也可以做成DYNAMICPORTLIST 7820-7830, 7833, 7835

GGSCI> start mgr

4、添加抽取进程(10.10.10.32)

GGSCI>dblogin userid C##GOLDENGATE@pdb, password "xxxxxxxx"

GGSCI>register extract extsxhx1 database container(pdbname)

GGSCI>add extract extsxhx1,integrated tranlog, begin now

GGSCI>add EXTTRAIL /home/oracle/ogg/dirdat/sx, extract extsxhx1,MEGABYTES 100

GGSCI>add schematrandata slisbase

5、创建抽取进程参数文件(10.10.10.32)

GGSCI (vm01) 1> edit param extsxhx1

extract extsxhx1
setenv (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
userid C##goldengate@10.10.10.32/orc , password "goldengate"
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100)
exttrail /home/oracle/ogg/dirdat/sx
discardfile /home/oracle/ogg/dirrpt/extsxhx1.dsc,append
discardrollover at 08:00
--dynamicresolution
GETTRUNCATES
LOGALLSUPCOLS
GETUPDATEBEFORES
NOCOMPRESSDELETES
NOCOMPRESSUPDATES
ddl include mapped objtype 'TABLE',include mapped objtype 'INDEX'
ddloptions addtrandata, report
ddloptions report
statoptions reportfetch
reportrollover at 08:00
SOURCECATALOG PDB
table slisbase.*;

注意:SOURCECATALOG参数很重要要指定具体pdbname,--dynamicresolution我把这个参数注释了应该默认就是这个

6、编辑投递进程参数

GGSCI> edit params dpsxbd6 


extract dpsxbd6
setenv (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
userid C##goldengate@10.10.10.32/orc , password "goldengate"
passthru
rmthost 10.10.10.32,mgrport 7810,compress
rmttrail /home/db/mysql/ogg/dirdat/sx
--dynamicresolution
numfiles 3000
SOURCECATALOG PDB
table slisbase.hrz;
--table slisdata.lacommision ;
--table slisdata.lccont ;
--table slisdata.lcpol ;
--table slisdata.lppol ;
--table slisdata.lccontstate ;

GGSCI> start dpsxbd6

GGSCI> info dpsxbd6

三、目标端篇配置

1、mysql用户安装ogg

解压就行免安装 自行百度

2、OGG初始化(10.10.10.33)

[mysql@vm01 ogg]$ ./ggsci

Oracle GoldenGate Command Interpreter for MySQL
Version 19.1.0.0.3 OGGCORE_19.1.0.0.0_PLATFORMS_190907.0144
Linux, x64, 64bit (optimized), MySQL Enterprise on Sep 7 2019 08:41:32
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI> create subdirs

3、创建manager 参数文件

GGSCI> edit param mgr

内容如下

port 7810
AUTORESTART REPLICAT *,RETRIES 5,WAITMINUTES 3
PURGEOLDEXTRACTS /home/db/mysql/ogg/dirdat/*,usecheckpoints, minkeepdays 3
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45

GGSCI> start mgr

GGSCI> info mgr

4、创建goldengate 数据库

mysql>create database goldengate;

注意:这里主要是为了检查点服务的

5、配置checkpoint

GGSCI> dblogin sourcedb sndb@localhost:3306, userid root,password xxxxxxxx

GGSCI> add checkpointtable goldengate.checkpoint

6、编辑GLOBALS参数

EDIT PARAMS ./GLOBALS

添加如下内容:

CHECKPOINT TABLE goldengate.checkpoint

注意:我这里没有配置,启动时候报错了告诉我已经有检查点不用在这里添加

7、创建 replicat进程

GGSCI>add replicat repsx1,exttrail /home/db/mysql/ogg/dirdat/sx,checkpointtable goldengate.checkpoint

GGSCI>edit params repsx1

内容如下

REPLICAT repsx1
targetdb sndb@10.10.10.32:3306 userid root password "oracle"
sourcedefs /home/db/mysql/ogg/dirprm/mysql.def
--reperror 1 discard
--reperror 1403 discard
--reperror 1062 discard
discardfile /home/db/mysql/ogg/dirrpt/repsx1.dsc,megabytes 100
SOURCECATALOG PDB
map slisbase.hrz,target sndb.hrz;
--map slisdata.lacommision ,target sndb.slisdata_lacommision_rt ;
--map slisdata.lccont ,target sndb.slisdata_lccont_rt ;
--map slisdata.lcpol ,target sndb.slisdata_lcpol_rt ;
--map slisdata.lppol ,target sndb.slisdata_lppol_rt ;
--map slisdata.lccontstate ,target sndb.slisdata_lccontstate_rt ;

repsx1进程启动后,确认表goldengate.checkpoint中已正确记录数据.

8、定义文件生成步骤

1)源端oracle数据库编辑定义文件所需参数文件

cd /home/oracle/ogg/dirprm

 

vi mysql.prm

写入如下内容

defsfile ./dirdef/mysql.def purge
userid C##goldengate@10.10.10.32/pdb , password "goldengate"
--defsfile /home/oracle/ogg/dirdef/mysql.def FORMAT RELEASE 12.3
TABLE SLISDATA.hrz;

 

1)生成定义文件

cd /home/oracle/ogg/

 

./defgen paramfile dirprm/mysql.prm

 

3)拷贝生成的oracle定义文件mysql.def到mysql目标端目录/home/db/mysql/ogg/dirprm下

注意:搭建过程完成

 

标签:5.7,C#,grant,--,GGSCI,MYSQL,ORACLE,ogg,GOLDENGATE
From: https://www.cnblogs.com/dbahrz/p/17103621.html

相关文章

  • 第5课、mysql +pytest
    ac      importpymysqldb=pymysql.connect(host='127.0.0.1',user='root',password='SPqaz132457/',......
  • oracle判断数据块是否存在内存buffer cache中
    文档课题:oracle判断数据块是否存在内存buffercache中.数据库:oracle11.2.0.41、概念理论通过V$BH视图可以查询.V$BH保存着BufferCache中每个BLOCK的信息.如T1表在数据文件......
  • linux安装oracle19c
    第一步:检查Linux系统版本1.执行命令lsb_release-a查看系统版本目前我使用的是阿里云丐版服务器,系统为CentOS7.3-x64第二步:下载Oracle19c的安装包和预安装包1.下载......
  • mysql数据库修改密码的几种方法
    目录MYSQL修改用户密码updatesetgrantmysqladmin在日常使用mysql数据库的时候,我们有修改mysql数据库密码的需求。以下介绍四种修改mysql数据库密码的方法。MYSQL修改用......
  • Mysql5.7安装之yum安装方式_验证通过
    https://blog.csdn.net/qq_39840846/article/details/125843225 第一步:新建一个文件mkdirmysql进入到该文件夹cdmysql第二步下载mysql源安装包wgethttp://dev.mys......
  • Linux下MySQL的配置文件(my.cnf)的存放路径
    https://blog.csdn.net/yerenyuan_pku/article/details/109919451 my.cnf是MySQL启动时加载的配置文件,一般会放在MySQL的安装目录中,用户也可以放在其他目录中进行加载。......
  • MySQL索引的基本理解
    之前一致以为索引就是简单的在原表的数据上加了一些编号,让查询更加快捷。后来发现里面还有更深的知识。索引用于快速查找具有特定列值的行。如果没有索引,MySQL必须从第......
  • 官网查找mysql安装包
    通过浏览器输入官网url:www.mysql.com打开以后的样子  找到downloads进入  鼠标中键翻页找到社区下载(MySQLCommunity(GPL)Downloads»)进入  找到mys......
  • 浅析mysql报错:Error writing file '/tmp/MY4QWdUa' (Errcode: 28 - No space left on
    一、问题背景1、报错描述:今天执行sql时发现Node服务的日志报错:SequelizeDatabaseError:EE_WRITE:Errorwritingfile'/tmp/MY4QWdUa'(Errcode:28-Nospac......
  • mysql压缩表小记
    参考文档:https://www.163.com/dy/article/GI4CH5N305319P76.htmlhttps://learn.lianglianglee.com/专栏/MySQL实战宝典/06表压缩:不仅仅是空间压缩.mdhttps://blog.csd......