首页 > 代码库 > 3.使用OGG进程进行初始化数据
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 oggDBOPTIONS ALLOWNOLOGGINGRmtHost 192.168.1.3, mgrport 7809RmtTask Replicat, Group DHREMD1Table HR.T;
添加:
GGSCI (db11) 73> ADD EXTRACT IHREMD1, SOURCEISTABLE
目标端装载进程
GGSCI (10gasm) 34> edit param dhremd1Replicat DHREMD1--------------------------------------------------------------------- Initial load replicat for HR schema-------------------------------------------------------------------SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)USERID ogg, PASSWORD oggAssumeTargetDefsMap HR.T, Target HR.T ;~
添加:
GGSCI (10gasm) 35> ADD REPLICAT DHREMD1, SPECIALRUN
启动,源段校验
GGSCI (db11) 74> view report ihremd12014-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:LinuxVersion #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5Node: db11Machine: x86_64 soft limit hard limitAddress Space Size : unlimited unlimitedHeap Size : unlimited unlimitedFile Size : unlimited unlimitedCPU Time : unlimited unlimitedProcess id: 22239Description: ************************************************************************* 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 character set value of ZHS16GBK.DBOPTIONS ALLOWNOLOGGINGRmtHost 192.168.1.3, mgrport 7809RmtTask Replicat, Group DHREMD1Table 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 guarantee 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: 64GCACHEPAGEOUTSIZE (normal): 8MPROCESS VM AVAIL FROM OS (min): 128GCACHESIZEMAX (strict force to disk): 96GDatabase Version:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE 11.2.0.1.0 ProductionTNS for Linux: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 - ProductionDatabase 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: 0REDO Log Statistics Bytes parsed 0 Bytes output 24570
3.使用OGG进程进行初始化数据
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。