Oracle GoldenGate配置过程

在同一个库的不同schema之间进行GoldenGate的配置,下面是详细的步骤。

1, 解压ogg的zip包,ogg是绿色软件,直接解压即可。
2,建立ogg所需的目录,直接用ggsci,然后命令create subdirs


[oracle@localhost base]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46

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



GGSCI (localhost.localdomain) 1> create subdirs

Creating subdirectories under current directory /u01/app/base

Parameter files                /u01/app/base/dirprm: created
Report files                   /u01/app/base/dirrpt: created
Checkpoint files               /u01/app/base/dirchk: created
Process status files           /u01/app/base/dirpcs: created
SQL script files               /u01/app/base/dirsql: created
Database definitions files     /u01/app/base/dirdef: created
Extract data files             /u01/app/base/dirdat: created
Temporary files                /u01/app/base/dirtmp: created
Veridata files                 /u01/app/base/dirver: created
Veridata Lock files            /u01/app/base/dirver/lock: created
Veridata Out-Of-Sync files     /u01/app/base/dirver/oos: created
Veridata Out-Of-Sync XML files /u01/app/base/dirver/oosxml: created
Veridata Parameter files       /u01/app/base/dirver/params: created
Veridata Report files          /u01/app/base/dirver/report: created
Veridata Status files          /u01/app/base/dirver/status: created
Veridata Trace files           /u01/app/base/dirver/trace: created
Stdout files                   /u01/app/base/dirout: created

3,建立所需要的三个用户,ggate用户,源和目标用户jss和jst。

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

create user jss identified by jss;
grant connect, resource to jss;

create user jst identified by jst;
grant connect, resource to jst;

4, 用jss登录,在源上建立一个测试表,并灌入一部分测试数据。

conn jss/jss
create table test as select * from user_objects where 1=2;
insert into test select * from user_objects ;
commit;

至此,所需要的准备工作完成,这里为了简化操作,我们只做最简单的dml的复制操作。

5,登录ggsci,配置manager所需要的端口并启动manager

GGSCI (localhost.localdomain) 4> edit params mgr

PORT 7809

GGSCI (localhost.localdomain) 5> start mgr
MGR is already running.

6,登录ggsci,连接进源数据库,并添加一个源复制队列和目标复制队列

GGSCI (localhost.localdomain) 6> dblogin userid ggate,password ggate
Successfully logged into database.


GGSCI (localhost.localdomain) 9> add extract ext1 ,tranlog,begin now
EXTRACT added.


GGSCI (localhost.localdomain) 10> add exttrail ./dirdat/lt ,extract ext1
EXTTRAIL added.


GGSCI (localhost.localdomain) 11> edit params ext1

extract ext1
userid ggate@orcldb,password ggate
rmthost 127.0.0.1,mgrport 7809
RMTTASK REPLICAT, GROUP rep1
table jss.*;


GGSCI (localhost.localdomain) 12> add replicat rep1,exttrail ./dirdat/lt,checkpointtable ggate.checkpo
int
REPLICAT added.


GGSCI (localhost.localdomain) 13> edit params rep1

REPLICAT rep1
ASSUMETARGETDEFS
USERID ggate@orcldb,PASSWORD ggate
DISCARDFILE ./dirrpt/rep1_gg2.dsc,PURGE
MAP jss.*, TARGET jst.*;


7,启动源和目标队列,并查看


GGSCI (localhost.localdomain) 30> start ext1

Sending START request to MANAGER ...
EXTRACT EXT1 starting


GGSCI (localhost.localdomain) 31> start rep1

Sending START request to MANAGER ...
REPLICAT REP1 starting

8,查看源和目标的复制结果


GGSCI (localhost.localdomain) 40> view report ext1


2011-11-25 13:16:54  INFO    OGG-01017  Wildcard resolution set to IMMEDIATE because SOURCEISTABLE is
used.

***********************************************************************
                 Oracle GoldenGate Capture for Oracle
     Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
   Linux, x64, 64bit (optimized), Oracle 11g on Oct  7 2011 05:37:17

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


                    Starting at 2011-11-25 13:16:54
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Mon Mar 29 22:10:29 EDT 2010, Release 2.6.18-194.el5
Node: localhost.localdomain
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: 4765

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
extract ext1
userid ggate@orcldb,password *****
rmthost 127.0.0.1,mgrport 7809
RMTTASK REPLICAT, GROUP rep1
table jss.*;
TABLEWildcard  resolved (entry JSS.*):
  table JSS.J1;

Using the following key columns for source table JSS.J1: ID.
TABLEWildcard  resolved (entry JSS.*):
  table JSS.J2;

2011-11-25 13:16:55  WARNING OGG-00869  No unique key is defined for table J2. All viable columns will
 be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the ke
y.

Using the following key columns for source table JSS.J2: ID, VL.
TABLEWildcard  resolved (entry JSS.*):
  table JSS.TEST;

2011-11-25 13:16:55  WARNING OGG-00869  No unique key is defined for table TEST. All viable columns wi
ll 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 JSS.TEST: ID.

CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                                8G
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):          16G
CACHESIZEMAX (strict force to disk):  13.99G

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

Database Language and Character Set:
NLS_LANG environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

Processing table JSS.J1

Processing table JSS.J2

Processing table JSS.TEST

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


Report at 2011-11-25 13:17:00 (activity since 2011-11-25 13:16:54)

Output to rep1:

From Table JSS.J1:
       #                   inserts:         4
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


REDO Log Statistics
  Bytes parsed                    0
  Bytes output                  316





GGSCI (localhost.localdomain) 41> view report rep1


***********************************************************************
                 Oracle GoldenGate Delivery for Oracle
     Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
   Linux, x64, 64bit (optimized), Oracle 11g on Oct  7 2011 05:44:59

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


                    Starting at 2011-11-25 13:16:55
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Mon Mar 29 22:10:29 EDT 2010, Release 2.6.18-194.el5
Node: localhost.localdomain
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: 4771

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
REPLICAT rep1
ASSUMETARGETDEFS
USERID ggate@orcldb,PASSWORD *****
DISCARDFILE ./dirrpt/rep1_gg2.dsc,PURGE
MAP jss.*, TARGET jst.*;

CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                              512M
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):           1G
CACHESIZEMAX (strict force to disk):    881M

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

Database Language and Character Set:
NLS_LANG environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

***********************************************************************
**                     Run Time Messages                             **
***********************************************************************


Wildcard MAP resolved (entry JSS.*):
  MAP JSS.J1, TARGET jst.J1;
Using following columns in default map by name:
  ID, VL

Using the following key columns for target table JST.J1: ID.


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


Report at 2011-11-25 13:17:05 (activity since 2011-11-25 13:17:00)

From Table JSS.J1 to JST.J1:
       #                   inserts:         4
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


CACHE OBJECT MANAGER statistics

CACHE MANAGER VM USAGE
vm current     =      0    vm anon queues =      0
vm anon in use =      0    vm file        =      0
vm used max    =      0    ==> CACHE BALANCED

CACHE CONFIGURATION
cache size       = 512M   cache force paging = 881M
buffer min       =  64K   buffer highwater   =   4M
pageout eligible size =   4M

================================================================================
RUNTIME STATS FOR SUPERPOOL

CACHE Transaction Stats
trans active   =      0    max concurrent =      0
non-zero total =      0    trans total    =      0

CACHE File Caching
disk current   =      0    disk total  =      0
disk caching   =      0    file cached =      0
file retrieves =      0

CACHE MANAGEMENT
buffer links  =      0   anon gets   =      0
forced unmaps =      0   cnnbl try   =      0
cached out    =      0   force out   =      0

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

Cached Transaction Size Distribution
    0:        0
 < 4K:        0
   4K:        0         0     |  16K:        0         0
  64K:        0         0     | 256K:        0         0
   1M:        0         0     |   4M:        0         0
  16M:        0         0     |  64M:        0         0
 256M:        0         0     |   1G:        0         0
   4G:        0         0     |  16G:        0         0
  64G:        0         0     | 256G:        0         0
   1T:        0         0     |   4T:        0         0
  16T:        0         0     |  64T:        0         0
 256T:        0         0     |1024T:        0         0

================================================================================
CUMULATIVE STATS FOR SUPERPOOL

CACHE Transaction Stats
trans active   =      0    max concurrent =      0
non-zero total =      0    trans total    =      0

CACHE File Caching
disk current   =      0    disk total  =      0
disk caching   =      0    file cached =      0
file retrieves =      0

CACHE MANAGEMENT
buffer links  =      0   anon gets   =      0
forced unmaps =      0   cnnbl try   =      0
cached out    =      0   force out   =      0

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

Cached Transaction Size Distribution
    0:        0
 < 4K:        0
   4K:        0         0     |  16K:        0         0
  64K:        0         0     | 256K:        0         0
   1M:        0         0     |   4M:        0         0
  16M:        0         0     |  64M:        0         0
 256M:        0         0     |   1G:        0         0
   4G:        0         0     |  16G:        0         0
  64G:        0         0     | 256G:        0         0
   1T:        0         0     |   4T:        0         0
  16T:        0         0     |  64T:        0         0
 256T:        0         0     |1024T:        0         0


QUEUE Statistics:
num queues    =     15     default index =      0
cur len       =      0     max len       =      0
q vm current  =      0     vm max        =      0
q hits        =      0     q misses      =      0

queue size  q hits  curlen  maxlen     cannibalized
  0   64K      0       0       0       0
  1  128K      0       0       0       0
  2  256K      0       0       0       0
  3  512K      0       0       0       0
  4    1M      0       0       0       0
  5    2M      0       0       0       0
  6    4M      0       0       0       0
  7    8M      0       0       0       0
  8   16M      0       0       0       0
  9   32M      0       0       0       0
 10   64M      0       0       0       0
 11  128M      0       0       0       0
 12  256M      0       0       0       0
 13  512M      0       0       0       0
 14    1G      0       0       0       0

================================================================================
RUNTIME STATS FOR CACHE POOL #0
POOL INFO   group: rep1  id: p4771_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000030
last error    = (0=)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

================================================================================
CUMULATIVE STATS FOR CACHE POOL #0
POOL INFO   group: rep1  id: p4771_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000030
last error    = (0=)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0


QUEUE Statistics:
num queues    =     15     default index =      0




This entry was posted in 数据库 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *