@RANG 拆分 data pump进程





In the following configuration example, the source database name is orcl and its  
source schema name is source. The dest database name is orcl and its dest schema  
name is dest.

Source system configuration
The following section specifies an example configuration for parallel data processing  
that will be used to leverage the performance of the GoldenGate data capture and  
routing process.

Parallel process parameter files
    1.  Place the following EXTRACT.prm file in the dirprm sub-directory of the  
        GoldenGate home on the source system:

-- EXTRACT1.prm
--
-- Change Capture parameter file to capture
-- source table changes
--
EXTRACT EXTRACT1
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
EXTTRAIL ./dirdat/sa
----TRANLOGOPTIONS ASMUSER SYS@ASM, ASMPASSWORD Welcome
TABLE user1.t3;

    2.  Place the following DATAPMP1.prm and DATAPMP2.prm files in the dirprm  
        sub-directory of the GoldenGate home on the source system:

-- DATAPMP1.prm
--
-- Data Pump parameter file to read the local
-- trail sa for source table changes and write to
-- remote trail ta
--
EXTRACT DATAPMP1
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
RMTHOST dest, MGRPORT 7890
RMTTRAIL ./dirdat/ta
TABLE user1.t3, FILTER (@RANGE (1,2));


-- DATAPMP2.prm
--
-- Data Pump parameter file to read the local
-- trail sa for source table changes and write to
-- remote trail tb
--
EXTRACT DATAPMP2
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
RMTHOST dest, MGRPORT 7890
RMTTRAIL ./dirdat/tb
TABLE user1.t3, FILTER (@RANGE (2,2));
      
Now that the Extract process parameter files have been created in the dirprm sub-
directory, we can create the associated Extract process groups.

Creating extract parallel process groups
    1.  Use the following Obey file to prepare and configure your source system for  
        multiple Data Pump process groups:

        -- config_source.oby

        -- Database Authentication Connection
        DBLOGIN USERID ogg@orcl, PASSWORD ogg

        -- Turning on Data Capture Changes on all Tables
        ADD TRANDATA user1.t3
                -- Verify that supplemental log has been switched on
        INFO TRANDATA user1.t3
            
        
        
-- Adding the extract group for the capture
        ADD EXTRACT extract1, TRANLOG, BEGIN NOW

        -- Defining the local trail files for capture  
        ADD EXTTRAIL ./dirdat/sa, EXTRACT extract1, MEGABYTES 500

        -- Check status of all running processes
         INFO ALL

        -- Adding the extract group for the pump
        ADD EXTRACT datapmp1, EXTTRAILSOURCE ./dirdat/sa

        -- Defining the remote trail files for pump  
        ADD RMTTRAIL ./dirdat/ta, EXTRACT datapmp1, MEGABYTES 500

        -- Adding the extract group for the pump
        ADD EXTRACT datapmp2, EXTTRAILSOURCE ./dirdat/sa

        -- Defining the remote trail files for pump  
        ADD RMTTRAIL ./dirdat/tb, EXTRACT datapmp2, MEGABYTES 500

        -- Start extract and data pump processes
        START EXTRACT *

        -- Check status of all running processes
         INFO ALL

    2.  Place the config_source.oby file in the dirprm sub-directory of the  
        GoldenGate home on the source system.

    3.  To execute the Obey file, call it from the GGSCI command line.

        GGSCI (dbserver1) 1> obey ./dirprm/config_source.oby

    4.  Check if the Extract processes are running.

        GGSCI (dbserver1) 93> info all

        Program     Status      Group       Lag           Time Since Chkpt

        MANAGER     RUNNING

        EXTRACT     RUNNING     DATAPMP1    00:00:00      00:00:03

        EXTRACT     RUNNING     DATAPMP2    00:00:00      00:00:02

        EXTRACT     RUNNING     EXTRACT1    00:00:00      00:00:03

That concludes the source system configuration. From the example output, we can  
see that the Extract processes have been started and are running. Let's now configure  
the dest system.


dest system configuration
The following section specifies an example configuration for parallel data processing  
that will be used to leverage the performance of the GoldenGate data delivery  
process.

Parallel process parameter files
    1.  Place the following REPLCAT1.prm, REPLCAT2.prm, REPLCAT3.prm and  
        REPLCAT4.prm files in the dirprm sub-directory of the GoldenGate home on  
        the dest system:

        -- REPLCAT1.prm
        --
        -- Replicator parameter file to read remote trail ta
        -- and apply changes to dest tables
        --

GGSCI (dest) 4> view params replcat1

REPLICAT REPLCAT1
--SOURCEDEFS ./dirdef/orcl.def
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
ASSUMETARGETDEFS
HANDLECOLLISIONS                                                                       
DISCARDFILE ./dirrpt/replcat3.dsc, PURGE
ALLOWDUPTARGETMAP
CHECKPOINTSECS 30
GROUPTRANSOPS 2000
BATCHSQL
MAP user1.t3, TARGET user1.t3,  FILTER (@RANGE (1,2));


GGSCI (dest) 5> view params replcat2

REPLICAT REPLCAT2
--SOURCEDEFS ./dirdef/orcl.def
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
ASSUMETARGETDEFS
HANDLECOLLISIONS                                                                       
DISCARDFILE ./dirrpt/replcat2.dsc, PURGE
ALLOWDUPTARGETMAP
CHECKPOINTSECS 30
GROUPTRANSOPS 2000
BATCHSQL
MAP user1.t3, TARGET user1.t3,  FILTER (@RANGE (2,2));


GGSCI (dest) 6> view params replcat3

REPLICAT REPLCAT3
--SOURCEDEFS ./dirdef/orcl.def
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
ASSUMETARGETDEFS
HANDLECOLLISIONS
USERID ogg, PASSWORD ogg
DISCARDFILE ./dirrpt/replcat3.dsc, PURGE
ALLOWDUPTARGETMAP
CHECKPOINTSECS 30
GROUPTRANSOPS 2000
BATCHSQL
MAP user1.t3, TARGET user1.t3,  FILTER (@RANGE (1,2));


GGSCI (dest) 7> view params replcat4

REPLICAT REPLCAT4
--SOURCEDEFS ./dirdef/orcl.def
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
ASSUMETARGETDEFS
HANDLECOLLISIONS
USERID ogg, PASSWORD ogg
DISCARDFILE ./dirrpt/replcat4.dsc, PURGE
ALLOWDUPTARGETMAP
CHECKPOINTSECS 30
GROUPTRANSOPS 2000
BATCHSQL
MAP user1.t3, TARGET user1.t3,  FILTER (@RANGE (2,2));      


Now that we have created the Replicat parameter files and placed them in the  
dirprm sub-directory, we can create the associated Replicat process groups.

Creating Replicat parallel process groups
    1.  Use the following Obey file to prepare and configure your dest system for  
        multiple Replicat process groups:

        -- config_dest.oby

        -- Login to Database
        dblogin userid ogg@orcl, password ogg

        -- Adds Checkpoint Table
        add checkpointtable ogg.CHECKPOINT  

        -- Adding the replicat group for the delivery
        ADD REPLICAT replcat1, EXTTRAIL ./dirdat/ta, CHECKPOINTTABLE OGG.CHECKPOINT

        -- Adding the replicat group for the delivery
        ADD REPLICAT replcat2, EXTTRAIL ./dirdat/ta, CHECKPOINTTABLE OGG.CHECKPOINT

        -- Adding the replicat group for the delivery
        ADD REPLICAT replcat3, EXTTRAIL ./dirdat/tb, CHECKPOINTTABLE OGG.CHECKPOINT

        -- Adding the replicat group for the delivery
        ADD REPLICAT replcat4, EXTTRAIL ./dirdat/tb, CHECKPOINTTABLE OGG.CHECKPOINT






                                                                                       Chapter 9

         -- Starting the replicat groups
         START REPLICAT *

         -- Check status of all running processes
         INFO ALL

    2.   Place the config_dest.oby file in the dirprm sub-directory of the  
         GoldenGate home on the dest system.

    3.   To execute the Obey file, call it from the GGSCI command line.

         GGSCI (dest) 1> obey ./dirprm/config_dest.oby

    4.   Check if the Replicat processes are running.

         GGSCI (dest) 119> info all

         Program     Status      Group       Lag           Time Since Chkpt

         MANAGER     RUNNING.

         REPLICAT    RUNNING     REPLCAT1    00:00:00      00:00:06

         REPLICAT    RUNNING     REPLCAT2    00:00:00      00:00:06

         REPLICAT    RUNNING     REPLCAT3    00:00:00      00:00:06

         REPLICAT    RUNNING     REPLCAT4    00:00:00      00:00:06

That concludes the dest system configuration. From the example output, we can  
see that the Replicat processes have been started and are running. You can now enjoy  
high performance data replication from the orcl to orcl databases.

Improving Replicat throughput
Replicat performance can be further improved by altering the way GoldenGate  
commits the transaction on the dest database. By default, Oracle will wait  
for a commit to succeed before allowing the session to continue. However, this  
synchronous behavior can cause unnecessary delays when the workload is high.

To alleviate this bottleneck, we can configure our Replicat processes to commit  
asynchronously at session level by including the following SQLEXEC statement in  
each parameter file:

    SQLEXEC "alter session set commit_wait = 'NOWAIT'";

                                             [ 201 ]
      
        


****************************************************************************************************************************
[oracle@source ogg]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Sun May 24 11:01:35 2015

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

SQL> connect user1/oracle
Connected.
SQL> select count(*) from t3;

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

SQL>
SQL>
SQL>
SQL>
SQL> desc t3;
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
OWNER                                     NOT NULL VARCHAR2(30)
OBJECT_NAME                               NOT NULL VARCHAR2(128)
SUBOBJECT_NAME                                     VARCHAR2(30)
OBJECT_ID                                 NOT NULL 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)
NAMESPACE                                          NUMBER
EDITION_NAME                                       VARCHAR2(30)

SQL> desc DBA_objects;
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)
NAMESPACE                                          NUMBER
EDITION_NAME                                       VARCHAR2(30)



问题:

2015-05-24 11:54:59  WARNING OGG-01930  Datastore error in 'dirbdb': BDB0113 Thread/process 22294/139850034439936 failed: BDB1507 Thread died in Berkeley DB library.

处理:
使用GoldenGate的jagent是可能会碰到:
WARNING OGG-01930  Datastore error in 'dirbdb': BDB0113 Thread/process 27316/1135331648 failed: BDB1507 Thread died in Berkeley DB library.
的错误,升级GoldenGate当然是最好的解决方案。不升级GoldenGate其实也是有解决方法的。只要重建datastore就可以了。
首先将所有的GoldenGate进程停止,包括manager进程。再将datastore目录(通常是$GG_HOME/dirbdb)进行备份并删除。然后建新的datastore。
GGSCI> create datastore
最后将GoldenGate进程起来就可以了。


标签: 暂无标签
dongxujian

写了 86 篇文章,拥有财富 384,被 13 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P4 | 发表于 2015-7-13 14:17:18
资料内容挺好,学习!
回复

使用道具

P3 | 发表于 2015-7-24 16:33:02
mark。。。。。。。。。现场没去,资料还是记录下
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈