AIX系统goldengate快速实施指南

AIX环境goldengate快速实施指南
安装goldengate
AIX5.3下安装goldengate需求,确保以下两个包的版本达到要求:
XL C/C++ Runtime v10.1 or later
libpthreads version 5.3.0.51 or later
1、设置oracle用户的LIBPATH环境变量
$vi .profile
LIBPATH=/goldengate:$ORACLE_HOME/lib
export LIBPATH
$. ~/.profile
2、创建goldengate目录
mkdir /goldengate
3、在goldengate目录里解压goldengate安装包
tar xvf ggs.tar
chown -R oracle:dba /goldengate
4、队列空间规划:
队列文件系统大小=〔日均归档日志量×1/3×允许数据复制中断恢复天数〕
5、创建goldengate的相关目录
$cd /goldengate
$./ggsci
ggsci>create subdirs
调整源端数据库
1、开启supplemental log
sql> alter database add supplemental log data;
sql> alter system switch logfile;
2、在数据库中增加goldengate所需要的用户和表空间,并授予DBA权限
sql> create tablespace sgcc datafile 'SGCC_SJRZ' size 100M reuse; SQL> create user SGCC_SJRZ identified by SGCC_SJRZ Default tablespace sgcc;
SQL> grant dba to SGCC_SJRZ;
3、为schema增加tranlog
ggsci>dblogin userid SGCC_SJRZ, password SGCC_SJRZ
ggsci>add trandata <schema>.*
配置源端mgr进程
ggsci> edit param mgr
port 7839
DYNAMICPORTLIST 7840-7914
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 7 PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 3 LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
ggsci> start mgr
配置源端extract进程
1、增加相关的extract进程
ggsci> add extract extoa,tranlog,begin now
ggsci> add extract extob,tranlog,begin now
ggsci> add extract extoc,tranlog,begin now
ggsci> add extract extod,tranlog,begin now
ggsci> add extract extoe,tranlog,begin now
ggsci> add extract extof,tranlog,begin now
ggsci> add extract extog,tranlog,begin now
ggsci> add extract extoh,tranlog,begin now
2、给extract进程关联相应的队列文件
ggsci> add exttrail ./dirdat/oa, extract extoa, megabytes 200 ggsci> add exttrail ./dirdat/ob, extract extob, megabytes 200 ggsci> add exttrail ./dirdat/oc, extract extoc, megabytes 200 ggsci> add exttrail ./dirdat/od, extract extod, megabytes 200 ggsci> add exttrail ./dirdat/oe, extract extoe, megabytes 200 ggsci> add exttrail ./dirdat/of, extract extof, megabytes 200 ggsci> add exttrail ./dirdat/og, extract extog, megabytes 200 ggsci> add exttrail ./dirdat/oh, extract extoh, megabytes 200
3、编辑extract配置参数
eoaggsci> edit param extoa
EXTRACT extoa
userid SGCC_SJRZ,password SGCC_SJRZ
GETTRUNCATES
REPORTCOUNT EVERY 1 MINUTES, RATE
DBOPTIONS ALLOWUNUSEDCOLUMN
DISCARDFILE ./dirrpt/extoa.dsc,APPEND,MEGABYTES 1000 WARNLONGTRANS 2h,CHECKINTERVAL 3m
EXTTRAIL ./dirdat/oa
TRANLOGOPTIONS  CONVERTUCS2CLOBS
DYNAMICRESOLUTION
table <schema>.<table>;
table <schema>.<table>;
table <schema>.<table>;
......
4、启动extract抽取进程
ggsci>start ext*
配置源端datapump进程
1、增加datapump进程
ggsci>add extract dpeoa,exttrailsource ./dirdat/oa
ggsci>add extract dpeob,exttrailsource ./dirdat/ob
ggsci>add extract dpeoc,exttrailsource ./dirdat/oc
ggsci>add extract dpeod,exttrailsource ./dirdat/od
ggsci>add extract dpeoe,exttrailsource ./dirdat/oe
ggsci>add extract dpeof,exttrailsource ./dirdat/of
ggsci>add extract dpeog,exttrailsource ./dirdat/og
ggsci>add extract dpeoh,exttrailsource ./dirdat/oh
2、给datapump进程分配相应的队列文件
ggsci>add rmttrail ./dirdat/oa,extract dpeoa,megabytes 200 ggsci>add rmttrail ./dirdat/ob,extract dpeob,megabytes 200 ggsci>add rmttrail ./dirdat/oc,extract dpeoc,megabytes 200 ggsci>add rmttrail ./dirdat/od,extract dpeod,megabytes 200 ggsci>add rmttrail ./dirdat/oe,extract dpeoe,megabytes 200 ggsci>add rmttrail ./dirdat/of,extract dpeof,megabytes 200 ggsci>add rmttrail ./dirdat/og,extract dpeog,megabytes 200 ggsci>add rmttrail ./dirdat/oh,extract dpeoh,megabytes 200
3、编辑datapump配置文件
ggsci>edit param dpeoa
EXTRACT dpeoa
RMTHOST 10.108.128.14, MGRPORT 7839, compress
PASSTHRU
RMTTRAIL ./dirdat/oa
DYNAMICRESOLUTION
table <schema>.<table>;
table <schema>.<table>;
table <schema>.<table>;
......
调整目标端数据库
1、在数据库中增加goldengate所需要的用户和表空间,并授予DBA权限
sql> create tablespace sgcc datafile 'SGCC_SJRZ' size 100M reuse; SQL> create user SGCC_SJRZ identified by SGCC_SJRZ Default tablespace sgcc;
SQL> grant dba to SGCC_SJRZ;
配置目标端mgr进程
1、配置GLOBAL
GGSCI>EDIT PARAMS ./GLOBALS
CHECKPOINTTABLE schkpt
2、增加checkpoint表
ggsci>dblogin userid SGCC_SJRZ, password SGCC_SJRZ
ggsci>add checkpointtable schkpt
3、修改mgr配置文件
ggsci> edit param mgr
port 7839
DYNAMICPORTLIST 7840-7914
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 7 PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 3 LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
4、启动mgr进程
ggsci> start mgr
源端启动datapump并RMAN备份、传输
1、启动数据泵进程
ggsci>start dpe*
2、记录开始备份的时间点,并执行rman脚本
$cat rman.sh
#!/usr/bin/sh
rman target / <<EOF
crosscheck archivelog all;
run{
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
allocate channel c1 device type disk maxpiecesize 4G;
allocate channel c2 device type disk maxpiecesize 4G;
allocate channel c3 device type disk maxpiecesize 4G;
allocate channel c4 device type disk maxpiecesize 4G;
allocate channel c5 device type disk maxpiecesize 4G;
allocate channel c6 device type disk maxpiecesize 4G;
allocate channel c7 device type disk maxpiecesize 4G;
allocate channel c8 device type disk maxpiecesize 4G;
backup database format='/goldengate/rman/db%d_%s_%p';
sql'alter system archive log current';
backup current controlfile format='/goldengate/rman/con%d_%s_%p';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
$nohup ./rman.sh &
3、保险起见,手动备份一份控制文件
SQL> ALTER DATABASE BACKUP CONTROLFILE TO '/goldengate/rman/control.bak';
4、从spfile创建一份pfile
SQL> create pfile '/goldengate/rman/pfile.bak' from spfile;
5、收集目标端数据库恢复需要的密码文件
PWD<ORACLE_SID>.ora

本文发布于:2024-09-21 15:37:42,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/2/358220.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:进程   备份   数据库
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议