点击上方“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
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/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小程序新关联了运维之美、高端存储知识、一森咖记、运维咖啡吧等数据领域的公众号,欢迎大家阅读分享。 问答集萃 接下来,...
阅读 1247·2023-01-11 13:20
阅读 1555·2023-01-11 13:20
阅读 1008·2023-01-11 13:20
阅读 1676·2023-01-11 13:20
阅读 3968·2023-01-11 13:20
阅读 2510·2023-01-11 13:20
阅读 1305·2023-01-11 13:20
阅读 3474·2023-01-11 13:20