【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 <CREATE TABLE ggusr.rep_demo_ckpt (  group_name VARCHAR2(8) NOT NULL,  group_key NUMBER(19) NOT NULL,  seqno NUMBER(10),  rba NUMBER(19) NOT NULL,  audit_ts VARCHAR2(29),  create_ts DATE NOT NULL,  last_update_ts DATE NOT NULL,  current_dir VARCHAR2(255) NOT NULL,  log_csn VARCHAR2(129),  log_xid VARCHAR2(129),  log_cmplt_csn VARCHAR2(129),  log_cmplt_xids VARCHAR2(2000),  version NUMBER(3),  PRIMARY KEY (group_name, group_key))>.

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 <loggedUser>

where <loggedUser> 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 于外汇交易中心

<版权所有,文章允许转载,但须以链接方式注明源地址,否则追究法律责任!>

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

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

  1. 02 Spring框架 简单配置和三种bean的创建方式

    整理了一下之前学习Spring框架时候的一点笔记.如有错误欢迎指正,不喜勿喷. 上一节学习了如何搭建SpringIOC的环境,下一步我们就来讨论一下如何利用ioc来管理对象和维护对象关系. <? ...

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

    [OGG]OGG的单向复制配置-支持DDL(二) 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的 ...

  3. OGG到OGGAdapter配置详情-从Oracle直接抽取成csv文件

    Oracle Golden Gate是Oracle旗下一款支持异构平台之间高级复制技术,是Oracle力推一种HA高可用产品,简称“OGG”,可以实现Active-Active 双业务中心架构 1.1 ...

  4. ogg的安装配置 配置双向同步(含DDL)

    第一部分 先配置单向同步(含DDL) 一 源端安装GoldenGate 创建用户 创建目录 mkdir -p /opt/ogg chmod -R 777 /opt/ogg chown -R oracl ...

  5. Hibernate学习2--对象的三种状态以及映射关系的简单配置

    上篇hibernate的博客总体简单梳理了对象持久化的一些思想以及hibernate中对象持久化化的方法,下面说说对象持久化过程的三种状态. 一.hibernate缓存的概念 1.session与缓存 ...

  6. GoldenGate配置(三)之DDL复制配置

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/huangyanlong/article/details/33430293 GoldenGate配置( ...

  7. 转-squid介绍及其简单配置

    本文原始出处:http://linuxme.blog.51cto.com/1850814/372960 1.Squid是什么? Squid中文权威指南:http://zyan.cc/book/squi ...

  8. CCNA网络工程师学习进程(6)vlan相关协议的配置与路由器简单配置介绍

        前面已经介绍了大部分与vlan技术相关的交换机的协议的配置,更深层次的还有STP协议和以太网端口聚合技术,接着还会简单介绍一下路由器的基本应用.     (1)STP(Spanning-tre ...

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

    ​[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/ ...

随机推荐

  1. angular的路由例子

    app.routing.module.ts里面,关键部分 const routes: Routes = [ { path: '', redirectTo : 'c3/c2/mmc', pathMatc ...

  2. 使用atom 将 markdown 转换成pdf

    atom 下载 atom 可以直接下载 : https://atom.io/ 打开下面链接 下载上面图中绿色版本的 atom 下载完成之后,解压,可以直接打开.这样可以避免 windows 下用安装包 ...

  3. CSAGAN:LinesToFacePhoto: Face Photo Generation from Lines with Conditional Self-Attention Generative Adversarial Network - 1 - 论文学习

    ABSTRACT 在本文中,我们探讨了从线条生成逼真的人脸图像的任务.先前的基于条件生成对抗网络(cGANs)的方法已经证明,当条件图像和输出图像共享对齐良好的结构时,它们能够生成视觉上可信的图像.然 ...

  4. 在 Python 中使用定时器

    今天看到一个比较人性化的定时模块 schedule,目前 star 数为 6432,还是非常的受欢迎,这个模块也是秉承这 For Humans 的原则,这里推荐给大家.地址 https://githu ...

  5. VUE 同一页面路由参数变化,视图不刷新的解决方案

    1.监听路由处理 watch: { $route(to, from) { // 逻辑 // 重新调用数据接口 } }, 2.beforeRouteUpdate导航守卫 路由更新时触发 beforeRo ...

  6. Win10升级后无法删除Windows.old文件夹

    问题:win10系统进行升级后(升级到1903版本),无法删除生成的Windows.old文件夹,提示文件夹访问被拒绝. 点击继续后,无法进行正常删除. 解决方法:使用windows自带的磁盘清理进行 ...

  7. GraphQL&DSL&API网关

    车联网服务non-RESTful架构改造实践   导读 在构建面向企业项目.多端的内容聚合类在线服务API设计的过程中,由于其定制特点,采用常规的restful开发模式,通常会导致大量雷同API重复开 ...

  8. 修改IP地址之后认证信息问题

    $ ssh lvph@172.16.20.20 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOT ...

  9. 机器学习之挖掘melb_data.csv数据

    mel_data.csv是关于melb地区房屋的数据 mel_data.csv import pandas as pd melbourne_file_path = "E:\data\Melb ...

  10. SpringBoot集成Mybatis实现多表查询的两种方式(基于xml)

     下面将在用户和账户进行一对一查询的基础上进行介绍SpringBoot集成Mybatis实现多表查询的基于xml的两种方式.   首先我们先创建两个数据库表,分别是user用户表和account账户表 ...