遷移背景
遷移過程
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數(shù)據(jù)到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個(gè)分表)
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) );
業(yè)務(wù)停止后,手動(dòng)執(zhí)行一次快速刷新,ogg無延遲后,將業(yè)務(wù)切換到MySQL數(shù)據(jù)庫。
經(jīng)驗(yàn)總結(jié)
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/129107.html
摘要:年月日,遷移服務(wù)解決方案在城市峰會(huì)中正式發(fā)布。遷移服務(wù)向分布式架構(gòu)升級(jí)的直接路徑基于上述問題和挑戰(zhàn),同時(shí)經(jīng)過螞蟻十年數(shù)據(jù)庫架構(gòu)升級(jí)的先進(jìn)經(jīng)驗(yàn),螞蟻金服為客戶打造了這款一站式數(shù)據(jù)遷移解決方案遷移服務(wù),簡稱。 2019年1月4日,OceanBase遷移服務(wù)解決方案在ATEC城市峰會(huì)中正式發(fā)布。螞蟻金服資深技術(shù)專家?guī)熚膮R和技術(shù)專家韓谷悅共同分享了OceanBase遷移服務(wù)的重要特性和業(yè)務(wù)實(shí)踐...
摘要:年月日,遷移服務(wù)解決方案在城市峰會(huì)中正式發(fā)布。遷移服務(wù)向分布式架構(gòu)升級(jí)的直接路徑基于上述問題和挑戰(zhàn),同時(shí)經(jīng)過螞蟻十年數(shù)據(jù)庫架構(gòu)升級(jí)的先進(jìn)經(jīng)驗(yàn),螞蟻金服為客戶打造了這款一站式數(shù)據(jù)遷移解決方案遷移服務(wù),簡稱。 2019年1月4日,OceanBase遷移服務(wù)解決方案在ATEC城市峰會(huì)中正式發(fā)布。螞蟻金服資深技術(shù)專家?guī)熚膮R和技術(shù)專家韓谷悅共同分享了OceanBase遷移服務(wù)的重要特性和業(yè)務(wù)實(shí)踐...
摘要:打造滿足未來穩(wěn)態(tài)敏態(tài)業(yè)務(wù)的雙態(tài)架構(gòu)分析機(jī)構(gòu)預(yù)測,年全球的都是由數(shù)字化來驅(qū)動(dòng)。單獎(jiǎng)定介紹說,在解決敏態(tài)穩(wěn)態(tài)同時(shí)落地的需求,聯(lián)想不僅提供支持雙態(tài)的混合云架構(gòu),還能幫助企業(yè)實(shí)現(xiàn)數(shù)據(jù)的價(jià)值。今天,越來越多的企業(yè)認(rèn)識(shí)到,在企業(yè)數(shù)字化轉(zhuǎn)型的道路上,IT基礎(chǔ)設(shè)施是必不可少的重要支撐。隨著企業(yè)數(shù)字化轉(zhuǎn)型腳步加快,IT基礎(chǔ)設(shè)施也正在發(fā)生重要變革,混合云、網(wǎng)絡(luò)虛擬化、安全等成為這輪變革的關(guān)鍵詞。作為對(duì)市場最新變...
摘要:在使用的新特性時(shí),出現(xiàn)如下,身為完美主義強(qiáng)迫癥患者,怎么能忍展開詳情無腦翻譯一下如果您需要你的代碼兼容多個(gè)版本例如如果您正在構(gòu)建一個(gè)庫,請(qǐng)啟用此檢查。檢查設(shè)置中可以指定你的代碼需要兼容的版本的范圍。 在使用Python 3.6的新特性f-strings時(shí),出現(xiàn)如下warning,身為完美主義+強(qiáng)迫癥患者,怎么能忍? Python version 2.7 does not support...
閱讀 1353·2023-01-11 13:20
閱讀 1700·2023-01-11 13:20
閱讀 1212·2023-01-11 13:20
閱讀 1904·2023-01-11 13:20
閱讀 4164·2023-01-11 13:20
閱讀 2751·2023-01-11 13:20
閱讀 1397·2023-01-11 13:20
閱讀 3666·2023-01-11 13:20