點(diǎn)擊上方“IT那活兒”公眾號(hào),關(guān)注后了解更多內(nèi)容,不管IT什么活兒,干就完了?。?!
在數(shù)據(jù)庫(kù)中我們常用到主副庫(kù)來(lái)確保容災(zāi)的可能,OGG是我們用來(lái)進(jìn)行主副庫(kù)同步的產(chǎn)品,如下是OGG搭建的詳細(xì)流程。
OGG安裝及源端配置
alter database add supplemental log data ;
alter system switch logfile;
alter database force logging;
select log_mode from v$database;
安裝OGG
2.3 創(chuàng)建子目錄
./ggsci
create subdirs
cd /OGG/ogg_software/fbo_ggs_AIX_ppc_shiphome/Disk1/response
主要修改如下幾個(gè)地方:
cd 至OGG解壓目錄:
./runInstaller -silent -responseFile /OGG/ogg_software/fbo_ggs_AIX_ppc_shiphome/Disk1/response/oggcore.rsp
cd /OGG/ogg_soft
./ggsci
ggsci> create subdirs
netstat -na|grep 7809
確認(rèn)端口沒(méi)有被占用:
./ggsci
ggsci> edit params mgr
port 7809
DYNAMICPORTLIST 7810-7890
purgeoldextracts ./dirdat/* ,usecheckpoints,minkeepdays 4
AUTORESTART EXTRACT *, RETRIES 3, WAITMINUTES 5, RESETMINUTES 60
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
Start mgr
OGG同步流程
CREATE TABLESPACE ogg DATAFILE +DATA SIZE 200M AUTOEXTEND ON NEXT 100M MAXSIZE 5G;
CREATE USER goldengate IDENTIFIED BY Ogg2022 DEFAULT TABLESPACE ogg;
grant connect,resource,unlimited tablespace to goldengate;
grant CREATE SESSION, ALTER SESSION to goldengate;
grant alter system to goldengate;
grant SELECT on dba_clusters to goldengate;
grant execute on utl_file to goldengate;
grant select any dictionary to goldengate;
grant select any table to goldengate;
grant alter any table to goldengate;
grant flashback any table to goldengate;
grant execute on DBMS_FLASHBACK to goldengate;
grant EXEMPT ACCESS POLICY to goldengate;
grant select any transaction to goldengate;
grant EXP_FULL_DATABASE to goldengate;
3.3 配置環(huán)境變量
export GG_HOME=/oraclelog/OGG/ogg/ogg_insta
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib:$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin:$GG_HOME
在ogg安裝目錄下運(yùn)行GGS命令行控制界面:
cd /oracle/goldengate
./ggsci
在GGS命令行界面下創(chuàng)建子目錄:
create subdirs
修改MGR進(jìn)程參數(shù)并啟動(dòng):
edit param mgr
PORT 7809
DYNAMICPORTLIST 7810-7840
PURGEOLDEXTRACTS /oraclelog/OGG/ogg/ogg_install/dirdat/tsap*, USECHECKPOINTS, MINKEEPDAYS 3
AUTOSTART EXTRACT *
AUTORESTART EXTRACT *, RETRIES 3, WAITMINUTES 5, RESETMINUTES 60
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
用戶密碼加密
ggsci >encrypt password Ogg#2022 encryptkey default
GGSCI> edit params exttsap1
EXTRACT EXTTSAP1
dynamicresolution
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
SETENV (ORACLE_HOME=/oracle/app/oracle/product/19.0.0/db)
userid goldengate, password 秘鑰, encryptkey default
DISCARDFILE ./dirrpt/EXTTSAP1.dsc,APPEND,MEGABYTES 1024
DBOPTIONS LOBBUFSIZE 1048576
TRANLOGOPTIONS ALTARCHIVELOGDEST primary instance amptest1 /oraclelog, ALTARCHIVELOGDEST instance amptest2 /oraclelog
EXTTRAIL ./dirdat/ap
gettruncates
table *.*
dblogin userid goldengate, password #加密秘鑰#, encryptkey default
GGSCI (ogg-test) 1>dblogin userid goldengate,password Ogg#2022
GGSCI (ogg-test) 1> add extract exttsap1, tranlog, begin now ----注明:rac數(shù)據(jù)庫(kù)需要加[threads 2]
GGSCI (ogg-test) 1> add exttrail ./dirdat/ap, extract exttsap1, megabytes 200
edit params dptsap1
EXTRACT dptsap1
PASSTHRU
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
RMTHOST 134.176.15.135, MGRPORT 7809
RMTTRAIL /oradata/ogg/dirdat/ap
table *.*
增加傳輸進(jìn)程組:
GGSCI>add extract dptsap1, exttrailsource ./dirdat/ap
建立傳輸進(jìn)程和目標(biāo)端隊(duì)列文件關(guān)聯(lián)關(guān)系:
GGSCI>add rmttrail ./dirdat/ap, extract dptsap1, megabytes 200
start dptsap1
GGSCI> edit params retsap1
replicat retsap1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
userid goldengate, password 秘鑰, encryptkey default
--sourcedefs ./dirdef/retsap1.def
reperror default,discard
discardfile ./dirrpt/retsap1.dsc,append,megabytes 1024
gettruncates
handlecollisions
dynamicresolution
map *.*, target *.*; --------注:*.* 屬主.表名
GGSCI>DBLOGIN USERID goldengate, PASSWORD Ogg#2022
GGSCI>add checkpointtable goldengate.checkpoint
GGSCI>add replicat retsap1, exttrail ./dirdat/ap,checkpointtable goldengate.checkpoint
alter retsap1 extseqno 1, extrba 0
start retsap1, aftercsn XXXXXXXX
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/129218.html
OGG Integrated Native DDL簡(jiǎn)單測(cè)試 img{ display:block; margin:0 auto !important; width:100%; } body{ width:75%;...
摘要:編碼結(jié)束后,調(diào)用函數(shù),來(lái)銷(xiāo)毀和編碼器。調(diào)用函數(shù)對(duì)參數(shù)中的格式音頻數(shù)據(jù)幀進(jìn)行解碼,參數(shù)中存放解碼后的音頻數(shù)據(jù)幀。調(diào)用函數(shù)來(lái)銷(xiāo)毀和解碼器說(shuō)重點(diǎn)當(dāng)做即時(shí)通信產(chǎn)品,像微信這種的手機(jī)端,它們接受到很有可能就是協(xié)議壓縮后的音頻文件。 showImg(https://segmentfault.com/img/bVbtzkh?w=1024&h=682); 這么牛逼的輪子,肯定要美圖鎮(zhèn)樓 Speex是一...
摘要:?jiǎn)栴}九庫(kù)控制文件擴(kuò)展報(bào)錯(cuò)庫(kù)的擴(kuò)展報(bào)錯(cuò),用的是裸設(shè)備,和還是原來(lái)大小,主庫(kù)的沒(méi)有報(bào)錯(cuò),并且大小沒(méi)有變,求解釋。專家解答從報(bào)錯(cuò)可以看出,控制文件從個(gè)塊擴(kuò)展到個(gè)塊時(shí)報(bào)錯(cuò),而裸設(shè)備最大只支持個(gè)塊,無(wú)法擴(kuò)展,可以嘗試將參數(shù)改小,避免控制文件報(bào)錯(cuò)。 鏈接描述引言 近期我們?cè)贒BASK小程序新關(guān)聯(lián)了運(yùn)維之美、高端存儲(chǔ)知識(shí)、一森咖記、運(yùn)維咖啡吧等數(shù)據(jù)領(lǐng)域的公眾號(hào),歡迎大家閱讀分享。 問(wèn)答集萃 接下來(lái),...
閱讀 1359·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1908·2023-01-11 13:20
閱讀 4166·2023-01-11 13:20
閱讀 2759·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3673·2023-01-11 13:20