點擊上方“IT那活兒”公眾號,關注后了解更多內容,不管IT什么活兒,干就完了!!!
在數據庫中我們常用到主副庫來確保容災的可能,OGG是我們用來進行主副庫同步的產品,如下是OGG搭建的詳細流程。
OGG安裝及源端配置
alter database add supplemental log data ;
alter system switch logfile;
alter database force logging;
select log_mode from v$database;
安裝OGG
2.3 創建子目錄
./ggsci
create subdirs
cd /OGG/ogg_software/fbo_ggs_AIX_ppc_shiphome/Disk1/response
主要修改如下幾個地方:
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
確認端口沒有被占用:
./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 配置環境變量
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安裝目錄下運行GGS命令行控制界面:
cd /oracle/goldengate
./ggsci
在GGS命令行界面下創建子目錄:
create subdirs
修改MGR進程參數并啟動:
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數據庫需要加[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 *.*
增加傳輸進程組:
GGSCI>add extract dptsap1, exttrailsource ./dirdat/ap
建立傳輸進程和目標端隊列文件關聯關系:
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
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/129218.html
OGG Integrated Native DDL簡單測試 img{ display:block; margin:0 auto !important; width:100%; } body{ width:75%;...
摘要:編碼結束后,調用函數,來銷毀和編碼器。調用函數對參數中的格式音頻數據幀進行解碼,參數中存放解碼后的音頻數據幀。調用函數來銷毀和解碼器說重點當做即時通信產品,像微信這種的手機端,它們接受到很有可能就是協議壓縮后的音頻文件。 showImg(https://segmentfault.com/img/bVbtzkh?w=1024&h=682); 這么牛逼的輪子,肯定要美圖鎮樓 Speex是一...
摘要:問題九庫控制文件擴展報錯庫的擴展報錯,用的是裸設備,和還是原來大小,主庫的沒有報錯,并且大小沒有變,求解釋。專家解答從報錯可以看出,控制文件從個塊擴展到個塊時報錯,而裸設備最大只支持個塊,無法擴展,可以嘗試將參數改小,避免控制文件報錯。 鏈接描述引言 近期我們在DBASK小程序新關聯了運維之美、高端存儲知識、一森咖記、運維咖啡吧等數據領域的公眾號,歡迎大家閱讀分享。 問答集萃 接下來,...
閱讀 1347·2023-01-11 13:20
閱讀 1685·2023-01-11 13:20
閱讀 1133·2023-01-11 13:20
閱讀 1860·2023-01-11 13:20
閱讀 4101·2023-01-11 13:20
閱讀 2705·2023-01-11 13:20
閱讀 1386·2023-01-11 13:20
閱讀 3599·2023-01-11 13:20