SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
配置 GoldenGate 同步
     DDL 语句




     by Maclean.liu
           liu.maclean@gmail.com
       www.oracledatabase12g.com
About Me

l Email:liu.maclean@gmail.com
l Blog:www.oracledatabase12g.com
l Oracle Certified Database Administrator Master 10g
and 11g
l Over 6 years experience with Oracle DBA technology
l Over 7 years experience with Linux technology
l Member Independent Oracle Users Group
l Member All China Users Group
l Presents for advanced Oracle topics: RAC,
DataGuard, Performance Tuning and Oracle Internal.
之前有客户选用了 Quest 的 shareplex 复制软件来 achive 一个上海到北京的 live standby 环境,所以有机会参加
了几次 shareplex 的切换演练,虽然我对 shareplex 十分陌生(直到现在也是)。在实际切换期间也多次听到
shareplex 的工程师反复强调复制环境中不能有 BLOB/CLOB 等大对象,也不能出现 DDL 语句(shareplex 不能复
制 LOB 和 DDL 吗,未经证实);可能该环境中的确很少变更,所以客户方的经理并不 concern 这一点:”我们不做
DDL 就是了嘛!” 这个复制环境因为数据库最初设计的时候没有考虑用主键或 unique index 且个别主用业务表上
有巨多列(多于 200 个列)的原因导致后来 add 上追加日志后出现重做日志产生量水涨船高的问题。

不过相比起 goldengate 有点惊人的价格来说(如果你需要 data repair 功能,记得你还需要另外购买 veridata),
似乎 shareplex 对于中国客户还是有着不少的优势。 shareplex 还是 goldengate, 这是个问题。




在配置 Goldengate 同步 DDL 语句前,要求在数据库内完成一系列的预安装先题步骤;其中包括建立合适的
Goldengate 用户,如:



create user maclean identified by maclean;
grant dba to maclean;


/* 之后 maclean 用户将用以配置 extract 和 pump */




之后我们需要执行一系列同步 DLL 语句要用到的 GoldenGate 脚本,这些脚本存放在 GG 的安装目录下:




[maclean@rh2 gg]$ pwd
/home/maclean/gg
[maclean@rh2 gg]$ ls -l dd*.sql
-r--r--r-- 1 maclean oinstall     1059 2010-03-12 ddl_cleartrace.sql
-r--r--r-- 1 maclean oinstall     4189 2010-03-12 ddl_ddl2file.sql
-r--r--r-- 1 maclean oinstall      746 2010-03-12 ddl_disable.sql
-r--r--r-- 1 maclean oinstall      692 2010-03-12 ddl_enable.sql
-r--r--r-- 1 maclean oinstall      388 2010-03-12 ddl_nopurgeRecyclebin.sql
-r--r--r-- 1 maclean oinstall   12424 2010-05-21 ddl_ora10.sql
-r--r--r-- 1 maclean oinstall     3863 2010-05-21 ddl_ora10upCommon.sql
-r--r--r-- 1 maclean oinstall   11064 2010-03-12 ddl_ora11.sql
-r--r--r-- 1 maclean oinstall   12365 2010-03-12 ddl_ora9.sql
-r--r--r-- 1 maclean oinstall     1026 2010-03-12 ddl_pin.sql
-r--r--r-- 1 maclean oinstall     1227 2010-03-12 ddl_purgeRecyclebin.sql
-r--r--r-- 1 maclean oinstall     3686 2010-05-13 ddl_remove.sql
-r--r--r-- 1 maclean oinstall      425 2009-06-29 ddl_session1.sql
-r--r--r-- 1 maclean oinstall     1053 2009-06-23 ddl_session.sql
-r-xr-xr-x 1 maclean oinstall 228606 06-29 13:48 ddl_setup.sql
-r--r--r-- 1 maclean oinstall     8872 2010-03-12 ddl_status.sql
-r--r--r-- 1 maclean oinstall     2506 2010-03-12 ddl_staymetadata_off.sql
-r--r--r-- 1 maclean oinstall     2501 2010-03-12 ddl_staymetadata_on.sql
-r--r--r-- 1 maclean oinstall     2955 2010-03-12 ddl_tracelevel.sql
-r--r--r-- 1 maclean oinstall     2543 2010-03-12 ddl_trace_off.sql
-r--r--r-- 1 maclean oinstall     2862 2010-03-12 ddl_trace_on.sql


/* 执行 goldengate ddl 同步安装脚本要求以 SYSDBA 身份登录 */


[maclean@rh2 gg]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 6 18:01:46 2010
Copyright (c) 1982, 2007, Oracle.    All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> alter system set recyclebin=off;
System altered.


/* 同步 DDL 要求我们关闭 10g 中的回收站特性 */


SQL> @marker_setup
Marker setup 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:maclean
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to MACLEAN
MARKER TABLE
-------------------------------
OK


MARKER SEQUENCE
-------------------------------
OK


Script complete.


/* 以 SYSDBA 登陆数据库并执行当前 GG 安装目录下的 market_setup 脚本,该脚本用以建立一个 DDL 标记表
包括以下列:

 seqNo NUMBER NOT NULL, -- sequence number

 fragmentNo NUMBER NOT NULL, -- fragment number (message divided into fragments)

 optime CHAR(19) NOT NULL, -- time of operation

 TYPE VARCHAR2 (100) NOT NULL, -- type of marker

 SUBTYPE VARCHAR2 (100) NOT NULL, -- subtype of marker

 marker_text VARCHAR2 (4000) NOT NULL,

 -- fragment text (message divided into fragments numbered with fragmentNo)
*/


SQL> @ddl_setup


GoldenGate DDL Replication setup script


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


Check complete.


You will be prompted for the name of a schema for the 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 GoldenGate schema name:maclean


You will be prompted for the mode of installation.
To install or reinstall DDL replication, enter INITIALSETUP
To upgrade DDL replication, enter NORMAL
Enter mode of installation:INITIALSETUP


Working, please wait ...
Spooling to file ddl_setup_spool.txt
Using MACLEAN as a GoldenGate schema name, INITIALSETUP as a mode of installation.


Working, please wait ...


RECYCLEBIN must be empty.
This installation will purge RECYCLEBIN for all users.
To proceed, enter yes. To stop installation, enter no.
Enter yes or no:yes


DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to MACLEAN


DDLORA_GETTABLESPACESIZE STATUS:


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


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 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
--------------------------------------------------------------------------------
/s01/10gdb/admin/clinica/udump/ggs_ddl_trace.log


Analyzing installation status...


STATUS OF DDL REPLICATION
--------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components


Script complete.


/* 以 INITIALSETUP 选项运行 ddl_setup.sql 将在数据库中创建捕获 DDL 语句的 Trigger 等必要组件 */


SQL> @role_setup


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:maclean
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.


/* role_setup 脚本用以建立 GGS_GGSUSER_ROLE 角色 */


我们需要将该 GGS_GGSUSER_ROLE 授予给 extract group 参数中定义的 userid 用户
SQL> grant GGS_GGSUSER_ROLE to maclean;
Grant succeeded.


SQL> @ddl_enable
Trigger altered.


/*ddl_enable.sql 将正式 enable ddl 捕获触发器,即:ALTER TRIGGER sys .&ddl_trigger_name ENABLE;
*/


SQL> @?/rdbms/admin/dbmspool
Package created.
Grant succeeded.
View created.
Package body created.


/* 执行 dbmspool 包将在数据库中创建 DBMS_SHARED_POOL 包,之后需要用到*/


SQL> @ddl_pin
Enter value for 1: maclean
PL/SQL procedure successfully completed.
Enter value for 1: maclean
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
/* ddl_pin.sql 通过 dbms_shared_pool.keep 存储过程将 DDLReplication 相关的对象 keep 在共享池中,

 以保证这些对象不要 reload,提升性能
*/




以上脚本都运行完成后,DDL 语句同步的先题条件就达成了。接着我们要来配置 GG 部分的 extract 和 replicat:




[maclean@rh2 gg]$ ggsci


Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.0.0 Build 078
Linux, x64, 64bit (optimized), Oracle 10 on Jul 28 2010 13:21:11


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


GGSCI (rh2.oracle.com) 1> add extract load1,tranlog,begin now
EXTRACT added.


GGSCI (rh2.oracle.com) 2> add rmttrail /s01/rmt/ma,megabytes 100,extract load1
RMTTRAIL added.


GGSCI (rh2.oracle.com) 5> encrypt password maclean
No key specified, using default key...


Encrypted password:    AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD


GGSCI (rh2.oracle.com) 16> start extract load1


Sending START request to MANAGER ...
EXTRACT LOAD1 starting


GGSCI (rh2.oracle.com) 19> view params load1


extract load1
userid maclean, password AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD,encryptkey default
RMTHOST rh3.oracle.com, MGRPORT 7809
RMTTRAIL /s01/rmt/ma
DDL INCLUDE MAPPED
Table sender.*;
/* 以上为源端的 extract load1 的配置,采用了 DDL INCLUDE MAPPED 的 DDL 同步方式 */


GGSCI (rh3.oracle.com) 59> add replicat rep1,exttrail /s01/rmt/ma,begin
now,checkpointtable maclean.checkpoint
REPLICAT added.


GGSCI (rh3.oracle.com) 62> view params rep1


replicat rep1
userid maclean,password maclean
ASSUMETARGETDEFS
discardfile /s01/discard/rep1.log,append,megabytes 10
-- Support DDL here
DDL
map sender.* , target receiver.*;


GGSCI (rh3.oracle.com) 60> start replicat rep1


Sending START request to MANAGER ...
REPLICAT REP1 starting


GGSCI (rh3.oracle.com) 63> info all


Program      Status       Group       Lag         Time Since Chkpt


MANAGER      RUNNING
REPLICAT     RUNNING      REP1        00:00:00    00:00:07


/* 以上为目标端的 replicat rep1 配置,DDL 语句将由 sender 用户映射到 receiver 用户 */




接下来我们对具体的 DDL 同步进行测试:




/ * 在源端建立测试用表 tddl */


SQL> conn sender/sender
Connected.
SQL> create table tddl (t1 int);
Table created.
REP1.rep 报告文件出现以下信息:
Opened trail file /s01/rmt/ma000000 at 2010-12-07 03:50:19
2010-12-07 03:52:13    INFO    OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-07 03:52:13    INFO    OGG-01408   Restoring current schema for DDL operation to
[MACLEAN].


SQL> conn receiver/receiver;
Connected.


SQL> desc tddl

Name                                         Null?    Type

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

T1                                                    NUMBER(38)


/* create table 的 DDL 语句被正确同步了 */


/* 可以从 gg 管理者名下的 ggs_marker 表看到捕获到的建表语句

 似乎可以分为 DDL 正文和变量 2 段
*/


SQL> set linesize 65 pagesize 1400;
SQL> select marker_text

 2      from ggs_marker

 3     where seqno =

     (select seqno from ggs_marker where marker_text like '%tddl%');

 4
MARKER_TEXT
-----------------------------------------------------------------
,C1='create table tddl (t1 int) ',
,C5='16',,B2='',,G4='',,B3='SENDER',,B4='TDDL',,C12='',,C13='',,B
5='TABLE',,B6='CREATE',,B7='16',,B8='MACLEAN.GGS_DDL_HIST',,B9='S
ENDER',,C7='10.2.0.4.0',,C8='10.2.0.3',,C9='',,C10='1',,C11='clin
ica',,G3='NONUNIQUE',,C14='NO',,C17('1')='NLS_LANGUAGE',,C18('1')
='AMERICAN',,C17('2')='NLS_TERRITORY',,C18('2')='AMERICA',,C17('3
')='NLS_CURRENCY',,C18('3')='$',,C17('4')='NLS_ISO_CURRENCY',,C18
('4')='AMERICA',,C17('5')='NLS_NUMERIC_CHARACTERS',,C18('5')='.,
',,C17('6')='NLS_CALENDAR',,C18('6')='GREGORIAN',,C17('7')='NLS_D
ATE_FORMAT',,C18('7')='DD-MON-RR',,C17('8')='NLS_DATE_LANGUAGE',,
C18('8')='AMERICAN',,C17('9')='NLS_SORT',,C18('9')='BINARY',,C17(
'10')='NLS_TIME_FORMAT',,C18('10')='HH.MI.SSXFF AM',,C17('11')='N
LS_TIMESTAMP_FORMAT',,C18('11')='DD-MON-RR HH.MI.SSXFF AM',,C17('
12')='NLS_TIME_TZ_FORMAT',,C18('12')='HH.MI.SSXFF AM TZR',,C17('1
3')='NLS_TIMESTAMP_TZ_FORMAT',,C18('13')='DD-MON-RR HH.MI.SSXFF A
M TZR',,C17('14')='NLS_DUAL_CURRENCY',,C18('14')='$',,C17('15')='
NLS_COMP',,C18('15')='BINARY',,C17('16')='NLS_LENGTH_SEMANTICS',,
C18('16')='BYTE',,C17('17')='NLS_NCHAR_CONV_EXCP',,C18('17')='FAL
SE',,C19='17',


SQL> conn sender/sender
Connected.
SQL> insert into tddl values(&a);
Enter value for a: 1
old     1: insert into tddl values(&a)
new     1: insert into tddl values(1)


1 row created.


SQL> /
Enter value for a: 2
old     1: insert into tddl values(&a)
new     1: insert into tddl values(2)


1 row created.


SQL> commit;


Commit complete.


SQL>    alter table tddl add tclob clob default 'I am testing';
Table altered.


/* 我们来看看添加有默认值的 clob 字段这样的 DDL 语句是否能够同步成功 */


SQL> conn receiver/receiver
Connected.
SQL> set linesize 100 pagesize 1400;
SQL> select * from tddl;


       T1 TCLOB
----------
--------------------------------------------------------------------------------

       1 I am testing
2 I am testing
/* 以上测试表明 gg 成功复制了添加有默认值的 clob 字段这样的 DDL 语句 */


我们可以从源端的$ORACLE_BASE/admin/$sid/udump 目录下的 ggs_ddl_trace.log 日志文件中找到以下记录:
SESS 154688-2010-12-06 19:08:42 : DDL : *************************
Start of log for DDL sequence [18], v[ $Id:
//depot/releases/OpenSys/v11.1.1.0/redist/SQLScripts/ddl_
setup.sql#2 $ ] trace level [0], owner schema of DDL package [MACLEAN], objtype [TABLE]
name [SENDER.TDDL]
SESS 154688-2010-12-06 19:08:42 : DDLTRACE1 : Before Trigger: point in
execution = [1.0], objtype [TABLE] name [SENDER.TDDL]
SESS 154688-2010-12-06 19:08:42 : DDL : DDL operation
[ alter table tddl add tclob clob default 'I am testing' ], sequence [18],
DDL type [ALTER] TABLE, real object ty
pe [TABLE], validity [VALID], object ID [57772], object [SENDER.TDDL],
real object [SENDER.TDDL], base object schema [], base object name [], logged as [SENDER]
SESS 154688-2010-12-06 19:08:42 : DDL : Start SCN found [45357217]
SESS 154688-2010-12-06 19:08:42 : DDL : ------------------------- End of log for DDL
sequence [18]




接下来我们会测试更多不同 DDL 语句的同步,这些我能想到的 DDL 语句包括:

   •    CREATE USER

   •    CREATE TABLESPACE

   •    CREATE PROCEDURE

   •    CREATE PROFILE

   •    CREATE DIRECTORY

   • CREATE EXTERNAL TABLE 等等
但在这之前我们需要修改我们在 GoldenGate 同步 DDL 语句(1)中配置的 extract 和 replicat 的参数文件:




GGSCI (rh2.oracle.com) 2> view params load1


extract load1
userid maclean, password AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD,encryptkey default
RMTHOST rh3.oracle.com, MGRPORT 7809
RMTTRAIL /s01/rmt/ma
DDL INCLUDE ALL
Table sender.*;


/*源端将 DLL INCLUDE MAPPED 修改为 DLL INCLUDE ALL,

 不同于 MAPPED,INCLUDE ALL 意味包含所有 DDL 语句

 MAPPED applies INCLUDE or EXCLUDE to DDL operations that are of

 MAPPED scope. MAPPED filtering is performed before filtering that is

 specified with other DDL parameter options

 ALL applies INCLUDE or EXCLUDE to DDL operations of all scopes.

*/
GGSCI (rh2.oracle.com) 4> stop extract load1
Sending STOP request to EXTRACT LOAD1 ...
Request processed.


GGSCI (rh2.oracle.com) 5> start extract load1
Sending START request to MANAGER ...
EXTRACT LOAD1 starting


GGSCI (rh3.oracle.com) 3> view params rep1


replicat rep1
userid maclean,password maclean
ASSUMETARGETDEFS
discardfile /s01/discard/rep1.log,append,megabytes 10
-- Support DDL here
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5
map sender.* , target receiver.*;
/* 目标端也需要将原来的 DDL 补充为 DDL INCLUDE ALL 以及加上

     DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5 */


/* DDLERROR 参数指定了出现 DDL 同步错误时的处理方式,此处为以 5 秒(RETRYDELAY)

     为间隔重试 3 次(MAXRETRIES),若该 DDL 仍报错,则忽略该 DDL
*/


GGSCI (rh3.oracle.com) 4> stop replicat rep1


Sending STOP request to REPLICAT REP1 ...
Request processed.


GGSCI (rh3.oracle.com) 5> start replicat rep1


Sending START request to MANAGER ...
REPLICAT REP1 starting




接下来我们要具体测试多种 DDL 语句的 gg 同步情况:




SQL> create user guser identified by guser;
User created.


源端的$ORACLE_BASE/admin/$SID/udump 下的 ggs_ddl_trace.log,纪录了该 create user ddl 语句:

 Start of log for DDL sequence [137], v[ $Id:
//depot/releases/OpenSys/v11.1.1.0/redist/SQLScripts
/ddl_setup.sql#2 $ ] trace level [0], owner schema of DDL package [MACLEAN], objtype
[USER] name [.GUSER]
SESS 4294967295-2010-12-07 22:21:06 : DDLTRACE1 : Before Trigger: point in execution =
[1.0], objtype [USER] name [.GUSER]
SESS 4294967295-2010-12-07 22:21:06 : DDL : DDL operation [create user guser identified
by ***** ]
, sequence [137], DDL type [CREATE] USER, real object type [USER], va
lidity [], object ID [], object [.GUSER], real object [.GUSER], base object schema [],
base object name [], logged as [SYS]
SESS 4294967295-2010-12-07 22:21:06 : DDL : Start SCN found [45484306]
End of log for DDL sequence [137], no DDL history metadata recorded for this DDL
operation


目标端同步情况:
SQL>    select username from dba_users where created>=all(select created from dba_users);
USERNAME
------------------------------
GUSER


/* 可以看到 create user 语句复制成功 */


SQL> show parameter db_create_file_dest


NAME                                 TYPE          VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string        /s01/10gdb/oradata


SQL> create tablespace gtb datafile size 10M;
Tablespace created.


SQL> show parameter db_create_file_dest


NAME                                 TYPE          VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string        /s01/oradata


SQL> select file_name from dba_data_files where tablespace_name='GTB';


FILE_NAME
--------------------------------------------------------------------------------
/s01/oradata/CLINICB/datafile/o1_mf_gtb_6hxjpstg_.dbf


/* 在远端和目标端都启用了 10g 中自动管理数据文件创建的前提下,

     创建表空间的 DDL 语句被复制成功
*/


/* 若我们在源端创建某表,且为该表指定一个目标端不存在的表空间时,

     create table 语句会如何呢?
*/
SQL> conn sender/sender
Connected.
SQL> create table rbf (t1 int) tablespace bf;
Table created.


可以在目标端的 replicat report 中看到以下 4 次尝试,其后三次应为我们之前定义的 MAXRETRIES:
2010-12-08 07:37:43   INFO   OGG-01407    Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 07:37:48      INFO    OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 07:37:53      INFO    OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 07:37:58      INFO    OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 07:37:58      INFO    OGG-01408   Restoring current schema for DDL operation to
[MACLEAN].


GGSCI (rh3.oracle.com) 21>      stats replicat rep1


Sending STATS request to REPLICAT REP1 ...


No active replication maps
DDL replication statistics:


*** Total statistics since replicat started           ***

      Operations                                       4.00

      Mapped operations                                2.00

      Unmapped operations                              0.00

      Other operations                                 2.00

      Excluded operations                              0.00

      Errors                                           8.00

      Retried errors                                   6.00

      Discarded errors                                 0.00

      Ignored errors                                   2.00


/* 虽然可以从 stats replicat 的输出中看到 Errors 和 Retried errors 数,

     但在 replicat 的 report 和 ggserr 日志中都没有纪录 DDL 同步失败的具体信息,准备提 SR 了!
*/


/* 在源端创建以下简单的存储过程 */
SQL> conn sender/sender
SQL> create or replace procedure progg as

 2    i   int;

 3    begin

 4    select t1 into i from tddl where rownum=1;

 5    dbms_output.put_line(i);

 6    end;

 7    /
Procedure created.
SQL> conn receiver/receiver
Connected.


SQL> select t1 from tddl;


     T1
----------

        1

        2


SQL> set serveroutput on;
SQL> exec progg;
1


PL/SQL procedure successfully completed.


/* 因为目标端存在该存储过程的依赖条件,所以复制后编译成功;

    否则复制可以成功但该对象状态为 INVALID */
SQL> drop procedure progg;
Procedure dropped.
SQL> drop table tddl;
Table dropped.


在源端再次创建该 procedure 后:


SQL> col object_name for a30
SQL> select object_name,status    from dba_objects where object_name='PROGG';


OBJECT_NAME                      STATUS
------------------------------ -------
PROGG                            INVALID


/* 在源端创建 profile 配置文件 */
SQL> create profile   gg_profile limit sessions_per_user   2;
Profile created.


SQL> select RESOURCE_NAME,LIMIT from dba_profiles where profile='GG_PROFILE' and limit!
='DEFAULT';


RESOURCE_NAME                      LIMIT
-------------------------------- ----------------------------------------
SESSIONS_PER_USER                  2
/*在目标端配置文件信息同步成功 */


/* 在源端创建文件夹 directory 对象 */
SQL> create directory dgg as '/s01/dump';
Directory created.


SQL> col directory_name for a3
SQL> col directory_path for a20
SQL> select directory_name,directory_path from dba_directories where
directory_name='DGG';


DIR DIRECTORY_PATH
--- --------------------
DGG /s01/dump
/*在文件系统上都存在/s01/dump 文件夹的前提下 create directory ddl 同步成功*/


/*在源端创建 type 为 oracle_datapump 的外部表 */
SQL> CREATE TABLE extgg

 2   ORGANIZATION EXTERNAL

 3   (TYPE oracle_datapump

 4   DEFAULT DIRECTORY dgg

 5   LOCATION ('extgg.dat'))

 6   AS

 7   select * from dba_objects;


Table created.


在目标端 replicat 中出现多次 retry 纪录:
2010-12-08 08:13:09   INFO     OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 08:13:14   INFO     OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 08:13:19   INFO     OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 08:13:24   INFO     OGG-01407   Setting current schema for DDL operation to
[RECEIVER].
2010-12-08 08:13:24   INFO     OGG-01408   Restoring current schema for DDL operation to
[MACLEAN].


/* 同时 ddl Errors 数目增加 */
GGSCI (rh3.oracle.com) 34> stats replicat rep1
Sending STATS request to REPLICAT REP1 ...
No active replication maps
DDL replication statistics:
*** Total statistics since replicat started       ***

    Operations                                    11.00

    Mapped operations                              6.00

    Unmapped operations                            0.00

    Other operations                               5.00

    Excluded operations                            0.00

    Errors                                        33.00

    Retried errors                                24.00

    Discarded errors                               0.00

    Ignored errors                                 9.00


/* 无疑是创建外部表的 DDL 语句复制失败,当因为目前找不到相关的日志所以无法进一步分析了 */




在配置 GoldenGate 同步 DDL 语句(2)中我们针对多种 DDL 语句在 GoldenGate 环境中的同步进行了测试,但在
默认情况下 replicat 在复制 DDL 语句失败时不会在 replicat report 或者 ggserr.log 等日志文件中产生该 DDL 失败
的具体信息,这就会导致我们在发现 DDL 同步有 error 的情况下无法了解失败的原因。之后又去翻官方的文档,
在中找到了 DDLOPTIONS 参数:




Use the DDLOPTIONS parameter to configure aspects of DDL processing other than filtering
and string substitution. You can use multiple DDLOPTIONS statements, but using one is
recommended. If using multiple DDLOPTIONS statements, make each of them unique so that
one does not override the other. Multiple DDLOPTIONS statements are executed in the order
listed.


这个参数可用的选项很多,我们需要用到的是 REPORT 选项:



Valid for Extract and Replicat (Oracle and Teradata).
Controls whether or not expanded DDL processing
information is written to the report file. The default of
NOREPORT reports basic DDL statistics. REPORT adds the
parameters being used and a step-by-step history of the
operations that were processed
在 replicat 的参数文件中添加上”DDLOPTIONS REPORT”,可以让 replicat 在同步 DDL 语句时若出现问题,将该
问题的详细情况记录到该 replicat 的 report 文件中,以便找出 DDL 复制失败的 root cause。




GGSCI (rh3.oracle.com) 9> view params rep1


replicat rep1
userid maclean,password maclean
ASSUMETARGETDEFS
discardfile /s01/discard/rep1.log,append,megabytes 10
-- Support DDL here
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5
DDLOPTIONS REPORT
map sender.* , target receiver.*;


GGSCI (rh3.oracle.com) 10> stop replicat rep1


Sending STOP request to REPLICAT REP1 ...
Request processed.


GGSCI (rh3.oracle.com) 11> start replicat rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting


在源端创建一外部表
SQL> CREATE TABLE extgg

 2   ORGANIZATION EXTERNAL

 3   (TYPE oracle_datapump

 4   DEFAULT DIRECTORY dgg

 5   LOCATION ('extgg.dat'))

 6   AS

 7   select * from dba_objects;


Table created.


之后检查 replicat 的 report 信息可以发现 DDL 复制失败的详细 SQL 语句等信息:


GGSCI (rh3.oracle.com) 12> view report rep1
***********************************************************************
Oracle GoldenGate Delivery for Oracle

             Version 11.1.1.0.0 Build 078

 Linux, x64, 64bit (optimized), Oracle 10 on Jul 28 2010 15:58:11


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


             Starting at 2010-12-10 05:54:32
***********************************************************************
...............
2010-12-09 09:10:13   INFO    OGG-01408     Restoring current schema for DDL operation to
[MACLEAN].
2010-12-09 09:10:13   INFO    OGG-00482     DDL found, operation [CREATE
GLOBAL TEMPORARY TABLE "SENDER"."SYS_TEMP_0FD9D6609_2B3F4ED" ("OWNER" VARCHAR2(30),
"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" VARCHAR2(30),"OBJECT_ID"
NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT_TYPE" VARCHAR2(19),"CREATED" DATE,"LAST_DDL_TIME"
DATE,
"TIMESTAMP" VARCHA R2(19),"STATUS" VARCHAR2(7),"TEMPORARY" VARCHAR2(1),
"GENERATED" VARCHAR2(1),"SECONDARY" VARCHAR2(1) ) IN_MEMORY_METADATA
CURSOR_SPECIFIC_SEGMENT STORAGE (OBJNO 4254950
921 ) NOPARALLEL   (size 456)].


2010-12-09 09:10:13   INFO    OGG-00489     DDL is of mapped scope, after mapping new
operation
[CREATE GLOBAL TEMPORARY TABLE "RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED"
("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME"
VARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT_TYPE"
VARCHAR2(19),"CREATED" DATE,"LAST_DDL_TIME" DATE,"TIMESTAMP" VARCHAR2(19),
"STATUS" VARCHAR2(7),"TEMPORARY" VARCHAR2(1),
"GENERATED" VARCHAR2(1),"SECONDARY" VARCHAR2(1) ) IN_MEMORY_METADATA CURSOR_SPECIF
IC_SEGMENT STORAGE (OBJNO 4254950921 ) NOPARALLEL      (size 458)].


2010-12-09 09:10:13   INFO    OGG-00487     DDL operation included [INCLUDE ALL], optype
[CREATE],
objtype [TABLE], objowner [RECEIVER], objname [SYS_TEMP_0FD9D6609_2B3F4E
D].
2010-12-09 09:10:13   INFO    OGG-01407     Setting current schema for DDL operation to
[SYS].
2010-12-09 09:10:13   INFO    OGG-00484     Executing DDL operation.
2010-12-09 09:10:18   INFO    OGG-00495     DDL error ignored for next retry: error code
[DEFAULT],
filter [include all (default)], error text [Error code [900],
ORA-00900: invalid SQL statement, SQL CREATE GLOBAL TEMPORARY TABLE
"RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED"
("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" V
ARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT], retry [1].


2010-12-09 09:10:18    INFO    OGG-01407   Setting current schema for DDL operation to
[SYS].
2010-12-09 09:10:18    INFO    OGG-00484   Executing DDL operation trying again due to
RETRYOP parameter.
2010-12-09 09:10:23    INFO    OGG-00495   DDL error ignored for next retry: error code
[DEFAULT],
filter [include all (default)], error text
[Error code [900], ORA-00900
: invalid SQL statement, SQL CREATE GLOBAL TEMPORARY TABLE
"RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED"
("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" V
ARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT], retry [2].
2010-12-09 09:10:23    INFO    OGG-01407   Setting current schema for DDL operation to
[SYS].




另外需要注意的是如 create table as select 这样的建表 DDL 语句应该被杜绝使用,因为在 goldengate 复制环境
中 create table as select 语句仍会以 DDL 形式被应用,这就导致源端和目标的端的数据不一致,如:




/* 源端中 dba_object 视图共有 52046 行数据 */
SQL> select count(*) from dba_objects;

 COUNT(*)
----------

  52046


SQL> create table ddlproblem as select * from dba_objects;
Table created.


SQL> select count(*) from ddlproblem;


 COUNT(*)
----------

  52047


而在目标端的复制情况:
SQL> desc ddlproblem
Name                                      Null?    Type

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

OWNER                                              VARCHAR2(30)

OBJECT_NAME                                        VARCHAR2(128)

SUBOBJECT_NAME                                     VARCHAR2(30)

OBJECT_ID                                          NUMBER

DATA_OBJECT_ID                                     NUMBER

OBJECT_TYPE                                        VARCHAR2(19)

CREATED                                            DATE

LAST_DDL_TIME                                      DATE

TIMESTAMP                                          VARCHAR2(19)

STATUS                                             VARCHAR2(7)

TEMPORARY                                          VARCHAR2(1)

GENERATED                                          VARCHAR2(1)

SECONDARY                                          VARCHAR2(1)


SQL> select count(*) from ddlproblem;


 COUNT(*)
----------

     51008


/* 因为 replicat 在目标端仅是简单的执行"create table as select"的建表 DDL 语句,

     而源端和目标端中这个被 select 的对象中的数据并不一致,因而 CTAS 操作只会导致

     2 端的数据不一致
*/




© 2010, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追求法律责
任.

Weitere ähnliche Inhalte

Was ist angesagt?

【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321maclean liu
 
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1Raheel Syed
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)Seungmin Yu
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLKenny Gryp
 
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesA close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesRiyaj Shamsudeen
 
Cloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And TricksCloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And TricksScott Jenner
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11gfcamachob
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQLKyle Hailey
 
Performance tuning a quick intoduction
Performance tuning   a quick intoductionPerformance tuning   a quick intoduction
Performance tuning a quick intoductionRiyaj Shamsudeen
 
pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databaseRiyaj Shamsudeen
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介Masayuki Matsushita
 
Oracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptOracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptChien Chung Shen
 
Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0Santosh Kangane
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesAlex Zaballa
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseNikhil Kumar
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 

Was ist angesagt? (20)

【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
【Maclean liu技术分享】拨开oracle cbo优化器迷雾,探究histogram直方图之秘 0321
 
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Px execution in rac
Px execution in racPx execution in rac
Px execution in rac
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesA close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issues
 
Cloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And TricksCloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
 
Performance tuning a quick intoduction
Performance tuning   a quick intoductionPerformance tuning   a quick intoduction
Performance tuning a quick intoduction
 
pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle database
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
 
Oracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptOracle Database SQL Tuning Concept
Oracle Database SQL Tuning Concept
 
Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
10053 otw
10053 otw10053 otw
10053 otw
 

Andere mochten auch

Social media pres!
Social media pres!Social media pres!
Social media pres!dannimooka
 
An integrated experimental and computational approach for the study of low ra...
An integrated experimental and computational approach for the study of low ra...An integrated experimental and computational approach for the study of low ra...
An integrated experimental and computational approach for the study of low ra...Leishman Associates
 
Тогтворгүй бүтэцтэй хөрсний механик
Тогтворгүй бүтэцтэй хөрсний механикТогтворгүй бүтэцтэй хөрсний механик
Тогтворгүй бүтэцтэй хөрсний механикТөгсжаргал Г.
 
How to Create Content People Actually Care About
How to Create Content People Actually Care AboutHow to Create Content People Actually Care About
How to Create Content People Actually Care AboutJay Acunzo
 
Case report of thoracic spine fractures from ied blast in armoured vehicle Y...
Case report of thoracic spine fractures from ied blast in armoured vehicle  Y...Case report of thoracic spine fractures from ied blast in armoured vehicle  Y...
Case report of thoracic spine fractures from ied blast in armoured vehicle Y...Leishman Associates
 
Molicular cell biology
Molicular cell biologyMolicular cell biology
Molicular cell biologyrkgene
 
Three years on, reflections on publication 103 mason
Three years on, reflections on publication 103 masonThree years on, reflections on publication 103 mason
Three years on, reflections on publication 103 masonLeishman Associates
 
Pitch Perfect: Giving Journalists What they Want
Pitch Perfect: Giving Journalists What they WantPitch Perfect: Giving Journalists What they Want
Pitch Perfect: Giving Journalists What they WantVuelio
 
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...Stefaan Vande Walle
 
Fr i final exam review
Fr i final exam reviewFr i final exam review
Fr i final exam reviewLiz Bucrek
 
Clarity4050
Clarity4050Clarity4050
Clarity4050jonanrp
 
Mis panas del colegio
Mis panas del colegioMis panas del colegio
Mis panas del colegiojcsalina
 
Presentation4site
Presentation4sitePresentation4site
Presentation4siteWord4ward
 
Google IOF presentation
Google IOF presentationGoogle IOF presentation
Google IOF presentationJason Potts
 

Andere mochten auch (20)

Linee_Guida
Linee_GuidaLinee_Guida
Linee_Guida
 
1
11
1
 
Social media pres!
Social media pres!Social media pres!
Social media pres!
 
An integrated experimental and computational approach for the study of low ra...
An integrated experimental and computational approach for the study of low ra...An integrated experimental and computational approach for the study of low ra...
An integrated experimental and computational approach for the study of low ra...
 
2005 nds 2
2005 nds 22005 nds 2
2005 nds 2
 
Catalogue 2010
Catalogue 2010Catalogue 2010
Catalogue 2010
 
100 best companies executive summary
100 best companies executive summary100 best companies executive summary
100 best companies executive summary
 
Тогтворгүй бүтэцтэй хөрсний механик
Тогтворгүй бүтэцтэй хөрсний механикТогтворгүй бүтэцтэй хөрсний механик
Тогтворгүй бүтэцтэй хөрсний механик
 
How to Create Content People Actually Care About
How to Create Content People Actually Care AboutHow to Create Content People Actually Care About
How to Create Content People Actually Care About
 
Case report of thoracic spine fractures from ied blast in armoured vehicle Y...
Case report of thoracic spine fractures from ied blast in armoured vehicle  Y...Case report of thoracic spine fractures from ied blast in armoured vehicle  Y...
Case report of thoracic spine fractures from ied blast in armoured vehicle Y...
 
Tanibeth
TanibethTanibeth
Tanibeth
 
Molicular cell biology
Molicular cell biologyMolicular cell biology
Molicular cell biology
 
Three years on, reflections on publication 103 mason
Three years on, reflections on publication 103 masonThree years on, reflections on publication 103 mason
Three years on, reflections on publication 103 mason
 
Pitch Perfect: Giving Journalists What they Want
Pitch Perfect: Giving Journalists What they WantPitch Perfect: Giving Journalists What they Want
Pitch Perfect: Giving Journalists What they Want
 
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...
WorldSTE2013: Accessibility Challenges to Science Education in Cambodia - An ...
 
Fr i final exam review
Fr i final exam reviewFr i final exam review
Fr i final exam review
 
Clarity4050
Clarity4050Clarity4050
Clarity4050
 
Mis panas del colegio
Mis panas del colegioMis panas del colegio
Mis panas del colegio
 
Presentation4site
Presentation4sitePresentation4site
Presentation4site
 
Google IOF presentation
Google IOF presentationGoogle IOF presentation
Google IOF presentation
 

Ähnlich wie 配置Golden gate同步ddl语句

Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseuzzal basak
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new featuresAlfredo Krieg
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2Alex Zaballa
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2Alex Zaballa
 
在Oel5上安装配置oracle gird control 10.2.0.5
在Oel5上安装配置oracle gird control 10.2.0.5在Oel5上安装配置oracle gird control 10.2.0.5
在Oel5上安装配置oracle gird control 10.2.0.5maclean liu
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTrivadis
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01Karam Abuataya
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recoverymaclean liu
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...Geir Høydalsvik
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsiChanaka Lasantha
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterI Goo Lee
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016Dave Stokes
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practicesJacques Kostic
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12cuzzal basak
 
Tungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleTungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleContinuent
 

Ähnlich wie 配置Golden gate同步ddl语句 (20)

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new features
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2
 
在Oel5上安装配置oracle gird control 10.2.0.5
在Oel5上安装配置oracle gird control 10.2.0.5在Oel5上安装配置oracle gird control 10.2.0.5
在Oel5上安装配置oracle gird control 10.2.0.5
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best Practices
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsi
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
Tungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleTungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And Oracle
 

Mehr von maclean liu

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践maclean liu
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルmaclean liu
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略maclean liu
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案maclean liu
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例maclean liu
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Checkmaclean liu
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案maclean liu
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响maclean liu
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案maclean liu
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2maclean liu
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2maclean liu
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1maclean liu
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 maclean liu
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangmaclean liu
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24maclean liu
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?maclean liu
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践maclean liu
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool databasemaclean liu
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and osmaclean liu
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载maclean liu
 

Mehr von maclean liu (20)

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Check
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool database
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and os
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载
 

Kürzlich hochgeladen

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

配置Golden gate同步ddl语句

  • 1. 配置 GoldenGate 同步 DDL 语句 by Maclean.liu liu.maclean@gmail.com www.oracledatabase12g.com
  • 2. About Me l Email:liu.maclean@gmail.com l Blog:www.oracledatabase12g.com l Oracle Certified Database Administrator Master 10g and 11g l Over 6 years experience with Oracle DBA technology l Over 7 years experience with Linux technology l Member Independent Oracle Users Group l Member All China Users Group l Presents for advanced Oracle topics: RAC, DataGuard, Performance Tuning and Oracle Internal.
  • 3. 之前有客户选用了 Quest 的 shareplex 复制软件来 achive 一个上海到北京的 live standby 环境,所以有机会参加 了几次 shareplex 的切换演练,虽然我对 shareplex 十分陌生(直到现在也是)。在实际切换期间也多次听到 shareplex 的工程师反复强调复制环境中不能有 BLOB/CLOB 等大对象,也不能出现 DDL 语句(shareplex 不能复 制 LOB 和 DDL 吗,未经证实);可能该环境中的确很少变更,所以客户方的经理并不 concern 这一点:”我们不做 DDL 就是了嘛!” 这个复制环境因为数据库最初设计的时候没有考虑用主键或 unique index 且个别主用业务表上 有巨多列(多于 200 个列)的原因导致后来 add 上追加日志后出现重做日志产生量水涨船高的问题。 不过相比起 goldengate 有点惊人的价格来说(如果你需要 data repair 功能,记得你还需要另外购买 veridata), 似乎 shareplex 对于中国客户还是有着不少的优势。 shareplex 还是 goldengate, 这是个问题。 在配置 Goldengate 同步 DDL 语句前,要求在数据库内完成一系列的预安装先题步骤;其中包括建立合适的 Goldengate 用户,如: create user maclean identified by maclean; grant dba to maclean; /* 之后 maclean 用户将用以配置 extract 和 pump */ 之后我们需要执行一系列同步 DLL 语句要用到的 GoldenGate 脚本,这些脚本存放在 GG 的安装目录下: [maclean@rh2 gg]$ pwd /home/maclean/gg [maclean@rh2 gg]$ ls -l dd*.sql -r--r--r-- 1 maclean oinstall 1059 2010-03-12 ddl_cleartrace.sql -r--r--r-- 1 maclean oinstall 4189 2010-03-12 ddl_ddl2file.sql -r--r--r-- 1 maclean oinstall 746 2010-03-12 ddl_disable.sql -r--r--r-- 1 maclean oinstall 692 2010-03-12 ddl_enable.sql -r--r--r-- 1 maclean oinstall 388 2010-03-12 ddl_nopurgeRecyclebin.sql -r--r--r-- 1 maclean oinstall 12424 2010-05-21 ddl_ora10.sql -r--r--r-- 1 maclean oinstall 3863 2010-05-21 ddl_ora10upCommon.sql -r--r--r-- 1 maclean oinstall 11064 2010-03-12 ddl_ora11.sql -r--r--r-- 1 maclean oinstall 12365 2010-03-12 ddl_ora9.sql -r--r--r-- 1 maclean oinstall 1026 2010-03-12 ddl_pin.sql -r--r--r-- 1 maclean oinstall 1227 2010-03-12 ddl_purgeRecyclebin.sql -r--r--r-- 1 maclean oinstall 3686 2010-05-13 ddl_remove.sql -r--r--r-- 1 maclean oinstall 425 2009-06-29 ddl_session1.sql -r--r--r-- 1 maclean oinstall 1053 2009-06-23 ddl_session.sql
  • 4. -r-xr-xr-x 1 maclean oinstall 228606 06-29 13:48 ddl_setup.sql -r--r--r-- 1 maclean oinstall 8872 2010-03-12 ddl_status.sql -r--r--r-- 1 maclean oinstall 2506 2010-03-12 ddl_staymetadata_off.sql -r--r--r-- 1 maclean oinstall 2501 2010-03-12 ddl_staymetadata_on.sql -r--r--r-- 1 maclean oinstall 2955 2010-03-12 ddl_tracelevel.sql -r--r--r-- 1 maclean oinstall 2543 2010-03-12 ddl_trace_off.sql -r--r--r-- 1 maclean oinstall 2862 2010-03-12 ddl_trace_on.sql /* 执行 goldengate ddl 同步安装脚本要求以 SYSDBA 身份登录 */ [maclean@rh2 gg]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 6 18:01:46 2010 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter system set recyclebin=off; System altered. /* 同步 DDL 要求我们关闭 10g 中的回收站特性 */ SQL> @marker_setup Marker setup 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:maclean Marker setup table script complete, running verification script... Please enter the name of a schema for the GoldenGate database objects: Setting schema name to MACLEAN MARKER TABLE ------------------------------- OK MARKER SEQUENCE ------------------------------- OK Script complete. /* 以 SYSDBA 登陆数据库并执行当前 GG 安装目录下的 market_setup 脚本,该脚本用以建立一个 DDL 标记表
  • 5. 包括以下列: seqNo NUMBER NOT NULL, -- sequence number fragmentNo NUMBER NOT NULL, -- fragment number (message divided into fragments) optime CHAR(19) NOT NULL, -- time of operation TYPE VARCHAR2 (100) NOT NULL, -- type of marker SUBTYPE VARCHAR2 (100) NOT NULL, -- subtype of marker marker_text VARCHAR2 (4000) NOT NULL, -- fragment text (message divided into fragments numbered with fragmentNo) */ SQL> @ddl_setup GoldenGate DDL Replication setup script Verifying that current user has privileges to install DDL Replication... Checking user sessions... Check complete. You will be prompted for the name of a schema for the 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 GoldenGate schema name:maclean You will be prompted for the mode of installation. To install or reinstall DDL replication, enter INITIALSETUP To upgrade DDL replication, enter NORMAL Enter mode of installation:INITIALSETUP Working, please wait ... Spooling to file ddl_setup_spool.txt Using MACLEAN as a GoldenGate schema name, INITIALSETUP as a mode of installation. Working, please wait ... RECYCLEBIN must be empty. This installation will purge RECYCLEBIN for all users. To proceed, enter yes. To stop installation, enter no.
  • 6. Enter yes or no:yes DDL replication setup script complete, running verification script... Please enter the name of a schema for the GoldenGate database objects: Setting schema name to MACLEAN DDLORA_GETTABLESPACESIZE STATUS: Line/pos Error ---------- ----------------------------------------------------------------- No errors No errors 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
  • 7. DDLREPLICATION PACKAGE STATUS: Line/pos Error ---------- ----------------------------------------------------------------- No errors No errors DDLREPLICATION 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
  • 8. 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 -------------------------------------------------------------------------------- /s01/10gdb/admin/clinica/udump/ggs_ddl_trace.log Analyzing installation status... STATUS OF DDL REPLICATION -------------------------------------------------------------------------------- SUCCESSFUL installation of DDL Replication software components Script complete. /* 以 INITIALSETUP 选项运行 ddl_setup.sql 将在数据库中创建捕获 DDL 语句的 Trigger 等必要组件 */ SQL> @role_setup 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
  • 9. 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:maclean 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. /* role_setup 脚本用以建立 GGS_GGSUSER_ROLE 角色 */ 我们需要将该 GGS_GGSUSER_ROLE 授予给 extract group 参数中定义的 userid 用户 SQL> grant GGS_GGSUSER_ROLE to maclean; Grant succeeded. SQL> @ddl_enable Trigger altered. /*ddl_enable.sql 将正式 enable ddl 捕获触发器,即:ALTER TRIGGER sys .&ddl_trigger_name ENABLE; */ SQL> @?/rdbms/admin/dbmspool Package created. Grant succeeded. View created. Package body created. /* 执行 dbmspool 包将在数据库中创建 DBMS_SHARED_POOL 包,之后需要用到*/ SQL> @ddl_pin Enter value for 1: maclean PL/SQL procedure successfully completed. Enter value for 1: maclean PL/SQL procedure successfully completed. PL/SQL procedure successfully completed.
  • 10. /* ddl_pin.sql 通过 dbms_shared_pool.keep 存储过程将 DDLReplication 相关的对象 keep 在共享池中, 以保证这些对象不要 reload,提升性能 */ 以上脚本都运行完成后,DDL 语句同步的先题条件就达成了。接着我们要来配置 GG 部分的 extract 和 replicat: [maclean@rh2 gg]$ ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.1.1.0.0 Build 078 Linux, x64, 64bit (optimized), Oracle 10 on Jul 28 2010 13:21:11 Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved. GGSCI (rh2.oracle.com) 1> add extract load1,tranlog,begin now EXTRACT added. GGSCI (rh2.oracle.com) 2> add rmttrail /s01/rmt/ma,megabytes 100,extract load1 RMTTRAIL added. GGSCI (rh2.oracle.com) 5> encrypt password maclean No key specified, using default key... Encrypted password: AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD GGSCI (rh2.oracle.com) 16> start extract load1 Sending START request to MANAGER ... EXTRACT LOAD1 starting GGSCI (rh2.oracle.com) 19> view params load1 extract load1 userid maclean, password AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD,encryptkey default RMTHOST rh3.oracle.com, MGRPORT 7809 RMTTRAIL /s01/rmt/ma DDL INCLUDE MAPPED Table sender.*;
  • 11. /* 以上为源端的 extract load1 的配置,采用了 DDL INCLUDE MAPPED 的 DDL 同步方式 */ GGSCI (rh3.oracle.com) 59> add replicat rep1,exttrail /s01/rmt/ma,begin now,checkpointtable maclean.checkpoint REPLICAT added. GGSCI (rh3.oracle.com) 62> view params rep1 replicat rep1 userid maclean,password maclean ASSUMETARGETDEFS discardfile /s01/discard/rep1.log,append,megabytes 10 -- Support DDL here DDL map sender.* , target receiver.*; GGSCI (rh3.oracle.com) 60> start replicat rep1 Sending START request to MANAGER ... REPLICAT REP1 starting GGSCI (rh3.oracle.com) 63> info all Program Status Group Lag Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REP1 00:00:00 00:00:07 /* 以上为目标端的 replicat rep1 配置,DDL 语句将由 sender 用户映射到 receiver 用户 */ 接下来我们对具体的 DDL 同步进行测试: / * 在源端建立测试用表 tddl */ SQL> conn sender/sender Connected. SQL> create table tddl (t1 int); Table created.
  • 12. REP1.rep 报告文件出现以下信息: Opened trail file /s01/rmt/ma000000 at 2010-12-07 03:50:19 2010-12-07 03:52:13 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-07 03:52:13 INFO OGG-01408 Restoring current schema for DDL operation to [MACLEAN]. SQL> conn receiver/receiver; Connected. SQL> desc tddl Name Null? Type ----------------------------------------- -------- ---------------------------- T1 NUMBER(38) /* create table 的 DDL 语句被正确同步了 */ /* 可以从 gg 管理者名下的 ggs_marker 表看到捕获到的建表语句 似乎可以分为 DDL 正文和变量 2 段 */ SQL> set linesize 65 pagesize 1400; SQL> select marker_text 2 from ggs_marker 3 where seqno = (select seqno from ggs_marker where marker_text like '%tddl%'); 4 MARKER_TEXT ----------------------------------------------------------------- ,C1='create table tddl (t1 int) ', ,C5='16',,B2='',,G4='',,B3='SENDER',,B4='TDDL',,C12='',,C13='',,B 5='TABLE',,B6='CREATE',,B7='16',,B8='MACLEAN.GGS_DDL_HIST',,B9='S ENDER',,C7='10.2.0.4.0',,C8='10.2.0.3',,C9='',,C10='1',,C11='clin ica',,G3='NONUNIQUE',,C14='NO',,C17('1')='NLS_LANGUAGE',,C18('1') ='AMERICAN',,C17('2')='NLS_TERRITORY',,C18('2')='AMERICA',,C17('3 ')='NLS_CURRENCY',,C18('3')='$',,C17('4')='NLS_ISO_CURRENCY',,C18 ('4')='AMERICA',,C17('5')='NLS_NUMERIC_CHARACTERS',,C18('5')='., ',,C17('6')='NLS_CALENDAR',,C18('6')='GREGORIAN',,C17('7')='NLS_D ATE_FORMAT',,C18('7')='DD-MON-RR',,C17('8')='NLS_DATE_LANGUAGE',, C18('8')='AMERICAN',,C17('9')='NLS_SORT',,C18('9')='BINARY',,C17( '10')='NLS_TIME_FORMAT',,C18('10')='HH.MI.SSXFF AM',,C17('11')='N
  • 13. LS_TIMESTAMP_FORMAT',,C18('11')='DD-MON-RR HH.MI.SSXFF AM',,C17(' 12')='NLS_TIME_TZ_FORMAT',,C18('12')='HH.MI.SSXFF AM TZR',,C17('1 3')='NLS_TIMESTAMP_TZ_FORMAT',,C18('13')='DD-MON-RR HH.MI.SSXFF A M TZR',,C17('14')='NLS_DUAL_CURRENCY',,C18('14')='$',,C17('15')=' NLS_COMP',,C18('15')='BINARY',,C17('16')='NLS_LENGTH_SEMANTICS',, C18('16')='BYTE',,C17('17')='NLS_NCHAR_CONV_EXCP',,C18('17')='FAL SE',,C19='17', SQL> conn sender/sender Connected. SQL> insert into tddl values(&a); Enter value for a: 1 old 1: insert into tddl values(&a) new 1: insert into tddl values(1) 1 row created. SQL> / Enter value for a: 2 old 1: insert into tddl values(&a) new 1: insert into tddl values(2) 1 row created. SQL> commit; Commit complete. SQL> alter table tddl add tclob clob default 'I am testing'; Table altered. /* 我们来看看添加有默认值的 clob 字段这样的 DDL 语句是否能够同步成功 */ SQL> conn receiver/receiver Connected. SQL> set linesize 100 pagesize 1400; SQL> select * from tddl; T1 TCLOB ---------- -------------------------------------------------------------------------------- 1 I am testing
  • 14. 2 I am testing /* 以上测试表明 gg 成功复制了添加有默认值的 clob 字段这样的 DDL 语句 */ 我们可以从源端的$ORACLE_BASE/admin/$sid/udump 目录下的 ggs_ddl_trace.log 日志文件中找到以下记录: SESS 154688-2010-12-06 19:08:42 : DDL : ************************* Start of log for DDL sequence [18], v[ $Id: //depot/releases/OpenSys/v11.1.1.0/redist/SQLScripts/ddl_ setup.sql#2 $ ] trace level [0], owner schema of DDL package [MACLEAN], objtype [TABLE] name [SENDER.TDDL] SESS 154688-2010-12-06 19:08:42 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [TABLE] name [SENDER.TDDL] SESS 154688-2010-12-06 19:08:42 : DDL : DDL operation [ alter table tddl add tclob clob default 'I am testing' ], sequence [18], DDL type [ALTER] TABLE, real object ty pe [TABLE], validity [VALID], object ID [57772], object [SENDER.TDDL], real object [SENDER.TDDL], base object schema [], base object name [], logged as [SENDER] SESS 154688-2010-12-06 19:08:42 : DDL : Start SCN found [45357217] SESS 154688-2010-12-06 19:08:42 : DDL : ------------------------- End of log for DDL sequence [18] 接下来我们会测试更多不同 DDL 语句的同步,这些我能想到的 DDL 语句包括: • CREATE USER • CREATE TABLESPACE • CREATE PROCEDURE • CREATE PROFILE • CREATE DIRECTORY • CREATE EXTERNAL TABLE 等等
  • 15. 但在这之前我们需要修改我们在 GoldenGate 同步 DDL 语句(1)中配置的 extract 和 replicat 的参数文件: GGSCI (rh2.oracle.com) 2> view params load1 extract load1 userid maclean, password AACAAAAAAAAAAAHANCUEFHPAVCYDNJVD,encryptkey default RMTHOST rh3.oracle.com, MGRPORT 7809 RMTTRAIL /s01/rmt/ma DDL INCLUDE ALL Table sender.*; /*源端将 DLL INCLUDE MAPPED 修改为 DLL INCLUDE ALL, 不同于 MAPPED,INCLUDE ALL 意味包含所有 DDL 语句 MAPPED applies INCLUDE or EXCLUDE to DDL operations that are of MAPPED scope. MAPPED filtering is performed before filtering that is specified with other DDL parameter options ALL applies INCLUDE or EXCLUDE to DDL operations of all scopes. */ GGSCI (rh2.oracle.com) 4> stop extract load1 Sending STOP request to EXTRACT LOAD1 ... Request processed. GGSCI (rh2.oracle.com) 5> start extract load1 Sending START request to MANAGER ... EXTRACT LOAD1 starting GGSCI (rh3.oracle.com) 3> view params rep1 replicat rep1 userid maclean,password maclean ASSUMETARGETDEFS discardfile /s01/discard/rep1.log,append,megabytes 10 -- Support DDL here DDL INCLUDE ALL DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5 map sender.* , target receiver.*;
  • 16. /* 目标端也需要将原来的 DDL 补充为 DDL INCLUDE ALL 以及加上 DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5 */ /* DDLERROR 参数指定了出现 DDL 同步错误时的处理方式,此处为以 5 秒(RETRYDELAY) 为间隔重试 3 次(MAXRETRIES),若该 DDL 仍报错,则忽略该 DDL */ GGSCI (rh3.oracle.com) 4> stop replicat rep1 Sending STOP request to REPLICAT REP1 ... Request processed. GGSCI (rh3.oracle.com) 5> start replicat rep1 Sending START request to MANAGER ... REPLICAT REP1 starting 接下来我们要具体测试多种 DDL 语句的 gg 同步情况: SQL> create user guser identified by guser; User created. 源端的$ORACLE_BASE/admin/$SID/udump 下的 ggs_ddl_trace.log,纪录了该 create user ddl 语句: Start of log for DDL sequence [137], v[ $Id: //depot/releases/OpenSys/v11.1.1.0/redist/SQLScripts /ddl_setup.sql#2 $ ] trace level [0], owner schema of DDL package [MACLEAN], objtype [USER] name [.GUSER] SESS 4294967295-2010-12-07 22:21:06 : DDLTRACE1 : Before Trigger: point in execution = [1.0], objtype [USER] name [.GUSER] SESS 4294967295-2010-12-07 22:21:06 : DDL : DDL operation [create user guser identified by ***** ] , sequence [137], DDL type [CREATE] USER, real object type [USER], va lidity [], object ID [], object [.GUSER], real object [.GUSER], base object schema [], base object name [], logged as [SYS] SESS 4294967295-2010-12-07 22:21:06 : DDL : Start SCN found [45484306] End of log for DDL sequence [137], no DDL history metadata recorded for this DDL operation 目标端同步情况: SQL> select username from dba_users where created>=all(select created from dba_users);
  • 17. USERNAME ------------------------------ GUSER /* 可以看到 create user 语句复制成功 */ SQL> show parameter db_create_file_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_create_file_dest string /s01/10gdb/oradata SQL> create tablespace gtb datafile size 10M; Tablespace created. SQL> show parameter db_create_file_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_create_file_dest string /s01/oradata SQL> select file_name from dba_data_files where tablespace_name='GTB'; FILE_NAME -------------------------------------------------------------------------------- /s01/oradata/CLINICB/datafile/o1_mf_gtb_6hxjpstg_.dbf /* 在远端和目标端都启用了 10g 中自动管理数据文件创建的前提下, 创建表空间的 DDL 语句被复制成功 */ /* 若我们在源端创建某表,且为该表指定一个目标端不存在的表空间时, create table 语句会如何呢? */ SQL> conn sender/sender Connected. SQL> create table rbf (t1 int) tablespace bf; Table created. 可以在目标端的 replicat report 中看到以下 4 次尝试,其后三次应为我们之前定义的 MAXRETRIES: 2010-12-08 07:37:43 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER].
  • 18. 2010-12-08 07:37:48 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 07:37:53 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 07:37:58 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 07:37:58 INFO OGG-01408 Restoring current schema for DDL operation to [MACLEAN]. GGSCI (rh3.oracle.com) 21> stats replicat rep1 Sending STATS request to REPLICAT REP1 ... No active replication maps DDL replication statistics: *** Total statistics since replicat started *** Operations 4.00 Mapped operations 2.00 Unmapped operations 0.00 Other operations 2.00 Excluded operations 0.00 Errors 8.00 Retried errors 6.00 Discarded errors 0.00 Ignored errors 2.00 /* 虽然可以从 stats replicat 的输出中看到 Errors 和 Retried errors 数, 但在 replicat 的 report 和 ggserr 日志中都没有纪录 DDL 同步失败的具体信息,准备提 SR 了! */ /* 在源端创建以下简单的存储过程 */ SQL> conn sender/sender SQL> create or replace procedure progg as 2 i int; 3 begin 4 select t1 into i from tddl where rownum=1; 5 dbms_output.put_line(i); 6 end; 7 / Procedure created.
  • 19. SQL> conn receiver/receiver Connected. SQL> select t1 from tddl; T1 ---------- 1 2 SQL> set serveroutput on; SQL> exec progg; 1 PL/SQL procedure successfully completed. /* 因为目标端存在该存储过程的依赖条件,所以复制后编译成功; 否则复制可以成功但该对象状态为 INVALID */ SQL> drop procedure progg; Procedure dropped. SQL> drop table tddl; Table dropped. 在源端再次创建该 procedure 后: SQL> col object_name for a30 SQL> select object_name,status from dba_objects where object_name='PROGG'; OBJECT_NAME STATUS ------------------------------ ------- PROGG INVALID /* 在源端创建 profile 配置文件 */ SQL> create profile gg_profile limit sessions_per_user 2; Profile created. SQL> select RESOURCE_NAME,LIMIT from dba_profiles where profile='GG_PROFILE' and limit! ='DEFAULT'; RESOURCE_NAME LIMIT -------------------------------- ---------------------------------------- SESSIONS_PER_USER 2
  • 20. /*在目标端配置文件信息同步成功 */ /* 在源端创建文件夹 directory 对象 */ SQL> create directory dgg as '/s01/dump'; Directory created. SQL> col directory_name for a3 SQL> col directory_path for a20 SQL> select directory_name,directory_path from dba_directories where directory_name='DGG'; DIR DIRECTORY_PATH --- -------------------- DGG /s01/dump /*在文件系统上都存在/s01/dump 文件夹的前提下 create directory ddl 同步成功*/ /*在源端创建 type 为 oracle_datapump 的外部表 */ SQL> CREATE TABLE extgg 2 ORGANIZATION EXTERNAL 3 (TYPE oracle_datapump 4 DEFAULT DIRECTORY dgg 5 LOCATION ('extgg.dat')) 6 AS 7 select * from dba_objects; Table created. 在目标端 replicat 中出现多次 retry 纪录: 2010-12-08 08:13:09 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 08:13:14 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 08:13:19 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 08:13:24 INFO OGG-01407 Setting current schema for DDL operation to [RECEIVER]. 2010-12-08 08:13:24 INFO OGG-01408 Restoring current schema for DDL operation to [MACLEAN]. /* 同时 ddl Errors 数目增加 */ GGSCI (rh3.oracle.com) 34> stats replicat rep1 Sending STATS request to REPLICAT REP1 ...
  • 21. No active replication maps DDL replication statistics: *** Total statistics since replicat started *** Operations 11.00 Mapped operations 6.00 Unmapped operations 0.00 Other operations 5.00 Excluded operations 0.00 Errors 33.00 Retried errors 24.00 Discarded errors 0.00 Ignored errors 9.00 /* 无疑是创建外部表的 DDL 语句复制失败,当因为目前找不到相关的日志所以无法进一步分析了 */ 在配置 GoldenGate 同步 DDL 语句(2)中我们针对多种 DDL 语句在 GoldenGate 环境中的同步进行了测试,但在 默认情况下 replicat 在复制 DDL 语句失败时不会在 replicat report 或者 ggserr.log 等日志文件中产生该 DDL 失败 的具体信息,这就会导致我们在发现 DDL 同步有 error 的情况下无法了解失败的原因。之后又去翻官方的文档, 在中找到了 DDLOPTIONS 参数: Use the DDLOPTIONS parameter to configure aspects of DDL processing other than filtering and string substitution. You can use multiple DDLOPTIONS statements, but using one is recommended. If using multiple DDLOPTIONS statements, make each of them unique so that one does not override the other. Multiple DDLOPTIONS statements are executed in the order listed. 这个参数可用的选项很多,我们需要用到的是 REPORT 选项: Valid for Extract and Replicat (Oracle and Teradata). Controls whether or not expanded DDL processing information is written to the report file. The default of NOREPORT reports basic DDL statistics. REPORT adds the parameters being used and a step-by-step history of the operations that were processed
  • 22. 在 replicat 的参数文件中添加上”DDLOPTIONS REPORT”,可以让 replicat 在同步 DDL 语句时若出现问题,将该 问题的详细情况记录到该 replicat 的 report 文件中,以便找出 DDL 复制失败的 root cause。 GGSCI (rh3.oracle.com) 9> view params rep1 replicat rep1 userid maclean,password maclean ASSUMETARGETDEFS discardfile /s01/discard/rep1.log,append,megabytes 10 -- Support DDL here DDL INCLUDE ALL DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5 DDLOPTIONS REPORT map sender.* , target receiver.*; GGSCI (rh3.oracle.com) 10> stop replicat rep1 Sending STOP request to REPLICAT REP1 ... Request processed. GGSCI (rh3.oracle.com) 11> start replicat rep1 Sending START request to MANAGER ... REPLICAT REP1 starting 在源端创建一外部表 SQL> CREATE TABLE extgg 2 ORGANIZATION EXTERNAL 3 (TYPE oracle_datapump 4 DEFAULT DIRECTORY dgg 5 LOCATION ('extgg.dat')) 6 AS 7 select * from dba_objects; Table created. 之后检查 replicat 的 report 信息可以发现 DDL 复制失败的详细 SQL 语句等信息: GGSCI (rh3.oracle.com) 12> view report rep1 ***********************************************************************
  • 23. Oracle GoldenGate Delivery for Oracle Version 11.1.1.0.0 Build 078 Linux, x64, 64bit (optimized), Oracle 10 on Jul 28 2010 15:58:11 Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved. Starting at 2010-12-10 05:54:32 *********************************************************************** ............... 2010-12-09 09:10:13 INFO OGG-01408 Restoring current schema for DDL operation to [MACLEAN]. 2010-12-09 09:10:13 INFO OGG-00482 DDL found, operation [CREATE GLOBAL TEMPORARY TABLE "SENDER"."SYS_TEMP_0FD9D6609_2B3F4ED" ("OWNER" VARCHAR2(30), "OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" VARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT_TYPE" VARCHAR2(19),"CREATED" DATE,"LAST_DDL_TIME" DATE, "TIMESTAMP" VARCHA R2(19),"STATUS" VARCHAR2(7),"TEMPORARY" VARCHAR2(1), "GENERATED" VARCHAR2(1),"SECONDARY" VARCHAR2(1) ) IN_MEMORY_METADATA CURSOR_SPECIFIC_SEGMENT STORAGE (OBJNO 4254950 921 ) NOPARALLEL (size 456)]. 2010-12-09 09:10:13 INFO OGG-00489 DDL is of mapped scope, after mapping new operation [CREATE GLOBAL TEMPORARY TABLE "RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED" ("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" VARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT_TYPE" VARCHAR2(19),"CREATED" DATE,"LAST_DDL_TIME" DATE,"TIMESTAMP" VARCHAR2(19), "STATUS" VARCHAR2(7),"TEMPORARY" VARCHAR2(1), "GENERATED" VARCHAR2(1),"SECONDARY" VARCHAR2(1) ) IN_MEMORY_METADATA CURSOR_SPECIF IC_SEGMENT STORAGE (OBJNO 4254950921 ) NOPARALLEL (size 458)]. 2010-12-09 09:10:13 INFO OGG-00487 DDL operation included [INCLUDE ALL], optype [CREATE], objtype [TABLE], objowner [RECEIVER], objname [SYS_TEMP_0FD9D6609_2B3F4E D]. 2010-12-09 09:10:13 INFO OGG-01407 Setting current schema for DDL operation to [SYS]. 2010-12-09 09:10:13 INFO OGG-00484 Executing DDL operation. 2010-12-09 09:10:18 INFO OGG-00495 DDL error ignored for next retry: error code [DEFAULT], filter [include all (default)], error text [Error code [900], ORA-00900: invalid SQL statement, SQL CREATE GLOBAL TEMPORARY TABLE "RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED"
  • 24. ("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" V ARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT], retry [1]. 2010-12-09 09:10:18 INFO OGG-01407 Setting current schema for DDL operation to [SYS]. 2010-12-09 09:10:18 INFO OGG-00484 Executing DDL operation trying again due to RETRYOP parameter. 2010-12-09 09:10:23 INFO OGG-00495 DDL error ignored for next retry: error code [DEFAULT], filter [include all (default)], error text [Error code [900], ORA-00900 : invalid SQL statement, SQL CREATE GLOBAL TEMPORARY TABLE "RECEIVER"."SYS_TEMP_0FD9D6609_2B3F4ED" ("OWNER" VARCHAR2(30),"OBJECT_NAME" VARCHAR2(128),"SUBOBJECT_NAME" V ARCHAR2(30),"OBJECT_ID" NUMBER,"DATA_OBJECT_ID" NUMBER,"OBJECT], retry [2]. 2010-12-09 09:10:23 INFO OGG-01407 Setting current schema for DDL operation to [SYS]. 另外需要注意的是如 create table as select 这样的建表 DDL 语句应该被杜绝使用,因为在 goldengate 复制环境 中 create table as select 语句仍会以 DDL 形式被应用,这就导致源端和目标的端的数据不一致,如: /* 源端中 dba_object 视图共有 52046 行数据 */ SQL> select count(*) from dba_objects; COUNT(*) ---------- 52046 SQL> create table ddlproblem as select * from dba_objects; Table created. SQL> select count(*) from ddlproblem; COUNT(*) ---------- 52047 而在目标端的复制情况: SQL> desc ddlproblem
  • 25. Name Null? Type ----------------------------------------- -------- ---------------------------- OWNER VARCHAR2(30) OBJECT_NAME VARCHAR2(128) SUBOBJECT_NAME VARCHAR2(30) OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER OBJECT_TYPE VARCHAR2(19) CREATED DATE LAST_DDL_TIME DATE TIMESTAMP VARCHAR2(19) STATUS VARCHAR2(7) TEMPORARY VARCHAR2(1) GENERATED VARCHAR2(1) SECONDARY VARCHAR2(1) SQL> select count(*) from ddlproblem; COUNT(*) ---------- 51008 /* 因为 replicat 在目标端仅是简单的执行"create table as select"的建表 DDL 语句, 而源端和目标端中这个被 select 的对象中的数据并不一致,因而 CTAS 操作只会导致 2 端的数据不一致 */ © 2010, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追求法律责 任.