Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298618
  • 博文数量: 127
  • 博客积分: 2286
  • 博客等级: 大尉
  • 技术积分: 1943
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-10 10:37
文章分类

全部博文(127)

文章存档

2018年(1)

2015年(2)

2014年(1)

2013年(30)

2012年(88)

2011年(5)

分类: Oracle

2012-07-05 16:00:28

1 安装GG
mkdir GG;cd GG
tar -xf /stage/fbo_ggs_Linux_x64_ora11g_64bit.tar

2 配置
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

cd GG
ggsci
GGSCI> CREATE SUBDIRS
GGSCI> edit param mgr
PORT 7801
DYNAMICPORTLIST 7802-7820
GGSCI> start mgr
GGSCI> info mgr
GGSCI> exit
$cat $HOME/GG/dirprm/mgr.prm
port 7801
DYNAMICPORTLIST 7802-7820
$ ps -ef |grep mgr
可以看到mgr进程
$netstat -ntl |grep 7801
tcp 0 0 :::7801 :::* LISTEN


3. 建立用户设置权限
Oracle 11.1 and 11.2.0.1:
exec dbms_streams_auth.grant_admin_privilege('')
grant become user to ;

Oracle 11.2.0.2 and later:
exec dbms_goldengate_auth.grant_admin_privilege('')


SQL> create user ggadmin identified by oracle;
SQL> create dba to ggadmin;
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');


4. 在redo中设置附加日志
SQL> alter database add supplemental log data;
SQL> Alter database force logging;
SQL> select supplemental_log_data_min,force_logging from v$database;
SUPPLEME FOR
-------- ---
YES YES
GGSCI> dblogin userid ggadmin,password oracle
GGSCI> info trandata hr.*
GGSCI> add trandata hr.*

5. 配置提取进程
GGSCI> add extract extr,tranlog,begin now
GGSCI> edit param extr
GGSCI> view params extr
EXTRACT extr
USERID ggadmin, PASSWORD oracle
EXTTRAIL ./dirdat/hr
dynamicresolution
gettruncates
TABLE hr.*;
GGSCI> ADD EXTTRAIL ./dirdat/hr, EXTRACT extr
GGSCI> start extr
GGSCI> view report extr查看log信息

配置文件一定要以分号结束

6. 配置datapump进程
GGSCI> edit param pump1
GGSCI> view param pump1
extract pump1
USERID ggadmin, PASSWORD oracle
RMTHOST ndb3.test, MGRPORT 7801
RMTTRAIL ./dirdat/hr
PASSTHRU
gettruncates
TABLE HR.*;
配置文件一定要以分号结束
GGSCI> ADD EXTRACT pump1, EXTTRAILSOURCE ./dirdat/hr
GGSCI> ADD RMTTRAIL ./dirdat/hr, EXTRACT pump1
前者指定源,后者指定目标,就通过网络把两个GG的queue连接起了

GGSCI> start pump1
GGSCI> info all
GGSCI> info pump1
GGSCI> view report pump1

7 配置目标数据库的复制进程
GGSCI> edit param ./globals
GGSCI> view param ./globals
checkpointtable ggadmin.ggschkpt
GGSCI> add checkpointtable

GGSCI> edit param repl
GGSCI> view param repl

REPLICAT repl
ASSUMETARGETDEFS
USERID ggadmin, PASSWORD oracle
reperror default,discard
discardfile ./dirdat/hr/hr2_discard.log,append,megabytes 1000
gettruncates
MAP HR.*, TARGET HR2.*;

GGSCI> add replicat repl exttrail ./dirdat/hr,begin now,nodbcheckpoint
GGSCI> start repl
GGSCI> info all
GGSCI> info repl
REPLICAT REPL Last Started 2012-07-05 22:55 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:03 ago)
Log Read Checkpoint File ./dirdat/hr000000
2012-07-05 22:53:43.000000 RBA 0

GGSCI> view report repl

8 有哪些进程
源端
mgr管理进程
extract抽取
extract连接源和目的
目的端
mgr管理进程
replicat复制进程
server管理进程


9 测试

10 监视
stats extr
stats pump1
stats repl
lag extr
lag repl
lag pump1
review report xxxx



阅读(4277) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~