返回顶部
首页 > 资讯 > 数据库 >配置部署Oracle Goldengate Version 11.2.1.0.1
  • 461
分享到

配置部署Oracle Goldengate Version 11.2.1.0.1

2024-04-02 19:04:59 461人浏览 八月长安
摘要

配置部署oracle Goldengate Version 11.2.1.0.1 配置用户环境变量vi .bash_profile添加:export OGG_HOME=/data0/temp/og

配置部署oracle Goldengate Version 11.2.1.0.1 

配置用户环境变量

vi .bash_profile

添加:

export OGG_HOME=/data0/temp/ogg

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;

export LD_LIBRARY_PATH

查看数据是否开启归档

sql> arcHive log list; --Enabled


Configuring logging properties

Oracle GoldenGate relies on the redo logs to capture the data and metadata that it

needs to replicate source transactions. The Oracle redo logs on the source system must

be configured properly before you start Oracle GoldenGate processing. Because redo

volume is increased as the result of this required logging, you might want to wait until

just before you start Oracle GoldenGate processing to enable the logging.

This section addresses the following logging levels:

■ Enabling database-level supplemental logging

■ Enabling schema-level supplemental logging

■ Enabling table-level supplemental logging



查看数据库日志打开情况


SQL>  Select SUPPLEMENTAL_LOG_DATA_MIN,

  2   SUPPLEMENTAL_LOG_DATA_PK,

  3  SUPPLEMENTAL_LOG_DATA_UI,

  4   SUPPLEMENTAL_LOG_DATA_FK,

  5   SUPPLEMENTAL_LOG_DATA_ALL from v$database;


SUPPLEME SUP SUP SUP SUP

-------- --- --- --- ---

NO       NO  NO  NO  NO


打开附加日志并切换日志(保证Online redo log和Archive log一致)

alter database add supplemental log data ;

alter database add supplemental log data (primary key, unique,foreign key) columns;

alter system switch logfile;


再次检查日志打开情况:

SQL>  Select SUPPLEMENTAL_LOG_DATA_MIN,

  2   SUPPLEMENTAL_LOG_DATA_PK,

  3  SUPPLEMENTAL_LOG_DATA_UI,

  4   SUPPLEMENTAL_LOG_DATA_FK,

 SUPPLEMENTAL_LOG_DATA_ALL from v$database;

  5  

SUPPLEME SUP SUP SUP SUP

-------- --- --- --- ---

YES      YES YES YES NO

注:确保最小附加日志,pk,uk,fk附加日志打开。而all columns的附加日志关闭;

如果all columns的附加日志打开的话,则需要使用以下语句予以关闭:

alter database drop supplemental log data (ALL) columns;


如果出现问题,可以通过以下语句进行回退:

alter database drop supplemental log data ;

alter database drop supplemental log data (primary key, unique,foreign key) columns;

alter system switch logfile;


数据库开启强日志模式:

SQL>alter database force logging;

--注:这里source 库已是dataguard primary DB 所以强制日志模式已经打开:

查看:

SQL> select FORCE_LOGGING from v$database;


FOR

---

YES


SQL> 

关闭recyclebin 

--注在system一级,不加DEFERRED参数是不允许修改的,

SQL> alter system set recyclebin=off DEFERRED;


System altered.


SQL> show parameter recyclebin


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      on

SQL>

退出,重新登录查看

[oracle@dkdb_primary ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Wed May 13 18:50:42 2015


Copyright (c) 1982, 2013, Oracle.  All rights reserved.



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> show parameter recyclebin


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      OFF

SQL> 



安装goldengate在source端和target端上安装


[oracle@dkdb_primary ogg]$ ./ggsci


Oracle GoldenGate Command Interpreter for Oracle

Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO

linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14


Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.




GGSCI (dkdb_primary) 1> CREATE SUBDIRS


Creating subdirectories under current directory /data0/temp/ogg


Parameter files                /data0/temp/ogg/dirprm: already exists

Report files                   /data0/temp/ogg/dirrpt: created

Checkpoint files               /data0/temp/ogg/dirchk: created

Process status files           /data0/temp/ogg/dirpcs: created

SQL script files               /data0/temp/ogg/dirsql: created

Database definitions files     /data0/temp/ogg/dirdef: created

Extract data files             /data0/temp/ogg/dirdat: created

Temporary files                /data0/temp/ogg/dirtmp: created

Stdout files                   /data0/temp/ogg/dirout: created



GGSCI (dkdb_primary) 2> 


GGSCI (dkdb_primary) 3> info all 


Program     Status      Group       Lag at Chkpt  Time Since Chkpt


MANAGER     STOPPED         

                                  

安装oracle sequence 支持


这里的用户和创建DDL同步所需用户一样。(登陆源端和目标端执行创建用户):



SQL> create tablespace urogg  datafile '/opt/oracle/database/oradata/dkhlstd/dkhlstd/urogg01.dbf' size 100M autoextend on NOLOGGING;


Tablespace created.


SQL> create user urogg identified by test_oracle1_P default tablespace urogg  temporary tablespace temp;


User created.


赋权:

GRANT CONNECT, RESOURCE, DBA TO urogg;

GRANT CREATE TABLE,CREATE SEQUENCE TO urogg;--这里是用于用户安装DDL执行SQL脚本时用;


编辑GLOBALS 参数 

进入./ggsci在所有节点执行 

EDIT PARAMS ./GLOBALS  并添加

GGSCHEMA urogg                    --指定的进行DDL复制的数据库用户 

保存退出,并进入$OGG_HOME 登陆sqlplus  / as sysdba 执行脚本

SQL> @sequence.sql

Please enter the name of a schema for the GoldenGate database objects:

urogg

Setting schema name to UROGG

source 端:

SQL> GRANT EXECUTE on urogg.updateSequence TO urogg;


Grant succeeded.


SQL> ALTER TABLE sys.seq$ ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;


Table altered.


SQL> 


target端:

SQL> GRANT EXECUTE on urogg.replicateSequence TO urogg;


Grant succeeded.



编辑target 端 GLOBALS



GGSCI (dkdb_ogg) 10> edit params ./GLOBALS



--GGSCHEMA urogg

CHECKPOINTTABLE urogg.checktable --添加checkpointtable



添加checkpointtable

GGSCI (dkdb_ogg) 16> ADD CHECKPOINTTABLE DKOGG.CHECKTABLE


Successfully created checkpoint table urogg.checktable.





添加表级附加日志:


GGSCI (dkdb_primary) 1> dblogin userid urogg,passWord test_oracle1_P

Successfully logged into database.


GGSCI (dkdb_primary) 5> show user


Parameter settings:


SET SUBDIRS    ON

SET DEBUG      OFF


Current directory: /data0/temp/ogg


Using subdirectories for all process files


Editor:  vi


Reports (.rpt)                 /data0/temp/ogg/dirrpt

Parameters (.prm)              /data0/temp/ogg/dirprm

Stdout (.out)                  /data0/temp/ogg/dirout

Replicat Checkpoints (.cpr)    /data0/temp/ogg/dirchk

Extract Checkpoints (.cpe)     /data0/temp/ogg/dirchk

Process Status (.pcs)          /data0/temp/ogg/dirpcs

SQL Scripts (.sql)             /data0/temp/ogg/dirsql

Database Definitions (.def)    /data0/temp/ogg/dirdef


GGSCI (dkdb_primary) 3> add trandata TEST_D.*


这里会出现警告:

WARNING OGG-00869 、WARNING OGG-01387 

2015-05-11 20:09:36  WARNING OGG-00869  No unique key is defined for table 'T_APPDETAIL'.

 All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.



检查确认:

GGSCI (dkdb_primary) 4> info trandata TEST_D.*

Logging of supplemental redo log data is enabled for table TEST_D.api_SWITCH.


Columns supplementally logged for table TEST_D.API_SWITCH: API_NAME, ISVALID, API_COMMENT, API_ID.


注:add trandata TEST_D.* 后面没有;号

否则报错如下:


GGSCI (dkdb_primary) 2> add trandata test_desk.*;

ERROR: No viable tables matched specification.





创建 manager 进程:

GGSCI (dkdb_primary) 4> edit param mgr



PORT 7801

DYNAMICPORTLIST 7802-7820

PURGEOLDEXTRACTS /opt/ogg/dirdat/ *, USECHECKPOINTS, MINKEEPDAYS 7                          

--配置DDL参数区域

--trail file 保留7天

PURGEDDLHISTORY MINKEEPDAYS 7, MAXKEEPDAYS 10,FREQUENCYMINUTES 30

PURGEMARKERHISTORY MINKEEPDAYS 7, MAXKEEPDAYS 10

--配置一般日志信息区域

LAGREPORTHOURS 1

LAGINFOMINUTES 30

LAGCRITICALMINUTES 45


--##注 ./dirdat



--添加replicat进程

ADD REPLICAT repdr1, EXTTRAIL ./dirdat/sa

ADD REPLICAT repdr2, EXTTRAIL ./dirdat/sa





--启动replicat进程

GGSCI (dkdb_ogg) 65> start replicat  repdr, aftercsn 1442477


Sending START request to MANAGER ...

REPLICAT REPDR starting


--启动replicat进程方式

--指定SCN号启动

start replicat  repdr, aftercsn 1442477

--指定rba号启动

start replicat  repdr1, extseqno 5, RBA 2535303

start replicat  repdr2, extseqno 5, RBA 2535303

--指定具体时间启动

alter REPDR1,begin yyyy-mm-dd

start repdr1 




GGSCI (dkdb_ogg) 66> info all


Program     Status      Group       Lag at Chkpt  Time Since Chkpt


MANAGER     RUNNING                                           

REPLICAT    RUNNING     REPDR       00:00:00      00:00:01  





 create table WIDGET_BAK as select * from P_WIDGET where 1=2     空表


 DML 测试

 update table P_WIDGET set state=6

 commit;

在standby 端查看:

 

SQL> select state from test_desk.P_WIDGET;


     STATE

----------

         6

         6

         6 

 

查看source(primary)端 extract 进程

里面会出现一个警告:WARNING OGG-00869


查看target端 :

[root@dkdb_ogg ~]# su - oracle

[oracle@dkdb_ogg ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Wed May 13 16:59:48 2015


Copyright (c) 1982, 2013, Oracle.  All rights reserved.



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL>  select state from test_desk.P_WIDGET;


     STATE

----------

         6

         6

      ......

         6


34 rows selected.


到这里说明DML已经测试成功!


DDL 测试:


--##Source 端(primary_db):

创建表

SQL> CONN test_desk/pwd4test

Connected.

SQL> create table WIDGET_BAK as select * from P_WIDGET where 1=2;

--##Standby_db端查看

SQL>  CONN test_desk/pwd4test

Connected.


SQL> select count(*) from WIDGET_BAK;


  COUNT(*)

----------

         0

SQL> select count(*) from P_WIDGET;


  COUNT(*)

----------

        34

SQL> 

--##OGG_Target端 

view report repdr 进程日志


2015-05-13 14:04:18  INFO    OGG-00482  DDL found, operation [create table WIDGET_BAK as select * from P_WIDGET where 1=2  (size 80)].

2015-05-13 14:04:18  INFO    OGG-00489  DDL is of mapped scope, after mapping new operation [create table TEST_D."WIDGET_BAK" as select * from QN_DESKTOP_

WIDGET where 1=2  (size 92)].

2015-05-13 14:04:18  INFO    OGG-00487  DDL operation included [include mapped], optype [CREATE], objtype [TABLE], objowner [TEST_D], objname [WIDGET_BAK]

.

2015-05-13 14:04:18  INFO    OGG-01407  Setting current schema for DDL operation to [TEST_D].

2015-05-13 14:04:18  INFO    OGG-00484  Executing DDL operation.

2015-05-13 14:04:18  INFO    OGG-00483  DDL operation successful.

2015-05-13 14:04:18  INFO    OGG-01408  Restoring current schema for DDL operation to [urogg].


这里说明已经同步成功,进入库查看

SQL> show user

USER is "TEST_D"


SQL> select count(*) from WIDGET_BAK;


  COUNT(*)

----------

         0

SQL> select count(*) from P_WIDGET;


  COUNT(*)

----------

        34

SQL> 

查看replicat进程:

GGSCI (dkdb_ogg) 16> info replicat repdr detail


REPLICAT   REPDR     Last Started 2015-05-13 12:00   Status RUNNING

Checkpoint Lag       00:00:00 (updated 00:00:03 ago)

Log Read Checkpoint  File ./dirdat/sa000000

                     2015-05-13 14:04:12.382273  RBA 43978


  Extract Source                          Begin             End             


  ./dirdat/sa000000                       2015-05-13 09:12  2015-05-13 14:04

  ./dirdat/sa000000                       2015-05-13 09:12  First Record    

  ./dirdat/sa000000                       2015-05-13 09:12  2015-05-13 09:12

  ./dirdat/sa000000                       2015-05-13 09:12  First Record    

  ./dirdat/sa000000                       * Initialized *   2015-05-13 09:12

  ./dirdat/sa000000                       * Initialized *   First Record    



Current directory    /data0/temp/ogg


Report file          /data0/temp/ogg/dirrpt/REPDR.rpt

Parameter file       /data0/temp/ogg/dirprm/repdr.prm

Checkpoint file      /data0/temp/ogg/dirchk/REPDR.cpr

Checkpoint table     urogg.checktable

Process file         /data0/temp/ogg/dirpcs/REPDR.pcr

Stdout file          /data0/temp/ogg/dirout/REPDR.out

Error log            /data0/temp/ogg/ggserr.log



GGSCI (dkdb_ogg) 17> 




您可能感兴趣的文档:

--结束END--

本文标题: 配置部署Oracle Goldengate Version 11.2.1.0.1

本文链接: https://lsjlt.com/news/38848.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • 配置部署Oracle Goldengate Version 11.2.1.0.1
    配置部署Oracle Goldengate Version 11.2.1.0.1 配置用户环境变量vi .bash_profile添加:export OGG_HOME=/data0/temp/og...
    99+
    2024-04-02
  • Oracle Goldengate 安装配置
    首先要下载ogg的安装包。下载地址如下http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html 将安装包上传至...
    99+
    2024-04-02
  • Oracle GoldenGate Director配置手册
    一.         GoldenGate Director 介绍 GoldenGat...
    99+
    2024-04-02
  • Oracle GoldenGate配置参数分析
    这篇文章主要介绍“Oracle GoldenGate配置参数分析”,在日常操作中,相信很多人在Oracle GoldenGate配置参数分析问题上存在疑惑,小编查阅了各式资料,...
    99+
    2024-04-02
  • Oracle GoldenGate Studio 12.2.1.3安装-- RCU配置
    完成OGG Studio12.2.1.3安装以后,使用Repository Creation Utility (简称:RCU)创建一个Repository,存储有关项目,解决方案,mapping和部署等相关...
    99+
    2024-04-02
  • zabbix配置部署
    zabbix实验环境:服务端:192.168.36.131客户端:192.168.36.129iptables and selinux disabled一.服务端配置1.安装# rpm -ivh http:...
    99+
    2024-04-02
  • IDEA配置热部署
    1、IDEA2021版本进入Settings -> Build,Execution,Deployment -> Compiler,勾选Build project automatically 2...
    99+
    2024-01-21
    intellij-idea java ide
  • Oracle GoldenGate配置参数生产端分析
    这篇文章主要介绍“Oracle GoldenGate配置参数生产端分析”,在日常操作中,相信很多人在Oracle GoldenGate配置参数生产端分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操...
    99+
    2024-04-02
  • Mysql MHA部署-04MHA配置
    Mysql MHA部署-04MHA配置 一 Mysql MHA部署-01介绍 二 Mysql MHA部署-02主从复制 三 Mysql MHA部署-03MHA软件安装 四 M...
    99+
    2024-04-02
  • 配置Goldengate从Oracle到PostgreSQL的同步复制
    1、平台环境Oracle:rhel6.7+Oracle11.2.0.4  ip:192.168.56.2PostgreSQL:rhel7.2+Pg9.6.1  ip:192.168.56...
    99+
    2024-04-02
  • Oracle GoldenGate学习之--AIX系统安装配置
    Oracle GoldenGate学习之--AIX 系统安装配置系统环境操作系统:AIX5.3-09DB Soft:  Oracle 10gR2如下图所示: 系统环境实在AIX系统上构建...
    99+
    2024-04-02
  • Oracle GoldenGate学习之--基本概念和配置(2)
    Oracle GoldenGate学习之--基本概念和配置(2)一、Oracle OGG下载:http://www.oracle.com/technetwork/cn/middleware/goldenga...
    99+
    2024-04-02
  • Oracle GoldenGate学习之--基本概念和配置(3)
    Oracle GoldenGate学习之--基本概念和配置(3)系统架构:OGG基本配置(单向传输)1、数据库配置(Source DB)建立Tablespace: 11:58:56 SYS@&nb...
    99+
    2024-04-02
  • Gunicorn Django部署配置方法
    1. 简单部署 1. sudo pip3 install gunicorn 2. cd 到django项目中 sudo python3 manage.py migrate 3.启动服务:sudo python3 m...
    99+
    2022-06-04
    Gunicorn Django 部署 Django部署
  • Azure ​Exchange的部署和配置
    今天小编就为大家带来一篇有关Azure Exchange的部署和配置的文章。小编觉得挺实用的,为此分享给大家做个参考。一起跟随小编过来看看吧。Exchange混合部署Exchange混合部署功能通过将一组特...
    99+
    2024-04-02
  • cdn部署nginx如何配置
    使用nginx部署cdn的方法如下:upstream backend {server 1.1.1.1;keepalive 128;}proxy_temp_path /dev/shm;prox...
    99+
    2024-04-02
  • DNS BIND服务部署配置
    一、部署BIND服务 在CentOS 上安装BIND(Berkeley Internet Name Domain)域名服务器,可以按照以下步骤进行操作: 使用root用户登录到您的CentOS 7服务器上。 执行以下命令以安装BIND...
    99+
    2023-10-01
    服务器 linux centos Powered by 金山文档
  • Nacos Server 部署配置详解
    文章目录 1.什么是Nacos?2.Nacos Server 单机部署配置2.1. 相关文件2.2. 配置流程2.3. 搭建Nacos-client 服务 3.Nacos Server 集...
    99+
    2023-08-31
    微服务 分布式 mysql spring cloud
  • springboot热部署如何配置
    要在Spring Boot中实现热部署,可以按照以下步骤进行配置: 添加spring-boot-devtools依赖:在pom....
    99+
    2023-10-26
    springboot
  • DB2安装部署以及应用部署配置操作
    前言:年底了,公司需要部署一套DB2环境+应用系统来对客户进行相关的功能模块演示操作,之前对DB2接触不多,利用这次机会,开启对DB2的探索学习之路。DB2 数据库部署硬件环境信息:机器IP:10.162....
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作