【OGG】OGG简单配置双向复制(三)

【OGG】OGG简单配置双向复制(三)

一.1  BLOG文档结构图

 

 

 

一.2  前言部分

 

一.2.1  导读

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① OGG的双向实时复制功能

 

 

注意:本篇BLOG中代码部分需要特别关注的地方我都用黄色背景和红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方。

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

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

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

 

 

 

 

本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。

一.2.2  实验环境介绍

 


项目


source db


target  db


db 类型


单实例


单实例


db version


11.2.0.3


11.2.0.3


db 存储


FS type


FS type


ORACLE_SID


ogg1


ogg2


db_name


ogg1


ogg2


主机IP地址:


192.168.59.129


192.168.59.130


OS版本及kernel版本


RHEL6.5 64位,2.6.32-504.16.2.el6.x86_64


RHEL6.5 64位,2.6.32-504.16.2.el6.x86_64


OGG版本


11.2.1.0.1 64位


11.2.1.0.1 64位


OS hostname


orcltest


rhel6_lhr

 

 

 

一.2.3  相关参考文章链接

 

【OGG】OGG的下载和安装篇:http://blog.itpub.net/26736162/viewspace-1693241/

【OGG】OGG的单向DML复制配置(一):http://blog.itpub.net/26736162/viewspace-1696020/

【OGG】OGG的单向复制配置-支持DDL(二):http://blog.itpub.net/26736162/viewspace-1696031/

 

 

一.2.4  本文简介

 

 

本文基于OGG的双向复制功能,主要参考网址为:http://ylw6006.blog.51cto.com/all/470441/16 ,非常感谢斩月大师。

 

在完成ogg的单向复制配置后,自然会想着向前推进一层,实现双向复制;在实际应用中,双向复制面临着许多问题,主要有如下几点:

1. 如果两个库同时更新同一条记录 如何处理?

2. 如果网络出现失败如何处理?

3. 如果数据不同步后如何修复?

 

 

本文介绍如何在前文的基础上简单实现ogg的双向复制!双向复制一般用于双业务中心环境下,目前笔者的生产环境中未使用到ogg,ogg系列的文章只是从技术上提前做一个准备,因而许多问题的细节未能理清,后续将继续学习研究!在开始之前,请先配置好db1-db2的单向复制(include ddl replicat)!

 

 

 

 

 

 

一.3  实验部分

 

一.3.1  实验目标

 

实现OGG1和OGG2的双向复制功能。

 

一.3.2  配置OGG1,添加checkpoint表

注意:本文OGG1和OGG2互为source和target,因而直接采用OGG1和OGG2来标识两台数据库服务器

 

[oracle@orcltest gg11]$ 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 (orcltest) 1> view params ./GLOBALS 

 

GGSCHEMA ggusr

 

 

GGSCI (orcltest) 2> edit params ./GLOBALS 

GGSCHEMA ggusr

checkpointtable ggusr.rep_demo_ckpt

~

~

~

~

。。。。。。。。。。。。。。。。

~

~

~

~

~

"./GLOBALS" 2L, 51C written

 

 

GGSCI (orcltest) 3> view params ./GLOBALS 

 

GGSCHEMA ggusr

checkpointtable ggusr.rep_demo_ckpt

 

 

GGSCI (orcltest) 4>

 

GGSCI (orcltest) 4> dblogin userid ggusr@ogg1,password lhr

Successfully logged into database.

 

GGSCI (orcltest) 5> add checkpointtable  ggusr.rep_demo_ckpt

 

Successfully created checkpoint table ggusr.rep_demo_ckpt.

 

GGSCI (orcltest) 6> add checkpointtable  ggusr.rep_demo_ckpt

ERROR: OCI Error ORA-00955: name is already used by an existing object (status = 955). Creating checkpoint table ggusr.rep_demo_ckpt, SQL .

 

GGSCI (orcltest) 7>

 

 

一.3.3  配置OGG2,运行相关的脚本,支持DDL的复制

[oracle@rhel6_lhr gg11]$ 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 (rhel6_lhr) 1>  view params ./GLOBALS 

 

checkpointtable ggusr.rep_demo_ckpt

 

 

GGSCI (rhel6_lhr) 2> edit  params ./GLOBALS

 

 

 

GGSCI (rhel6_lhr) 3>  view params ./GLOBALS 

 

GGSCHEMA ggusr

checkpointtable ggusr.rep_demo_ckpt

 

 

GGSCI (rhel6_lhr) 4>

 

 

 

 

 

[oracle@orcltest ~]$ cd $OGG_HOME

[oracle@orcltest gg11]$ sqlplus sys/lhr@ogg2 as  sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 10 17:10:45 2015

 

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

 

 

Connected to:

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

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

 

SQL> select name,SUPPLEMENTAL_LOG_DATA_MIN, FORCE_LOGGING from v$database;

 

NAME      SUPPLEME FOR

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

OGG2     NO       NO

 

SQL> alter database add supplemental log data ;

 

Database altered.

 

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     7

Next log sequence to archive   9

Current log sequence           9

SQL>

 

SQL> grant execute on utl_file to ggusr;

 

Grant succeeded.

 

SQL> @marker_setup.sql

 

Marker setup script

 

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.

NOTE: The schema must be created prior to running this script.

NOTE: Stop all DDL replication before starting this installation.

 

Enter Oracle GoldenGate schema name:ggusr

 

 

Marker setup table script complete, running verification script...

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

Setting schema name to GGUSR

 

MARKER TABLE

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

OK

 

MARKER SEQUENCE

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

OK

 

Script complete.

SQL> @ddl_setup.sql

 

Oracle GoldenGate DDL Replication setup script

 

Verifying that current user has privileges to install DDL Replication...

 

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.

NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.

NOTE: The schema must be created prior to running this script.

NOTE: Stop all DDL replication before starting this installation.

 

Enter Oracle GoldenGate schema name:ggusr

 

Working, please wait ...

Spooling to file ddl_setup_spool.txt

 

Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

 

Check complete.

 

 

 

 

 

 

 

Using GGUSR as a Oracle GoldenGate schema name.

 

Working, please wait ...

 

DDL replication setup script complete, running verification script...

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

Setting schema name to GGUSR

 

CLEAR_TRACE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

CREATE_TRACE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

TRACE_PUT_LINE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

INITIAL_SETUP STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDLVERSIONSPECIFIC PACKAGE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDLREPLICATION PACKAGE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDLREPLICATION PACKAGE BODY STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDL IGNORE TABLE

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

OK

 

DDL IGNORE LOG TABLE

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

OK

 

DDLAUX  PACKAGE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDLAUX PACKAGE BODY STATUS:

 

Line/pos             Error

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

No errors            No errors

 

SYS.DDLCTXINFO  PACKAGE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

SYS.DDLCTXINFO  PACKAGE BODY STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDL HISTORY TABLE

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

OK

 

DDL HISTORY TABLE(1)

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

OK

 

DDL DUMP TABLES

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

OK

 

DDL DUMP COLUMNS

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

OK

 

DDL DUMP LOG GROUPS

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

OK

 

DDL DUMP PARTITIONS

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

OK

 

DDL DUMP PRIMARY KEYS

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

OK

 

DDL SEQUENCE

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

OK

 

GGS_TEMP_COLS

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

OK

 

GGS_TEMP_UK

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

OK

 

DDL TRIGGER CODE STATUS:

 

Line/pos             Error

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

No errors            No errors

 

DDL TRIGGER INSTALL STATUS

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

OK

 

DDL TRIGGER RUNNING STATUS

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

ENABLED

 

STAYMETADATA IN TRIGGER

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

OFF

 

DDL TRIGGER SQL TRACING

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

0

 

DDL TRIGGER TRACE LEVEL

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

0

 

LOCATION OF DDL TRACE FILE

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

/u01/app/oracle/diag/rdbms/ogg2/ogg2/trace/ggs_ddl_trace.log

 

Analyzing installation status...

 

 

STATUS OF DDL REPLICATION

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

SUCCESSFUL installation of DDL Replication software components

 

Script complete.

SQL> @role_setup.sql

 

GGS Role setup script

 

This script will drop and recreate the role GGS_GGSUSER_ROLE

To use a different role name, quit this script and then edit the params.sql script to change the gg_role parameter to the preferred name. (Do not run the script.)

 

You will be prompted for the name of a schema for the GoldenGate database objects.

NOTE: The schema must be created prior to running this script.

NOTE: Stop all DDL replication before starting this installation.

 

Enter GoldenGate schema name:ggusr

Wrote file role_setup_set.txt

 

PL/SQL procedure successfully completed.

 

 

Role setup script complete

 

Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:

 

GRANT GGS_GGSUSER_ROLE TO

 

where is the user assigned to the GoldenGate processes.

SQL>

SQL> GRANT GGS_GGSUSER_ROLE TO ggusr;

 

Grant succeeded.

 

SQL> @ddl_enable.sql 

 

Trigger altered.

 

SQL> @?/rdbms/admin/dbmspool.sql

 

Package created.

 

 

Grant succeeded.

 

 

SQL> @ddl_pin.sql ggusr

 

PL/SQL procedure successfully completed.

 

 

PL/SQL procedure successfully completed.

 

 

PL/SQL procedure successfully completed.

 

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

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

[oracle@orcltest gg11]$

 

一.3.4  OGG2上配置extract和pump进程

[oracle@rhel6_lhr gg11]$ 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 (rhel6_lhr) 1> dblogin userid ggusr@ogg2,password lhr

Successfully logged into database.

 

GGSCI (rhel6_lhr) 2> add trandata hr.* 

 

Logging of supplemental redo data enabled for table HR.COUNTRIES.

 

Logging of supplemental redo data enabled for table HR.DEPARTMENTS.

 

Logging of supplemental redo data enabled for table HR.EMPLOYEES.

 

Logging of supplemental redo data enabled for table HR.JOBS.

 

Logging of supplemental redo data enabled for table HR.JOB_HISTORY.

 

Logging of supplemental redo data enabled for table HR.LOCATIONS.

 

Logging of supplemental redo data enabled for table HR.REGIONS.

 

Logging of supplemental redo data enabled for table HR.T1.

 

Logging of supplemental redo data enabled for table HR.T2.

 

2015-06-10 03:11:40  WARNING OGG-00869  No unique key is defined for table 'T3'. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.

 

Logging of supplemental redo data enabled for table HR.T3.

 

GGSCI (rhel6_lhr) 3> edit params eora_hr2

 

 

 

GGSCI (rhel6_lhr) 4> view params eora_hr2

 

extract eora_hr2 

setenv (ORACLE_SID=ogg2)

setenv (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

ddl include all

userid ggusr,password lhr

tranlogoptions excludeuser ggusr   //避免出现死循环复制,db1上的extract进程也需要进行此项设置

exttrail ./dirdat/ab

table hr.*;

 

GGSCI (rhel6_lhr) 4> add extract eora_hr2,tranlog,begin now  

EXTRACT added. 

 

 

GGSCI (rhel6_lhr) 5> add exttrail ./dirdat/ab,extract eora_hr2,megabytes 100 

EXTTRAIL added.

 

 

GGSCI (rhel6_lhr) 6> start extract eora_hr2

 

Sending START request to MANAGER ...

EXTRACT EORA_HR2 starting

 

 

GGSCI (rhel6_lhr) 7> edit params pora_hr2

 

 

 

GGSCI (rhel6_lhr) 8> view params pora_hr2

 

extract pora_hr2 

setenv (ORACLE_SID=ogg2)

setenv (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)  

passthru 

rmthost 192.168.59.129,mgrport 7809 

rmttrail ./dirdat/pb 

table hr.*;

 

 

GGSCI (rhel6_lhr) 9> add extract pora_hr2,exttrailsource ./dirdat/ab 

EXTRACT added.

 

 

GGSCI (rhel6_lhr) 10> add rmttrail ./dirdat/pb extract pora_hr2,megabytes 100 

RMTTRAIL added.

 

 

GGSCI (rhel6_lhr) 11> start extract pora_hr2

 

Sending START request to MANAGER ...

EXTRACT PORA_HR2 starting

 

 

GGSCI (rhel6_lhr) 12> info all 

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     RUNNING     EORA_HR2    00:00:00      00:04:16   

EXTRACT     RUNNING     PORA_HR2    00:00:00      00:00:00   

REPLICAT    RUNNING     RORA_HR     00:00:00      00:00:01   

 

 

GGSCI (rhel6_lhr) 13>

 

 

 

 

OGG1上设置抽取进程参数,添加tranlogoptions excludeuser ggusr:

GGSCI (orcltest) 15> view params EORA_HR

 

extract eora_hr 

setenv (ORACLE_SID=ogg1)

setenv (ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1)

setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK) 

ddl include all

tranlogoptions excludeuser ggusr

userid ggusr,password lhr

exttrail ./dirdat/hr 

table hr.*;

 

 

GGSCI (orcltest) 16>

 

 

 

一.3.5  OGG1上配置replicat进程

 

[oracle@orcltest gg11]$ 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 (orcltest) 1> info all

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     RUNNING     EORA_HR     00:00:00      00:00:10   

EXTRACT     RUNNING     PORA_HR     00:00:00      00:00:05   

 

 

 

GGSCI (orcltest) 2> view params rora_hr2

ERROR: PARAMS file RORA_HR2 does not exist.

 

 

GGSCI (orcltest) 3> edit params rora_hr2

replicat rora_hr2

setenv (ORACLE_SID=ogg1)

setenv (ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1)

setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

ddl include all

ddlerror default ignore retryop maxretries 3 retrydelay 5

userid ggusr,password lhr

handlecollisions

assumetargetdefs

discardfile ./dirrpt/rora_hr2.dsc,purge

map hr.* ,target hr.*;

~

~

~

~

。。。。。。。。。。。。。。。

~

~

~

~

~

"dirprm/rora_hr2.prm" [New] 11L, 345C written

 

 

GGSCI (orcltest) 4> view params rora_hr2

 

replicat rora_hr2

setenv (ORACLE_SID=ogg1)

setenv (ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1)

setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

ddl include all

ddlerror default ignore retryop maxretries 3 retrydelay 5

DDLOPTIONS REPORT

userid ggusr,password lhr

handlecollisions

assumetargetdefs

discardfile ./dirrpt/rora_hr2.dsc,purge

map hr.* ,target hr.*;

 

 

GGSCI (orcltest) 5> add replicat rora_hr2,exttrail ./dirdat/pb 

REPLICAT added.

 

 

GGSCI (orcltest) 6> start replicat rora_hr2

 

Sending START request to MANAGER ...

REPLICAT RORA_HR2 starting

 

 

GGSCI (orcltest) 7> info all 

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     RUNNING     EORA_HR     00:00:00      00:00:00   

EXTRACT     RUNNING     PORA_HR     00:00:00      00:00:09   

REPLICAT    RUNNING     RORA_HR2    00:00:00      00:00:04   

 

 

GGSCI (orcltest) 8>

 

一.3.6  测试

一.3.6.1  ddl测试

[oracle@orcltest gg11]$ sqlplus hr/hr@ogg1

 

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 10 18:07:48 2015

 

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

 

 

Connected to:

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

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

 

SQL>  create table t5 as select * from dual;

 

Table created.

 

SQL> conn hr/hr@ogg2

Connected.

SQL> select count(1) from t5;

 

  COUNT(1)

----------

         1

 

SQL> alter table t5 add name varchar2(255);

 

Table altered.

 

SQL> conn hr/hr@ogg1

Connected.

SQL> desc t5

Name                                      Null?    Type

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

DUMMY                                              VARCHAR2(1)

NAME                                               VARCHAR2(255)

 

DDL测试注意查看ddl日志:

OGG2上的日志(/u01/app/oracle/diag/rdbms/ogg2/ogg2/trace/ggs_ddl_trace.log):

SESS 470002-2015-06-10 18:11:50 : DDL : ************************* Start of log for DDL sequence [1508], v[ $Id: ddl_setup.sql /st_oggcore_11.2.1/8 2012/04/02 11:11:33 smijatov Exp $ ] trace level [0], owner schema of DDL package [GGUSR], objtype [TABLE] name [HR.T5]

SESS 470002-2015-06-10 18:11:50 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [TABLE] name [HR.T5]

SESS 470002-2015-06-10 18:11:50 : DDL : DDL operation [ create table t5 as select * from dual ], sequence [1508], DDL type [CREATE] TABLE, real object type [TABLE], validity [], object ID [], object [HR.T5], real object [HR.T5], base object schema [], base object name [], logged as [HR]

SESS 470002-2015-06-10 18:11:50 : DDL : Start SCN found [1112052]

SESS 470002-2015-06-10 18:11:50 : DDL : ------------------------- End of log for DDL sequence [1508]

SESS 450003-2015-06-10 18:12:38 : DDL : ************************* Start of log for DDL sequence [1509], v[ $Id: ddl_setup.sql /st_oggcore_11.2.1/8 2012/04/02 11:11:33 smijatov Exp $ ] trace level [0], owner schema of DDL package [GGUSR], objtype [TABLE] name [HR.T5]

SESS 450003-2015-06-10 18:12:38 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [TABLE] name [HR.T5]

SESS 450003-2015-06-10 18:12:38 : DDL : DDL operation [alter table hr."T5" add name varchar2(255)  /* GOLDENGATE_DDL_REPLICATION */ ], sequence [1509], DDL type [ALTER] TABLE, real object type [TABLE], validity [VALID], object ID [76900], object [HR.T5], real object [HR.T5], base object schema [], base object name [], logged as [GGUSR]

SESS 450003-2015-06-10 18:12:38 : DDL : Start SCN found [1112101]

SESS 450003-2015-06-10 18:12:40 : DDL : ------------------------- End of log for DDL sequence [1509]

 

OGG1上的日志(/u02/app/oracle/diag/rdbms/ogg1/ogg1/trace/ggs_ddl_trace.log):

SESS 450045-2015-06-10 04:05:42 : DDL : ************************* Start of log for DDL sequence [43], v[ $Id: ddl_setup.sql /st_oggcore_11.2.1/8 2012/04/02 11:11:33 smijatov Exp $ ] trace level [0], owner schema of DDL package [GGUSR], objtype [TABLE] name [HR.T5]

SESS 450045-2015-06-10 04:05:42 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [TABLE] name [HR.T5]

SESS 450045-2015-06-10 04:05:42 : DDL : DDL operation [ create table hr."T5" as select * from dual  /* GOLDENGATE_DDL_REPLICATION */ ], sequence [43], DDL type [CREATE] TABLE, real object type [TABLE], validity [], object ID [], object [HR.T5], real object [HR.T5], base object schema [], base object name [], logged as [GGUSR]

SESS 450045-2015-06-10 04:05:42 : DDL : Start SCN found [1121651]

SESS 450045-2015-06-10 04:05:42 : DDL : ------------------------- End of log for DDL sequence [43]

SESS 470002-2015-06-10 04:06:19 : DDL : ************************* Start of log for DDL sequence [44], v[ $Id: ddl_setup.sql /st_oggcore_11.2.1/8 2012/04/02 11:11:33 smijatov Exp $ ] trace level [0], owner schema of DDL package [GGUSR], objtype [TABLE] name [HR.T5]

SESS 470002-2015-06-10 04:06:19 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [TABLE] name [HR.T5]

SESS 470002-2015-06-10 04:06:19 : DDL : DDL operation [alter table t5 add name varchar2(255) ], sequence [44], DDL type [ALTER] TABLE, real object type [TABLE], validity [VALID], object ID [76920], object [HR.T5], real object [HR.T5], base object schema [], base object name [], logged as [HR]

SESS 470002-2015-06-10 04:06:19 : DDL : Start SCN found [1121693]

SESS 470002-2015-06-10 04:06:20 : DDL : ------------------------- End of log for DDL sequence [44]

 

 

一.3.6.2  dml测试

[oracle@orcltest gg11]$ sqlplus hr/hr@ogg1

 

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 10 18:13:37 2015

 

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

 

 

Connected to:

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

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

 

SQL>  create table t6 as select * from dual;

 

Table created.

 

SQL> insert into t6 select * from t6;

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> select count(1) from t6;

 

  COUNT(1)

----------

         2

 

SQL> conn hr/hr@ogg2

Connected.

SQL>  select count(1) from t6;

 

  COUNT(1)

----------

         2

 

SQL> insert into t6 select * from t6;

 

2 rows created.

 

SQL> commit;

 

Commit complete.

 

SQL>  select count(1) from t6;

 

  COUNT(1)

----------

         4

 

SQL> conn hr/hr@ogg1

Connected.

SQL>  select count(1) from t6;

 

  COUNT(1)

----------

         4

 

SQL>

 

 

一.3.7  实验总结

 

OGG的双向复制其实就是在每台机器上都进行相关的单向配置。

 

一.4  About Me

 

...........................................................................................................................................................................................

本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

ITPUB BLOG:http://blog.itpub.net/26736162

本文地址:http://blog.itpub.net/26736162/viewspace-1699516/

本文pdf版:http://yunpan.cn/QCwUAI9bn7g7w  提取码:af2d

QQ:642808185 若加QQ请注明你所正在读的文章标题

创作时间地点:2015-06-10 09:00~ 2015-06-10 19:00 于外汇交易中心

...........................................................................................................................................................................................

 

 

时间: 2024-10-30 01:46:19

【OGG】OGG简单配置双向复制(三)的相关文章

【OGG】OGG的单向复制配置-支持DDL(二)

[OGG]OGG的单向复制配置-支持DDL(二) 一.1  BLOG文档结构图       一.2  前言部分   一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① OGG的单向DDL实时复制功能     注意:本篇BLOG中代码部分需要特别关注的地方我都用黄色背景和红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方.   List

ubuntu下简单配置mysql数据库

ubuntu下简单配置mysql数据库 一). ubuntu下mysql安装布局: /usr/bin                      客户端程序和mysql_install_db /db                             数据库和日志文件 /var/run mysqld        服务器 /etc/mysql mysql       配置文件my.cnf /usr/share/mysql       字符集,基准程序和错误消息 /etc/init.d/mysq

第一次使用Android Studio时你应该知道的一切配置(三):gradle项目构建

原文:第一次使用Android Studio时你应该知道的一切配置(三):gradle项目构建 ​[声明]  欢迎转载,但请保留文章原始出处→_→  生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/4456420.html   [系列] 第一次使用Android Studio时你应该知道的一切配置 第一次使用Android Studio时你应该知道的一切配置(二):新建一个属于自己的工程并安装G

CxImage 简单配置与使用

CxImage 简单配置与使用 如果本篇文章还不能解决你在生成解决方案以及便宜过程中的问题 请参阅: http://blog.csdn.net/afterwards_/article/details/7997385 我个人配置过来成功运行的经验. CxImage是一个十分强大的图形库,我们在PC端上开发GUI程序时,时常会用到位图之外的各种格式的图片,然而令我们郁闷的是在Windows平台上的GDI对一些图片格式支持的很差,比如png格式!尽管mfc上有一个CImage类来解决这个问题,但是,C

spring配置datasource三种方式

spring配置datasource三种方式 1.使用org.springframework.jdbc.datasource.DriverManagerDataSource 说明:DriverManagerDataSource建立连接是只要有连接就新建一个connection,根本没有连接池的作用. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSour

在win下打造linux环境: cygwin的安装和简单配置

  简单的讲述一下cygwin的安装和配置,入门级教程,还请各位高手指点一二. 首先到http://www.cygwin.com下载setup.exe,接着建立安装目录,如X:/cygwin,将setup.exe放到此目录, BEGIN-> 点击setup.exe,Next->选Install from Internet,Next->填写Root Directory,如X:/cygwin,Next->填写Local Package Directory,如X:/cygwin/ftp,

简单配置DotnetSkin 和IrisSkin 皮肤程序

问题描述 1.一行代码搞定2.简单配置就可以使用两种不同的皮肤软件DotnetSkin和IrisSkin3.配置灵活,动态装载菜单4.含有带所有源代码和Demo5.DotnetSkin和IrisSkin最新破解版的 解决方案 解决方案二: 下来看看,谢谢了解决方案三: up解决方案四: 不错!呵呵解决方案五: 使用skinfeature界面换肤组件啊.完全支持c#的.界面精致,而且效果很棒!!www.skinfeature.com解决方案六: 下来试一下,我装的那个破解版有点问题解决方案七: 不

PostgreSQL修炼之道:从小工到专家. 2.4 PostgreSQL的简单配置

2.4 PostgreSQL的简单配置 本节将简单介绍PostgreSQL的配置方法,更具体的配置操作会在后面的章节中介绍.PostgreSQL数据库的配置主要是通过修改数据目录下的postgresql.conf文件来实现的. 2.4.1 修改监听的IP和端口 在数据目录下编辑postgresql.conf文件,找到如下内容: #listen_addresses = 'localhost'         # what IP address(es) to listen on; #port = 5

ThinkPHP静态缓存简单配置和使用方法详解_php实例

本文实例讲述了ThinkPHP静态缓存简单配置和使用方法.分享给大家供大家参考,具体如下: 根据ThinkPHP官方手册:ThinkPHP内置了静态缓存类,通过静态缓存规则定义来实现了可配置的静态缓存. 启用静态缓存: ThinkPHP官方手册写道 要使用静态缓存功能,需要开启HTML_CACHE_ON 参数,并且在项目配置目录下面增加静态缓存规则文件 htmls.php,两者缺一不可.否则静态缓存不会生效. 在配置文件Conf\config.php的array()中加上: 'HTML_CACH