迁移背景
迁移过程
alter session force parallel query parallel 10;
alter session force parallel ddl parallel 10;
alter session force parallel dml parallel 10;
create materialized view TABLE_O refresh fast with primary key on demand as
select * FROM USER.BIG_TABLE
where mod(decode(length(col1), 1,ASCII(substr(col1, -1, 1)),
2, ASCII(substr(col1, -1, 1)) + ASCII(substr(col1, -2, 1)),
3, ASCII(substr(col1, -1, 1)) + ASCII(substr(col1, -2, 1)) + ASCII(substr(col1, -3, 1)) ,
......
, 150) = 0 ;
分表踩坑:
由于ogg initial load初始化效率较低,故采用kettle同步mv数据到MySQL:
CREATE USER GOLDENGATE IDENTIFIED BY goldengate DEFAULT TABLESPACE users TEMPORARY TABLESPACE TEMP;
GRANT CONNECT TO GOLDENGATE;
GRANT ALTER ANY TABLE TO GOLDENGATE;
GRANT ALTER SESSION TO GOLDENGATE;
GRANT CREATE SESSION TO GOLDENGATE;
GRANT FLASHBACK ANY TABLE TO GOLDENGATE;
GRANT SELECT ANY DICTIONARY TO GOLDENGATE;
GRANT SELECT ANY TABLE TO GOLDENGATE;
GRANT RESOURCE TO GOLDENGATE;
GRANT EXECUTE ANY TYPE TO GOLDENGATE;
GRANT SELECT ANY TRANSACTION TO GOLDENGATE;
GRANT CREATE any TABLE,CREATE any SEQUENCE TO goldengate ;
GRANT INSERT ANY TABLE TO GOLDENGATE;
GRANT UPDATE ANY TABLE TO GOLDENGATE;
GRANT DELETE ANY TABLE TO GOLDENGATE;
GRANT CREATE ANY INDEX TO GOLDENGATE;
grant unlimited tablespace to goldengate ;
grant execute on DBMS_FLASHBACK to goldengate;
grant COMMENT ANY TABLE to goldengate;
alter system set enable_goldengate_replication=true sid=* scope=both;
exec dbms_goldengate_auth.grant_admin_privilege(goldengate)
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
alter database FORCE LOGGING;
set line 350 pages 999
col NAME for a15
col LOG_MODE for a15
col OPEN_MODE for a15
col PLATFORM_NAME for a25
col FORCE_LOGGING for a20
col SUPPLEMENTAL_LOG_DATA_MIN for a25
SELECT
NAME,
LOG_MODE,
OPEN_MODE,
PLATFORM_NAME,
FORCE_LOGGING,
SUPPLEMENTAL_LOG_DATA_MIN
FROM
V$DATABASE;
alter system archive log current;
export TNS_ADMIN=/data/ggsdata/tnsadmin
exora=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =10.10.10.11 )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =test )
)
)
add credentialstore
alter credentialstore add user goldengate@exora alias exora
INFO CREDENTIALSTORE
dblogin useridalias exora
add trandata user.table_0
info trandata user.table_0
add trandata user.table_1
info trandata user.table_2
......
PORT 7809
DYNAMICPORTLIST 7810-7819
ACCESSRULE, PROG SERVER, ALLOW
AUTOSTART EXTRACT *
AUTORESTART EXTRACT * retries 5 waitminutes 3
PURGEOLDEXTRACTS /ogg/ggs_oracle/dirdat/*,usecheckpoints, minkeepdays 2
LAGREPORTMINUTES 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 60
Start mgr
--base parameter
extract ex_ora
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
SETENV (TNS_ADMIN=/data/ggsdata/tnsadmin)
useridalias exora
numfiles 5000
TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 256, parallelism 1)
exttrail /data/ggsdata/dirdat/yx
DISCARDFILE /data/ggsdata/dirrpt/ex_ora_01.dsc,APPEND,MEGABYTES 100
DISCARDROLLOVER AT 3:00
REPORTCOUNT EVERY 30 MINUTES, RATE
REPORTROLLOVER AT 9:00
WARNLONGTRANS 2h, CHECKINTERVAL 30m
TRANLOGOPTIONS INTEGRATEDPARAMS(_CKPT_RETENTION_CHECK_FREQ 300)
TRANLOGOPTIONS EXCLUDEUSER GOLDENGATE
-- Performance optimization
cachemgr cachesize 512M, cachedirectory /data/ggsdata/dirtmp 10G
BR BRINTERVAL 40M, BRDIR BR
--map objects(150个分表)
table UPSYS.t_audition_0;
table UPSYS.t_audition_1;......
dblogin useridalias exora
REGISTER EXTRACT ex_ora , DATABASE
ADD EXTRACT ex_ora, INTEGRATED TRANLOG, BEGIN NOW
ADD EXTTRAIL /data/ggsdata/dirdat/yx, EXTRACT ex_ora , MEGABYTES 50
start exora
create user goldengate@% identified by Goldengate-123;
grant all on *.* to goldengate@%;
edit params mgr
PORT 7839
DYNAMICPORTLIST 7840-7849
ACCESSRULE, PROG SERVER, ALLOW
AUTOSTART REPLICAT *
AUTORESTART REPLICAT * retries 5 waitminutes 1
--PURGEOLDEXTRACTS /ogg/ggs_mysql/dirdat/*,usecheckpoints, minkeepdays 2
LAGREPORTMINUTES 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 60
--STARTUPVALIDATIONDELAY 5
DBLOGIN sourcedb user@10.10.10.12:3306, USERID goldengate, PASSWORD Goldengate-123
Start mgr
create database pt;
cd $OGG_HOME
ggsci
edit param ./GLOBALS
checkpointtable pt.ggs_checkpoint
DBLOGIN sourcedb pt@10.10.10.12:3306, USERID goldengate, PASSWORD Goldengate-123
add checkpointtable pt.ggs_checkpoint
add replicat rp_ora,exttrail /data/ggsdata/dirdat/yx,checkpointtable pt.ggs_checkpoint
edit params rp_ora
replicat rp_ora
targetdb user@10.10.10.12:3306,userid goldengate,password Goldengate-123
--sourcedefs /data/ggsdata/dirdef/zly.def
discardfile /data/ggsdata/dirrpt/rep_exora.dsc,append,megabytes 50
REPERROR DEFAULT, ABEND
REPORTCOUNT EVERY 60 MINUTES, RATE
REPORTROLLOVER AT 9:00
MAP user.table_0, target user.table_0;
MAP user.table_1, target user.table_1;
......
MAP user.table_149, target user.table_149;
Start rp_ora
set linesize 350 pages 999
col OWNER for a15
col JOB_NAME for a25
col JOB_CREATOR for a25
col ENABLED for a10
col START_DATE for a25
col NEXT_RUN_DATE for a25
col LAST_START_DATE for a25
col REPEAT_INTERVAL for a40
col JOB_ACTION for a60
SELECT OWNER,
JOB_NAME,
ENABLED,
STATE,
JOB_TYPE,
JOB_ACTION,
to_char(START_DATE, yyyy/mm/dd hh:mm) START_DATE,
to_char(LAST_START_DATE, yyyy/mm/dd hh:mm) LAST_START_DATE,
to_char(NEXT_RUN_DATE, yyyy/mm/dd hh:mm) NEXT_RUN_DATE,
REPEAT_INTERVAL,
RUN_COUNT
FROM dba_scheduler_jobs
WHERE
JOB_ACTION LIKE %TABLE_%"%
ORDER BY 6 ;
exec dbms_scheduler.enable(name=>upper(UPSYS.MV_RF$J_0_S_55082) );
业务停止后,手动执行一次快速刷新,ogg无延迟后,将业务切换到MySQL数据库。
经验总结
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129107.html
摘要:年月日,迁移服务解决方案在城市峰会中正式发布。迁移服务向分布式架构升级的直接路径基于上述问题和挑战,同时经过蚂蚁十年数据库架构升级的先进经验,蚂蚁金服为客户打造了这款一站式数据迁移解决方案迁移服务,简称。 2019年1月4日,OceanBase迁移服务解决方案在ATEC城市峰会中正式发布。蚂蚁金服资深技术专家师文汇和技术专家韩谷悦共同分享了OceanBase迁移服务的重要特性和业务实践...
摘要:年月日,迁移服务解决方案在城市峰会中正式发布。迁移服务向分布式架构升级的直接路径基于上述问题和挑战,同时经过蚂蚁十年数据库架构升级的先进经验,蚂蚁金服为客户打造了这款一站式数据迁移解决方案迁移服务,简称。 2019年1月4日,OceanBase迁移服务解决方案在ATEC城市峰会中正式发布。蚂蚁金服资深技术专家师文汇和技术专家韩谷悦共同分享了OceanBase迁移服务的重要特性和业务实践...
摘要:打造满足未来稳态敏态业务的双态架构分析机构预测,年全球的都是由数字化来驱动。单奖定介绍说,在解决敏态稳态同时落地的需求,联想不仅提供支持双态的混合云架构,还能帮助企业实现数据的价值。今天,越来越多的企业认识到,在企业数字化转型的道路上,IT基础设施是必不可少的重要支撑。随着企业数字化转型脚步加快,IT基础设施也正在发生重要变革,混合云、网络虚拟化、安全等成为这轮变革的关键词。作为对市场最新变...
摘要:在使用的新特性时,出现如下,身为完美主义强迫症患者,怎么能忍展开详情无脑翻译一下如果您需要你的代码兼容多个版本例如如果您正在构建一个库,请启用此检查。检查设置中可以指定你的代码需要兼容的版本的范围。 在使用Python 3.6的新特性f-strings时,出现如下warning,身为完美主义+强迫症患者,怎么能忍? Python version 2.7 does not support...
阅读 1359·2023-01-11 13:20
阅读 1708·2023-01-11 13:20
阅读 1215·2023-01-11 13:20
阅读 1909·2023-01-11 13:20
阅读 4166·2023-01-11 13:20
阅读 2761·2023-01-11 13:20
阅读 1402·2023-01-11 13:20
阅读 3674·2023-01-11 13:20