3.使用OGG进程进行初始化数据

开始初始化数据的时候要满足下面的条件:

1.disable掉目标段表的外键约束

2.disable掉目标端表的触发器

3.删除目标段表的索引,加快初始化速度

4.目标端表结构创建完成

 

源端配置初始化抽取进程

GGSCI (db11) 72> edit params IHREMD1 


Extract IHREMD1
-------------------------------------------------------------------
-- Initial Load extract for HR schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
DBOPTIONS ALLOWNOLOGGING
RmtHost 192.168.1.3, mgrport 7809
RmtTask Replicat, Group DHREMD1
Table HR.T;

 

添加:

GGSCI (db11) 73> ADD EXTRACT IHREMD1, SOURCEISTABLE 

 

目标端装载进程

GGSCI (10gasm) 34> edit param dhremd1


Replicat DHREMD1
-------------------------------------------------------------------
-- Initial load replicat for HR schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
AssumeTargetDefs
Map HR.T, Target HR.T ;
~

 

添加:

GGSCI (10gasm) 35> ADD REPLICAT DHREMD1, SPECIALRUN

 

启动,源段校验

GGSCI (db11) 74> view report ihremd1


2014-09-23 23:04:31  INFO    OGG-01017  Wildcard resolution set to IMMEDIATE because SOURCEISTABLE is used.

***********************************************************************
                 Oracle GoldenGate Capture for Oracle
    Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
   Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:42:16
 
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2014-09-23 23:04:31
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
Node: db11
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 22239

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2014-09-23 23:04:31  INFO    OGG-03035  Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
Extract IHREMD1
-------------------------------------------------------------------
-- Initial Load extract for HR schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
Set environment variable (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ***

2014-09-23 23:04:31  INFO    OGG-03500  WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database char
acter set value of ZHS16GBK.
DBOPTIONS ALLOWNOLOGGING
RmtHost 192.168.1.3, mgrport 7809
RmtTask Replicat, Group DHREMD1
Table HR.T;

2014-09-23 23:04:46  WARNING OGG-00869  No unique key is defined for table 'T'. All viable columns will be used to represent the key, but may not gua
rantee uniqueness.  KEYCOLS may be used to define the key.
Using the following key columns for source table HR.T: EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION
_PCT, MANAGER_ID, DEPARTMENT_ID.


2014-09-23 23:04:46  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /home/oracle/ogg/dirtmp.

CACHEMGR virtual memory values (may have been adjusted)
CACHESIZE:                               64G
CACHEPAGEOUTSIZE (normal):                8M
PROCESS VM AVAIL FROM OS (min):         128G
CACHESIZEMAX (strict force to disk):     96G

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

Database Language and Character Set:
NLS_LANG         = ".ZHS16GBK" 
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "ZHS16GBK" 

2014-09-23 23:04:51  INFO    OGG-01021  Command received from GGSCI: STATS.

Processing table HR.T

***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2014-09-23 23:04:57 (activity since 2014-09-23 23:04:46)

Output to DHREMD1:

From Table HR.T:
       #                   inserts:       107
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


REDO Log Statistics
  Bytes parsed                    0
  Bytes output                24570

 

posted @ 2014-09-23 23:53  hao_xiaoyu  阅读(5489)  评论(0编辑  收藏  举报