<< Oracle高可用>>部分书面作业 - 第十课 Oracle Golden gate 概念和机制

1.配置好OGG,贴出配置的整个过程。


前提:
安装ogg的用户需要有读取db在线日志和归档日志的权限,需要属于拥有db用户的同一个组。
需要把ogg的目录和$ORACLE_HOME/lib/加入共享库环境变量:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib/:$ORA_OGG_HOME

步骤:
Installing the Oracle GoldenGate files
1. Extract the Oracle GoldenGate mediapack.zip file to the system and directory where you want Oracle GoldenGate to be installed.
2. Run the command shell.
3. Change directories to the new Oracle GoldenGate directory.
4. From the Oracle GoldenGate directory, run the GGSCI program.
[oracle@ogg1 ogg]$ ggsci
5.In GGSCI, issue the following command to create the Oracle GoldenGate working directories.
GGSCI (ogg1) 2> CREATE SUBDIRS


Creating subdirectories under current directory /opt/ogg

Parameter files                /opt/ogg/dirprm: already exists
Report files                   /opt/ogg/dirrpt: created
Checkpoint files               /opt/ogg/dirchk: created
Process status files           /opt/ogg/dirpcs: created
SQL script files               /opt/ogg/dirsql: created
Database definitions files     /opt/ogg/dirdef: created
Extract data files             /opt/ogg/dirdat: created
Temporary files                /opt/ogg/dirtmp: created
Stdout files                   /opt/ogg/dirout: created


GGSCI (ogg1) 3>
6.Issue the following command to exit GGSCI.
EXIT

Installing support for Oracle sequences
Follow these instructions on the source and target systems.


On the source and target Oracle systems, connect to SQL*Plus as SYSDBA.
SQL> CREATE USER DDLuser IDENTIFIED BY password;
User created.
SQL> GRANT CONNECT,RESOURCE,DBA TO DDLuser;
Grant succeeded.
SQL>


From the Oracle GoldenGate installation directory, run GGSCI.
GGSCI (ogg1) 1> EDIT PARAMS ./GLOBALS
In the file, enter the GGSCHEMA parameter and specify the schema of the DDL user that
you created earlier in this procedure.
GGSCHEMA DDLuser
Save and close the file.

On both systems, run the sequence.sql script from the root of the Oracle GoldenGate
installation directory. This script creates some procedures for use by Oracle
GoldenGate processes. (Do not run them yourself.) You are prompted for the user
information that you created in the first step.
SQL> @sequence.sql
Please enter the name of a schema for the GoldenGate database objects:
DDLuser

Setting schema name to DDLUSER

UPDATE_SEQUENCE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


GETSEQFLUSH

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


SEQTRACE

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


REPLICATE_SEQUENCE STATUS:

Line/pos
----------------------------------------
Error
-----------------------------------------------------------------
No errors
No errors


STATUS OF SEQUENCE SUPPORT
--------------------------------------------------------------
SUCCESSFUL installation of Oracle Sequence Replication support
SQL>



On the source system, grant EXECUTE privilege on the updateSequence procedure to a
database user that can be used to issue the DBLOGIN command.Remember or record this
user. You use DBLOGIN to log into the database prior to issuing the FLUSH SEQUENCE
command, which calls the procedure.
SQL> create user DBLOGINuser identified by password;
User created.
SQL> grant dba to DBLOGINuser;
Grant succeeded.
SQL> GRANT EXECUTE on DDLuser.updateSequence TO DBLOGINuser;
Grant succeeded.
SQL>


On the target system, grant EXECUTE privilege on the replicateSequence procedure to the
Replicat database user.
SQL> create user Replicatuser identified by password;
User created.
SQL> grant dba to Replicatuser;
Grant succeeded.
SQL> GRANT EXECUTE on DDLuser.replicateSequence TO Replicatuser;
Grant succeeded.
SQL>


参考文档:
Oracle GoldenGate Documentation - Oracle Installation and Setup Guide
http://docs.oracle.com/cd/E22355_01/index.htm


--EOF--


2.画一个OGG数据复制的数据流图。

Source DB -> Manager -> Extract -> Data Pump(Optional) -> NETWORK -> Manager -> Collector(Optional) -> Replicat - > Target DB 


--EOF--


3.OGG有哪些进程,都有什么作用?

manger

Manager进程是GoldenGate的控制进程,运行在源端和目标端上。它主要作用有以下几
个方面:启动、监控、重启Goldengate的其他进程,报告错误及事件,分配数据存储空
间,发布阀值报告等。在目标端和源端有且只有一个manager进程.

extract

Extract运行在数据库源端,负责从源端数据表或者日志中捕获数据。Extract的作用可以
按照阶段来划分为:
– 初始时间装载阶段:在初始数据装载阶段,Extract进程直接从源端的数据表中抽取数据
– 同步变化捕获阶段:初始数据同步完成以后,Extract进程负责捕获源端数据的变化(DML和DDL)

replicat

Replicat进程,通常我们也把它叫做应用进程。运行在目标端,是数据传递的最后一站
,负责读取目标端trail文件中的内容,并将其解析为DML或 DDL语句,然后应用到目标
数据库中。

Collector

与 Pump进程对应 的叫Server Collector进程,这个进程不需要引起我的关注,因为在实
际操作过程中,无需我们对其进行任何配置,所以对我们来说它是透明的。它运行在
目标端,其 任务就是把Extract/Pump投递过来的数据重新组装成远程ttrail文件。

data pump

pump进程运行在数据库源端,其作用是将源端产生的本地trail文件,把trail以数据块的
形式通过TCP/IP 协议发送到目标端,这通常也是推荐的方式。pump进程本质是extract
进程的一种特殊形式,如果不使用trail文件,那么extract进程在抽取完数据以后,直接
投递到目标端,生成远程trail文件。


--EOF--


4.OGG数据复制的机制是什么,画出示意图。

OGG采用源端捕获日志、目标端应用日志的机制实现数据复制。

示意图:源端捕获已提交日志 -> 跟踪提交队列 -> 数据泵 -> 网络路由 -> 目标端接收 -> 重做源端日志。

--EOF--

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值